Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Review the class naming convention for Mini Cart inner bl... #5418

Closed
github-actions bot opened this issue Dec 20, 2021 · 2 comments · Fixed by #5800
Closed

Review the class naming convention for Mini Cart inner bl... #5418

github-actions bot opened this issue Dec 20, 2021 · 2 comments · Fixed by #5800
Assignees
Labels
block: mini-cart Issues related to the Mini-Cart block. focus: FSE Work related to prepare WooCommerce for FSE. type: enhancement The issue is a request for an enhancement. type: refactor The issue/PR is related to refactoring.

Comments

@github-actions
Copy link
Contributor

Review the class naming convention for Mini Cart inner blocks.


https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/8d08c6056afede0f97ac204e6add679bc8d6e0d1/assets/js/blocks/cart-checkout/mini-cart/style.scss#L79-L90

🚀 This issue was generated by the automations bot based on a todo comment in 8d08c60 when #5386 was merged. cc @dinhtungdu
@dinhtungdu dinhtungdu added focus: FSE Work related to prepare WooCommerce for FSE. type: enhancement The issue is a request for an enhancement. block: mini-cart Issues related to the Mini-Cart block. type: refactor The issue/PR is related to refactoring. labels Dec 20, 2021
@gigitux gigitux self-assigned this Feb 1, 2022
@gigitux
Copy link
Contributor

gigitux commented Feb 1, 2022

Unfortunately, we can't do anything for this class .wp-block-woocommerce-mini-cart-contents because it is generated by Gutenberg, so it is fine that it doesn't respect our convention about the naming.

@dinhtungdu Do you remember if there are other classes to check? I checked cart-checkout/mini-cart/style.scss and cart-checkout/mini-cart-contents/editor.scss. It seems that all not convention names for the classes come from Gutenberg.

@dinhtungdu
Copy link
Member

Unfortunately, we can't do anything for this class .wp-block-woocommerce-mini-cart-contents because it is generated by Gutenberg, so it is fine that it doesn't respect our convention about the naming.

@gigitux for the Mini Cart Contents block, the wrapper class is actually taken from the mini-cart.html template part. So we can add class to that block like this:

<!-- wp:woocommerce/mini-cart-contents -->
<div class="wp-block-woocommerce-mini-cart-contents wc-block-mini-cart__contents">
	<!-- wp:woocommerce/filled-mini-cart-contents-block -->

It seems that all not convention names for the classes come from Gutenberg.

AFAIK, we're using our own convention for class names, which is using wc-block- as the prefix.

gigitux added a commit that referenced this issue Feb 9, 2022
Add wc-block-mini-cart__contents class for the Mini Cart block
gigitux added a commit that referenced this issue Feb 16, 2022
* Add wc-block-mini-cart__contents class for the Mini Cart block #5418

Add wc-block-mini-cart__contents class for the Mini Cart block

* removed comment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: mini-cart Issues related to the Mini-Cart block. focus: FSE Work related to prepare WooCommerce for FSE. type: enhancement The issue is a request for an enhancement. type: refactor The issue/PR is related to refactoring.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants