Use build-free CSS as source of truth for themes #5396
Replies: 8 comments
|
My honest take on this is that this feels like over-engineering. |
|
For all people who want colors for mobile apps, they can have a CSS file to generate JSON. Now, all people who want CSS needs JSON, so we are actually just flipping the table - using the origin format that most consumers need |
|
Some thoughts after being on vacation for 3 weeks.
|
|
Something I dreamt about last night. We could also have an Something like. "input": [
"theme1.css",
{ "theme2": "color": { "accent": "#12345" } },
"theme3.json"
]"input": {
"theme1": "theme1.css",
"theme2": "color": { "accent": "#12345" },
"theme3": "theme3.json"
} |
|
hehe, this is going too far :D |
I agree wholeheartedly on the predicates :) The more I think about it the more I lean towards still having todays approach with a config file but improving how its defined/used as well as output formats. No matter how we turn it, we need that config schema. The generated CSS file can be used as a "config file" today if you want imho. In short:
|
|
Move this to discussion as this is something we want to do in the future, but needs more investigation and experimenting. No prioritised as of now, but something we can keep in the back of our mind when working with updating themebuilder, cli and figma plugin. So far: @eirikbacker did also spike on using postcss for parsing css file and its resolving expressions which looked very promising. This could be a great replacement for style-dictionary as our config -> css transpiler, not to mention probably much more performant. In doing so, we would indirectly have support for css -> config. #5394 |
Also for context:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We want to explore the possibility for using CSS as source of truth for themes.
Goal
The goal is to be closer to native, have better CSS implementations and make it easier for users to configure (and override) Designsystemet along with custom variables.
We want users to be able just use a CSS file and configure it with
dsvariables and use it with our other building blocks without a build step.Only when other formats or extensions are needed a build step would be required (such as design-tokens, types, tailwind theme file etc)
Thoughts
my-theme.ds-theme.css*.ds-theme.csswill count as themes of the same system.- Running cli with justdesignsystemetwith pickup css file and populate remaining values.- Use js so that users can manipulate, say banner with date values.data-color,data-color-schemeetc?Hurdles:
ds-colorvariable names.Drafts
config file with a new
inputif other output forms are needed.{ "input": [ "./digdir.ds-theme,css", "./altinn.dstheme.css" ], "output": [ "design-tokens", "types", { "type":"css", "tailwind":"v4" } ] }All reactions