Bricks + BEM: Adding "modifier" CSS using the "root" feature
HTML-код
- Опубликовано: 5 мар 2023
- ⛑️ Services I am now offering:
Get a Website Quote: wagepirate.com/?ff_landing=12
WP Consulting (I offer advice, you do the work): wagepirate.com/?fluent-bookin...
WP Support (I do the work for you): wagepirate.com/?ff_landing=15
📩 Get my free WordPress Newsletter (join 1600+ other people)
Subscribe ➜ wagepirate.com/subscribe/?utm...
(I share tips covering Bricks, FunnelKit, WooCommerce, business & marketing strategy + WordPress news)
Are you using BEM?
I have never here of BEM until today
I just realised that you will need to enable the new setting "Disable chaining element & global class" in WP Admin > Bricks > Settings > Performance for this to work.
Great video as always!
Is it valid to modify the modifier class through the Bricks UI instead of using root in the custom CSS box?
Cwicly has what it calls "Relative Styling" which allows you to do it. Bricks doesn't. What I mean is, if you want to make a dark version of the card, you need to target the parent (make its background black) and then you need to target the children and do changes (text to white, maybe a few other things). but its the targeting children that Bricks can't do, unless that has been released recently?
Ty, i had no idea why you started writing CSS, but that makes sense.
Also, RIP Cwicly
Site looks great pal!
Thanks Farhan! I'm happy with it. Now I just have to add more content 😎
I started to use BEM recently and am trying to convert my old templates with this method. Regarding the inline CSS, you're right, that setting is new to bricks, I activated on my website, but honestly not sure how that affects.
I read that Bricks are testing this "disable class chaining" feature and then they will move our Global CSS classes to their own CSS file if it all works OK. Fingers crossed!
No worries, custom css is being rendered that way, even with Elementor. I believe it is due the fact that every time you save page/ template, Bricks should open the main css file for writing, delete an old code, put the new css to the right place in the main file and save. Many unnecessary requests.
I read that Bricks are testing this "disable class chaining" feature and then they will move our Global CSS classes to their own CSS file if it all works OK. Fingers crossed!
BEM not the best methodology for Bricks
What do you use?