LearnNewsExamplesServices
Frontmatter
id5113
titleenhance the convertDesignTokens program
stateClosed
labels
enhancementstale
assigneestobiu
createdAtNov 29, 2023, 1:03 PM
updatedAtSep 12, 2024, 4:29 AM
githubUrlhttps://github.com/neomjs/neo/issues/5113
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtSep 12, 2024, 4:29 AM

enhance the convertDesignTokens program

Closed v8.1.0 enhancementstale
tobiu
tobiu commented on Nov 29, 2023, 1:03 PM

@mxmrtns since we are now including extensions, the logic will become more complex.

Example:

Screenshot 2023-11-29 at 12 58 04

inside the semanic tokens, we reference to a core token value.

Now if we want to use SCSS based functions like: lighten(myColor, 10%)

We can not use CSS variables as input (SCSS is not aware of their values).

To do it right, we need to parse all token files first and create a JS map of keys (namespaces) and values. This also needs to honor direct extensions of values.

Once we have the map in place, we can then parse each file on its own and in case a value references another token and has an extension (lighten(), darken(), etc.), then we can replace the token value with the plain value from the map.

Tokens without an extension can still get mapped directly to CSS variables.

tobiu added the enhancement label on Nov 29, 2023, 1:03 PM
tobiu assigned to @tobiu on Nov 29, 2023, 1:03 PM