Skip to content
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

design tokens #304

Merged
merged 35 commits into from
May 22, 2022
Merged

Conversation

romainmenke
Copy link
Member

@romainmenke romainmenke commented Mar 14, 2022

see : #192
see : #151


Notice :

A lot has changed since the initial pull request was opened.
I have hidden all comments as they likely no longer apply.


The README in this pull request illustrates the current design direction

{
	"color": {
		"background": {
			"primary": { "value": "#fff" }
		}
	}
}
@design-tokens url('./tokens.json') format('style-dictionary3');

.foo {
	color: design-token('color.background.primary');
}

/* becomes */

.foo {
	color: #fff;
}

Current approach aims to support multiple token file formats side by side.
Will also heavily lean on IDE support for ergonomics.

@Antonio-Laguna

This comment was marked as outdated.

@romainmenke

This comment was marked as outdated.

@romainmenke

This comment was marked as outdated.

@Antonio-Laguna

This comment was marked as outdated.

@romainmenke

This comment was marked as outdated.

@romainmenke

This comment was marked as outdated.

@equinusocio

This comment was marked as outdated.

@romainmenke

This comment was marked as outdated.

@romainmenke romainmenke marked this pull request as ready for review May 21, 2022 16:22
@romainmenke

This comment was marked as resolved.


All `@design-tokens` rules are evaluated before any `design-token()` functions.

`@design-tokens` rules can be conditional through `when` conditions. Multiple values can be specified in `when`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a comment that specifies that when multiple it means AND, not OR? Or something as in, all conditions must be met?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this bit :

Multiple conditions always have an AND relationship.

Copy link
Member

@Antonio-Laguna Antonio-Laguna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@romainmenke romainmenke merged commit 2c75263 into main May 22, 2022
@romainmenke romainmenke deleted the design-tokens--affectionate-sponge-94364bcfba branch May 22, 2022 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants