-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gatsby-design-tokens): v2 (#21240)
* Fix colors.black/whiteFade - add black/whiteFade[90,40,20,5] - fix black/whiteFade[80], was 85% * Modify code colors to comply to WCAG 2.0 AA * Add code colors copyButton, lineHighlightBackground, scrollbarTrack * Refactor code color names - bgInline -> backgroundInline - bg -> background * Remove sizes This contained almost only sizes very specific to gatsbyjs.org — `avatar` and `headerHeight` aside. `gatsby-interface` has its own `dimensions` definitions and should be unaffected by this change. * Name font-weights Add named font-weights, including the required theme-ui defaults `body`, `heading`, and `bold` (https://theme-ui.com/theme-spec#typography): - body: 400 - semiBold: 600 - gatsbyjs.org's source code expects this to be `medium`, needs minor refactor - bold: 700 - `gatsby-interface` defines `bold` as `800`, whatever it consumes needs to refactor to use `extraBold` instead - heading: 700 - extraBold: 800 - gatsbyjs.org's source code expects this to be `headingPrimary`, needs minor refactor * Add alias `body` for fonts.system, rename fonts.header to .heading - comply with theme-ui requirements: https://theme-ui.com/theme-spec#typography - consumers need to refactor `fonts.header` to `fonts.heading` * Add line-heights required by theme-ui … ah well. TBD. * Remove breakpoints.xxs These tokens started as only being consumed via styled-system. In its context, and using an object to define breakpoints, this somewhat made sense/was required. Since we switched to theme-ui, it doesn't anymore. And since `gatsby-interface` defines its own breakpoints, and gatsbyjs.org's source code already removes this breakpoint along adjusting the scale from object to array as required by `theme-ui`, this shouldn't hurt. * Add transition.default, .curve.fastOutLinearIn, .speed.faster, .slower … first step to bring stuff in line with `gatsby-interface` * @todo -> TODO * Add basic `theme-ui` theme * Add gatsbyjs.org theme Both themes don't tree-shake yet, so no agadoo. This enables - `import { theme as default } from "gatsby-design-tokens/dist/theme-gatsbyjs-org"` in `www/src/gatsby-plugin-theme-ui/index` - directly import individual token groups with `import { mediaQueries } from "gatsby-design-tokens/dist/theme-gatsbyjs-org"` * Fix that `watch` script stuff lol * 🤒 Named exports, new exports Pretty sure this is the most unelegant way to do this :D - add export `breakpointsArray`: breakpoints as expected by `theme-ui` - add export `fontsStrings`: oh naming things :-P … CSS value for `font-family` - add export `fontSizesRem`, - add export `spaceRem`: values in `rem`, as used by both gatsbyjs.org and `gatsby-interface` - adust `theme.js` accordingly - add TODO re:https://reverent-keller-9597e8.netlify.com/?path=/story/theme--tones * Add `px` unit to radii scale values Ref. gatsby-inc/gatsby-interface#181 * Tidy - alias `fonts.system` as `sans` - alias `fonts.heading` as `brand` - less noob - add `spacePx`, `fontSizesPx` (FWIW … ;)) * Default exports should honor the current main target (CSS) We also have preferences irt default units. - `fontsSizes` exports `rem` values now; old values available at `fontSizesRaw` - `space` exports `rem` values now, too; old stuff available at `spaceRaw` - `fonts` exports a string now, ready to be used with the `font-family` CSS prop; old array of font family names available as `fontsLists` * Change `transition.speed.slow` to `500ms` gatsby-inc/gatsby-interface#181 * Move `zIndices` to `theme-gatsbyjs-org` For clarity, see discussion in gatsby-inc/gatsby-interface#181 * Too clever * Order * Revert Refactor code color names - backgroundInline -> bgInline - background -> bg * Bump agadoo, add hex2rgba * Fix `code.bg`/`.bgInline` keys for `dark` mode * Bump README * Bump README moar Co-authored-by: GatsbyJS Bot <mathews.kyle+gatsbybot@gmail.com>
- Loading branch information
Showing
21 changed files
with
775 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export default [0, `1px solid`, `2px solid`] | ||
export const borders = [0, `1px solid`, `2px solid`] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
export default { | ||
xxs: 0, // needed for styled-system | ||
const b = { | ||
xs: `400px`, | ||
sm: `550px`, | ||
md: `750px`, | ||
lg: `1000px`, | ||
xl: `1200px`, | ||
xxl: `1600px`, | ||
} | ||
|
||
export const breakpoints = b | ||
|
||
const bp = [] | ||
for (const b in breakpoints) { | ||
bp.push(breakpoints[b]) | ||
} | ||
|
||
export const breakpointsArray = bp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
export default [400, 700, 800] | ||
export const fontWeights = { | ||
body: 400, | ||
semiBold: 600, | ||
bold: 700, | ||
extraBold: 800, | ||
heading: 700, | ||
} |
Oops, something went wrong.