Skip to content

Commit

Permalink
feat: Adds scale and expanded scale variables.
Browse files Browse the repository at this point in the history
Right now, developers have to multiple `$baseline` by integers to get values along the scale. Although this is trivia, it does introduce a source of divergence from the design system should someone forget what the scale values are. This commit introduces expanded variables for the scale and the values.

Not the that while the `json`, `custom-properties`, and 'scss' module formats the scale itself correctly, the `common.js` formatter does not. I'm not quite sure why, but I'm also not certain it's necessary in that format. We can revisit that if necessary though.
  • Loading branch information
AndrewO authored and Andrew O'Brien committed Aug 1, 2018
1 parent 5edf4c7 commit b9e7839
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 7 deletions.
3 changes: 2 additions & 1 deletion index.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
imports:
- space/_space.yml
- space/_space.yml
- space/_scale.yml
41 changes: 41 additions & 0 deletions space/_scale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
global:
type: size
category: Baseline
props:
# TODO: derive from `baseline` and `baseline-scale` values in a way that works across all formatters
baseline-scale:
category: Baseline
type: scale
value:
- 2
- 3
- 4
- 6
- 9
- 12
- 18
- 24
- 36
baseline-1:
value: ".25rem"
baseline-2:
value: "0.50rem"
baseline-3:
value: "0.75rem"
baseline-4:
value: "1rem"
baseline-6:
value: "1.5rem"
baseline-9:
value: "2.25rem"
baseline-12:
value: "3rem"
baseline-18:
value: "4.5rem"
baseline-24:
value: "6rem"
baseline-36:
value: "9rem"



8 changes: 3 additions & 5 deletions space/_space.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
global:
type: size
category: Baseline

props:
baseline:
value: ".25rem"
category: Baseline
type: size
value: ".25rem"
13 changes: 12 additions & 1 deletion token_names.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[
"baseline"
"baseline",
"baseline-1",
"baseline-12",
"baseline-18",
"baseline-2",
"baseline-24",
"baseline-3",
"baseline-36",
"baseline-4",
"baseline-6",
"baseline-9",
"baseline-scale"
]

0 comments on commit b9e7839

Please sign in to comment.