-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #10645 - Allow BEM class via attribute tag. Public #10655
Conversation
How about class__1? That seems to be valid for BEM classes too from here. |
@@ -463,7 +463,7 @@ public function addRss($title, $href) | |||
*/ | |||
public function addBodyClass($className) | |||
{ | |||
$className = preg_replace('#[^a-z0-9]+#', '-', strtolower($className)); | |||
$className = preg_replace('#[^a-z0-9-]+#', '-', strtolower($className)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add _ to the regex after - for classes like class__1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Miguel,
done!
This caused some internal tests to fail, working on getting those fixed. |
@miguelbalparda I have some doubts on what happened with testing of this class. Change in Also, would be nice to clarify the BEM intention in test here by some |
@magento-team Will this be backported to 2.2? |
@Ctucker9233 just backport whatever you need like @amol2jcommerce just did instead of asking 😉 |
@orlangur Just thought I would ask instead of assuming. Glad someone took care of it. |
@Ctucker9233 I would say for any PR older than 3 months/1-2 minor releases contribution is unlikely to be backported by somebody from Magento. |
@orlangur Good to know. |
Description
Before the fix, classes with -- in them was replaced with a single - so result with input class--1 appears as class-1, breaking the BEM convention.
Fixed Issues
Manual testing scenarios
<attribute name="class" value="class--1" />
Contribution checklist