Closed 1aron closed 1 year ago
🎉 Partially released in https://github.com/master-co/css/releases/tag/v2.0.0-beta.184
:tada: This issue has been resolved in version 2.0.0-beta.192 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This issue has been resolved in version 2.0.0-rc.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
110
60
29
56
Currently we use
config.values
orconfig.rules[].values
to implement global variables, but they are not flexible enough and can be assigned anywhere reliably.✨ New configuration
variables
Everything will make more sense by integrating any design tokens into the new concept of Master CSS Variables:
✨ New variable syntax
Previously
$(variable)
was used to simplify the native CSS functionsvar(--variable)
. To make the application more concise, we retain$(variable)
as the syntax of Master CSS Variables.Use the new function
$(variable-xxx)
to explicitly access any target variable from anywhere.Generated CSS:
In fact,
m:$(spacing-x1)
is equivalent tom:x1
because we've pre-assigned thespacing
variable group to themargin
rule:Fallback
If the Master CSS variable cannot be found, it falls back to the native CSS variable.
Alias
You can use
$()
in the configuration to set an alias for another variable.✨ Variables for different themes
config.colors
currently supports different themes and is also a variable, we plan to merge it intoconfig.variables
.🟠 It's based on N different themes, N corresponding CSS rules are generated with the same syntax. These rules cannot be reused across themes, meaning the CSS size will immediately grow with the number of themes.
🟢 Generate CSS variables on demand based on syntax.
This architecture will produce less CSS than previous versions.