Back to Woocommerce

Class names update in 2.8.0

plugins/woocommerce/client/blocks/docs/designers/theming/class-names-update-280.md

10.8.0-dev7.3 KB
Original Source

Class names update in 2.8.0 <!-- omit in toc -->

Table of Contents <!-- omit in toc -->

In WooCommerce Blocks 2.8.0, we replaced and deprecated some some class names to simplify them, fix inconsistencies, and make it easier to differentiate frontend components from editor components.

Replaced classes

Some classes that were introduced in 2.6.0 and 2.7.0 and didn't ship in WooCommerce Core have been replaced by new ones. They can be found in this table:

RemovedNew class name
wc-block-address-formwc-block-components-address-form
wc-block-checkout-formwc-block-components-checkout-form
wc-block-checkout-stepwc-block-components-checkout-step
wc-block-cart__payment-method-iconswc-block-components-payment-method-icons
wc-blocks-payment-method-iconwc-block-components-payment-method-icon
wc-block-cart__payment-method-labelwc-block-components-payment-method-label
wc-block-low-stock-badgewc-block-components-product-low-stock-badge
wc-block-product-metadatawc-block-components-product-metadata
wc-block-product-namewc-block-components-product-name
wc-block-product-pricewc-block-components-product-price
wc-block-product-price--regularwc-block-components-product-price__regular
wc-block-sale-badgewc-block-components-sale-badge
wc-block-product-variation-datawc-block-components-product-variation-data
wc-block-cart__shipping-calculatorwc-block-components-shipping-calculator
wc-block-shipping-calculatorwc-block-components-shipping-calculator
wc-block-cart__shipping-addresswc-block-components-shipping-address
wc-block-shipping-rates-controlwc-block-components-shipping-rates-control
wc-block-coupon-codewc-block-components-totals-coupon
wc-block-cart-coupon-listwc-block-components-totals-discount__coupon-list
wc-block-totals-footer-itemwc-block-components-totals-footer-item
wc-block-totals-table-itemwc-block-components-totals-item
wc-block-shipping-totalswc-block-components-totals-shipping
wc-block-checkboxwc-block-components-checkbox
wc-block-country-inputwc-block-components-country-input
wc-block-loading-maskwc-block-components-loading-mask
wc-blocks-loading-mask__childrenwc-block-components-loading-mask__children
wc-block-quantity-selectorwc-block-components-quantity-selector
wc-block-radio-controlwc-block-components-radio-control
wc-block-selectwc-block-components-select
wc-block-mainwc-block-components-main
wc-block-sidebar-layoutwc-block-components-sidebar-layout
wc-block-sidebarwc-block-components-sidebar
wc-block-notices__snackbarwc-block-components-notices__snackbar
wc-block-text-inputwc-block-components-text-input
wc-block-component__titlewc-block-components-title
wc-block-form-input-validation-errorwc-block-components-validation-error
wc-block-checkout__save-card-infowc-block-components-payment-methods__save-card-info

Note: If not listed, all items in the table above include derived classes.

For example, given that wc-block-address-form changed to wc-block-components-address-form:

  • wc-block-address-form__company also changed to wc-block-components-address-form__company
  • wc-block-address-form__address_1 also changed to wc-block-components-address-form__address_1

In most cases, it should be safe to do a search & replace in the stylesheet replacing the removed class names with the new ones.

Deprecated classes

Some classes that were introduced in previous versions or that have shipped in WooCommerce Core, have not been removed but are deprecated. Those classes will not be removed until the next major version but all themes are encouraged to update to the new ones as soon as possible:

DeprecatedNew class name
wc-block-errorwc-block-components-error
wc-block-product-sort-selectwc-block-components-product-sort-select
wc-block-formatted-money-amountwc-block-components-formatted-money-amount
wc-block-checkbox-listwc-block-components-checkbox-list
wc-block-dropdown-selectorwc-block-components-dropdown-selector
wc-block-filter-submit-buttonwc-block-components-filter-submit-button
wc-block-load-morewc-block-components-load-more
wc-block-paginationwc-block-components-pagination
wc-block-pagination-pagewc-block-components-pagination__page
wc-block-pagination-ellipsiswc-block-components-pagination__ellipsis
wc-block-review-listwc-block-components-review-list
wc-block-review-sort-selectwc-block-components-review-sort-select
wc-block-price-filterwc-block-components-price-slider
wc-block-form-text-inputwc-block-components-price-slider__amount

Note: if not listed, all items in the table above include derived classes.

For example, given that wc-block-error changed to wc-block-components-error

  • wc-block-error__company also changed to wc-block-components-error__content
  • wc-block-error__address_1 also changed to wc-block-components-error__image
<!-- FEEDBACK -->

We're hiring! Come work with us!

šŸž Found a mistake, or have a suggestion? Leave feedback about this document here.

<!-- /FEEDBACK -->