-
Notifications
You must be signed in to change notification settings - Fork 69
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
[BD-46] feat: refactoring design tokens folders structure #2069
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ const chroma = require('chroma-js'); | |
* @return chroma-js color instance (one of dark or light variants) | ||
*/ | ||
function colorYiq(color, light, dark, threshold) { | ||
const defaultsFile = fs.readFileSync(path.resolve(__dirname, 'src', 'global', 'other.json'), 'utf8'); | ||
const defaultsFile = fs.readFileSync(path.resolve(__dirname, 'src', 'themes/light/global', 'other.json'), 'utf8'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [question] If/when we have a dark theme variant, I wonder if there is a way we might be able to future proof this The approach we're opting to take here is to have a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, I've modified our functions to check whether token belongs to any theme and take theme's colors instead (defaults to |
||
const defaults = JSON.parse(defaultsFile); | ||
|
||
const { | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"spacing": { | ||
"alert": { | ||
"padding": { | ||
"y": { "value": "1.5rem", "source": "$alert-padding-y" }, | ||
"x": { "value": "1.5rem", "source": "$alert-padding-x" } | ||
}, | ||
"margin-bottom": { "value": "1rem", "source": "$alert-margin-bottom" }, | ||
"actions-gap": { "value": "{spacing.spacer.3}", "source": "$alert-actions-gap" }, | ||
"icon-space": { "value": ".8rem", "source": "$alert-icon-space" } | ||
} | ||
}, | ||
"typography": { | ||
"alert": { | ||
"font": { | ||
"weight-link": { "value": "{typography.font.weight.normal}", "source": "$alert-link-font-weight" }, | ||
"size": { "value": ".875rem", "source": "$alert-font-size" } | ||
}, | ||
"line-height": { "value": "1.5rem", "source": "$alert-line-height" } | ||
} | ||
}, | ||
"size": { | ||
"alert": { | ||
"border": { | ||
"radius": { "value": "{size.border.radius.base}", "source": "$alert-border-radius" }, | ||
"width": { "value": "0", "source": "$alert-border-width" } | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"spacing": { | ||
"annotation": { | ||
"padding": { "value": ".5rem", "source": "$annotation-padding" }, | ||
"arrow-side": { | ||
"margin": { "value": ".25rem", "source": "$annotation-arrow-side-margin" } | ||
} | ||
} | ||
}, | ||
"typography": { | ||
"annotation": { | ||
"font-size": { "value": "{typography.font.size.sm}", "source": "$annotation-font-size" }, | ||
"line-height": { "value": "{typography.line-height.sm}", "source": "$annotation-line-height" } | ||
} | ||
}, | ||
"size": { | ||
"annotation": { | ||
"arrow-border": { | ||
"width": { "value": ".5rem", "source": "$annotation-arrow-border-width" } | ||
}, | ||
"max-width": { "value": "18.75rem", "source": "$annotation-max-width" }, | ||
"border-radius": { "value": ".25rem", "source": "$annotation-border-radius" } | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"spacing": { | ||
"badge": { | ||
"padding": { | ||
"x": { | ||
"base": { "value": ".5rem", "source": "$badge-padding-x" }, | ||
"pill": { "value": ".6em", "source": "$badge-pill-padding-x" } | ||
}, | ||
"y": { "value": ".125rem", "source": "$badge-padding-y" } | ||
} | ||
} | ||
}, | ||
"typography": { | ||
"badge": { | ||
"font": { | ||
"size": { "value": "75%", "source": "$badge-font-size" }, | ||
"weight": { "value": "{typography.font.weight.bold}", "source": "$badge-font-weight" } | ||
} | ||
} | ||
}, | ||
"size": { | ||
"badge": { | ||
"border-radius": { | ||
"base": { "value": ".25rem", "source": "$badge-border-radius" }, | ||
"pill": { "value": "10rem", "source": "$badge-pill-border-radius" } | ||
}, | ||
"focus-width": { "value": "{size.input.btn.focus-width}", "source": "$badge-focus-width" } | ||
} | ||
}, | ||
"transition": { | ||
"badge": { "value": "none", "source": "$badge-transition" } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"spacing": { | ||
"bubble": { | ||
"expandable-padding": { | ||
"y": { "value": "0", "source": "$bubble-expandable-padding-y" }, | ||
"x": { "value": ".25rem", "source": "$bubble-expandable-padding-x" } | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[curious] Is everything in the
other.json
file specific to the light theme variant? Or are some of the properties, possibly liketheme-interval
, andyiq-contrasted-threshold
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes,
theme-interval
andyiq-contrasted-threshold
are not theme-specific, moved the to thecore
tokens