and thought while this is quite silly, i think webstudio making a unique class for basically every individual thing is good either
for example this on the webstudio home page
this is like a 100 combo class and instead of making it simpler i think this only made this more complicated
in my use cases i'd prefer to be able to create a class which actually defines a bunch of stuff to reuse, but even though all my boxes in this project of mine have the same token, it's generated a ton of duplicate identical classes, is this not a bug?
its not a bug, its called atomic css
same as tailwind, though class names are hashes
we might switch later on to using tailwind naming
this is effectively a performance optimization that allows projects to scale infinitely in terms of css
additionally you can turn this off in publish settings inside project settings
what we generate is actually extremely optimized
This is what I was wondering if was a bug or not, my token has not been respected, and there are duplicate identical classes even though they're copy pasted. should they not all use the same class?
we will have a look tomorrow
wait you have atomic css disabled
I thought we are talking about atomic css
Well, I am. But also about webstudio's css generally
this conversation just became confusing
are we talking about duplicated css with atomic option on or not?
Ah sorry, yeah duplicated css without atomic option. generally kind of crazy looking with atomic on
without atomic option this is probably correct
you didn't create tokens on and used local styles, right?
I have like 3 tokens in the whole project which are all I've used
that's why I'm confused it's generated like this
unless i've not used tokens? I'm pretty sure I did
changing the style on the token applies to everything as it should in the editor
try naming your instances and the css will become clear
hmm, it still creates a lot of bloat with the identical classes in the stylesheet.
I feel like what I want is definitely down to my personal taste, which would be a readable mode which instead of creating multi selector classes and having every individual element have a unique indexed class name it would be 1 class per token and use maybe inline style for the "local" style
I am not sure the non-atomic version is corect (we will check) ... but I think generally expecting css generated in particular style is difficult
what you usually write in css has tons of issues with specificity, what we generate has to be bullet proof
you can't compose classes without css specificity issues
source order specificity will not allow it, without having strict rules about which classes can be composed how
most people write css in a naive way that is error prone and they only learn about it when they hit a specificity issues and then they use !important or other ways to increase specificity
future native mixin rule will make this better