Load global CSS classes which are not used

Hey there,

I am often facing an issue with the global CSS-Classes inside bricks. Whenever I want to output something using custom code I would find it quite handy to use the classes I’ve assigned and designed visually using the global CSS-Classes feature inside bricks.

Bricks seems to only output the styles for those classes which are used within bricks-element on that specific page. So my custom code won’t pick up any styles unless I have an element on that page with the same class.

I’ve found a temporary workaround to place a container-element, assign it that class and set it to display: none, which will then load the styles for that class again. It is not a very good solution, but it works…

So, my question is if there are any plans/possibilities to add a hook/filter so I can, for example, define classes which should also get loaded on that specific page for usage in custom code. Or maybe there exist any other methods to make a class available for custom code?!

4 Likes

Did anyone look into this?
I was just about to add a Suggestion on the BB main site.

My Suggestion:

I recently watched this video:

And it is a Webflow tutorial about animating elements using jquery.
What this guy is showing is styling the before class and styling the after class using Webflow (the builder). Removing the after class and using jquery to add or toggle the class on or off. Which I think is a nice way to do it.
Anyway, I tried this and used jquery to toggle my after class, but Bricks Builder knows the class is not on the page, so it does not write the class to the css.
So if you see what I mean, it would be nice to allow a class to be global, add the class to the css even if the class is not loaded initial on an element.

Hope that makes sense!
Thanks

This is the NEED of the hour :frowning:
I don’t want to keep custom coding classes inside spans or basic text elements. sigh

I believe an option like Oxygen where even when nothing is selected, you can create custom classes and save them for use later dynamically or just in random span elements. Please make this happen in Bricks.

2 Likes