New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ v2 - Themes #67
Comments
I think we should use Javascript Object for defining tokens. JSON looks bad. It would be great If we can also use Master CSS color palette in design tokens. |
An amazing v2 (beta) so far, would love it if |
@itsezc I guess you've already seen it. Master CSS v2.0 Beta Release #79 - Built-in theme switching and synchronization |
I think it should be an external package and there may be more than one specification for design tokens. Something like this: /* master.css.js */
import { extend } from '@master/css'
import xDesignTokens from 'x-design-tokens'
import xDesignTokensToMasterCSSConfig from 'x-design-tokens-to-master-css-config'
module.export = extend(
{
classes: { },
...
},
xDesignTokensToMasterCSSConfig(xDesignTokens)
) |
Description
This issue takes into account issues raised on:
Style/Styles.extend
#54font-color:$(variable)
not working with scoped variables #55Introduction
Theming is a crucial part of web applications, it has been around for decades now and only expected to grow as apps become more complex, increase in scopes and the types of devices increase.
It is important that we address themes and provide flexibility for users so that they can build powerful, accessible and immersive UI and UX for it's users.
There are multiple types of themes:
A (fairly) new standard has emerged from the Design Tokens Community Group (DTCG) that introduces a new specification for design tokens to unify and standardize how they are consumed. This isolates design tokens from a "theme", where these work separately from each other and a theme becomes a semantic feature.
Design tokens in Master
Currently Master does provide a lot of configuration for styling, while this is starting point, it can be expanded upon greatly. I propose that we incorporate design tokens directly into Master (please refer to design token specification for further documentation / information about it).
Demonstration
design.tokens
master.css.js
ormaster.css.ts
The transformed JSON would look similar to:
Usage without Themes
This issue is open for comments should anyone have any concerns or ideas on how this maybe improved.
Currently, I'm working with @1aron to create a suitable API to bring “theming” into scope with the design tokens, as more thought needs to go into that.
The text was updated successfully, but these errors were encountered: