IMPLEMENTED: Custom classes are too specific and firmly inline

Yes i agree. It would be great if this can be fixed.

+1 Must have - needs to be addressed

+1 I Agree with this. would make things easier.

+1… hopefully fixed asap. at least an answer from team would be immense nice.

+1 Please fix this behavior asap!

+1.
Hope it’s get fixed in next version

This one seems like a duplicate of a post from yesterday (to which I just replied): Remove Bricks selector from CSS output on custom classes so the class can be used on different elements - #26 by thomas

I’ll keep everyone posted about upcoming improvements about this in the original/first post linked above.

3 Likes

Hi @thomas , thanks for looking at this. My post added the issue that custom classes are added to the head of every html page in a style block and are not scooped up into external css files if that option is ticked.

4 Likes

Ah, ok. My bad. Yes, those two are interconnected. We’ll address both.

14 Likes

I fear it’s not the same. The first example: Selects all elements with both name1 and name2 set within its class attribute. The second example: Selects all elements with name2 that is a descendant of an element with name1

W3 Schools

I think you misunderstood what I was saying.

Bricks creating .myclass.bricksclass{} does not prevent you from using .myclass{} to target another element with a bricksclass on it.

I guess my code on the 9th wasn’t clear

e.g. if you set .mycustomclass{color:red;}

and bricks writes the selector as .mycustomclass.brickselementclass{color:red;}

That doesn’t stop you from using .mycustomclass on a different element, when bricks will add:

.mycustomclass.bricksotherelementclass{color:red;}

That was the point, not that one set of selectors was the same as the other.

I over simplified, sorry.

I think some people thought that bricks was changing the class name, so they couldn’t reuse it.

2 Likes

v 1.6.1 and the specified behavior still exists

4 Likes

I am hoping this gets fixed soon along with the related Class Management feature request.

4 Likes

This thread has been discussed for such a long time. I hope to see this to be resolved soon.

6 Likes

really looking forward to get a timeframe when this will see a fix. thanks

5 Likes

its been a while. trying to get some infos about this again. ty.

Hi guys,
We’ve added a “disable class chaining” setting in Bricks 1.7 beta, now available as a manual download in your Bricks account: Account – Bricks

You’ll find the setting under Bricks > Settings > Performance > Disable chaining element & global class

Once enabled global classes are output without the element class like: .my-global-class.
Meaning you can use your global classes on non-Bricks elements too.

If the feedback is positive, the next step is to provide one global class CSS file (when using the external file CSS loading method) rather than loading those rules inline.

Best regards,
timmse

7 Likes

Tested this without any issues. I appreciate this improvement. :+1:

1 Like

Hey Stefan,

What you said above, does it correlate with this:

Or is that something different?

Many thanks

Mick

Hey Michael,
The original words are from the changelog, but yes, that’s the point.

1 Like