Changes in root colors generation

I couldn’t find an announcement on this. I saw there’s new root color declarations (primary-900, primary-800, …)

I’m working on a theme and I get different calculations for these (primary is the same), apparently depending on Discourse version?

Screenshot from 2022-03-03 12-54-20

Screenshot from 2022-03-03 11-48-50

Is there more information how shades and tints will be generated? Also, if the numerical system is planned to fully replace the descriptive terms (low, medium, high,…)?

2 Likes

Hello,

I believe this is the color transformations file where you can check the percentage how these variables made.

2 Likes

Thanks @dodesz! But yeah, I know where the colors are declared… I was curious about the considerations behind it and the plans going forward.

E.g. right now there’s numeric values for primary and tertiary. Why not for all values from a color scheme? Is that planed?

Also, right now numeric values are only generating lighter tints. Why not use a more standard system where 500 is assigned the main color, with tints <500 and shades >500?

Another topic, why are tints not generated in a more linear way, but as a blend with another main color from the color scheme?

Right now I can’t use the Discourse color system to implement color declarations when a client has a comprehensive design system. I practically need to declare all values from scratch. If generated colors in Discourse are now defined in a numeric way, why not implement a system that’s consistent and more aligned with color generation in common design systems?

3 Likes

Yes, see UX: Styleguide changes & color variable additions by jordanvidrine · Pull Request #15984 · discourse/discourse · GitHub for context.

Calculation changed 8 days ago, please update to latest.

5 Likes