-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
sbb
prefixed variable files and convert prefixed css vari…
…ables to rem (#428)
- Loading branch information
1 parent
bfef7e2
commit a83810f
Showing
12 changed files
with
341 additions
and
50 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
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,30 +1,45 @@ | ||
import { DesignToken, DesignTokens } from 'style-dictionary'; | ||
|
||
const baseBorderWidth = 1; | ||
const baseBorderRadius = 2; | ||
|
||
const borderWidth = (width: number) => width * baseBorderWidth; | ||
const borderRadius = (width: number) => width * baseBorderRadius; | ||
|
||
export const border = { | ||
const attributes = () => | ||
<Partial<DesignToken>>{ | ||
attributes: { | ||
category: 'size', | ||
}, | ||
}; | ||
|
||
export const border: DesignTokens = { | ||
width: { | ||
'1x': { | ||
value: borderWidth(1), | ||
...attributes(), | ||
}, | ||
'2x': { | ||
value: borderWidth(2), | ||
...attributes(), | ||
}, | ||
}, | ||
radius: { | ||
'1x': { | ||
value: borderRadius(1), | ||
...attributes(), | ||
}, | ||
'4x': { | ||
value: borderRadius(4), | ||
...attributes(), | ||
}, | ||
'8x': { | ||
value: borderRadius(8), | ||
...attributes(), | ||
}, | ||
'16x': { | ||
value: borderRadius(16), | ||
...attributes(), | ||
}, | ||
}, | ||
}; |
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,58 +1,81 @@ | ||
export const breakpoint = { | ||
import { DesignToken, DesignTokens } from 'style-dictionary'; | ||
|
||
const attributes = () => | ||
<Partial<DesignToken>>{ | ||
attributes: { | ||
category: 'size', | ||
}, | ||
}; | ||
|
||
export const breakpoint: DesignTokens = { | ||
zero: { | ||
min: { | ||
value: 0, | ||
...attributes(), | ||
}, | ||
max: { | ||
value: 359, | ||
...attributes(), | ||
}, | ||
}, | ||
micro: { | ||
min: { | ||
value: 360, | ||
...attributes(), | ||
}, | ||
max: { | ||
value: 599, | ||
...attributes(), | ||
}, | ||
}, | ||
small: { | ||
min: { | ||
value: 600, | ||
...attributes(), | ||
}, | ||
max: { | ||
value: 839, | ||
...attributes(), | ||
}, | ||
}, | ||
medium: { | ||
min: { | ||
value: 840, | ||
...attributes(), | ||
}, | ||
max: { | ||
value: 1023, | ||
...attributes(), | ||
}, | ||
}, | ||
large: { | ||
min: { | ||
value: 1024, | ||
...attributes(), | ||
}, | ||
max: { | ||
value: 1279, | ||
...attributes(), | ||
}, | ||
}, | ||
wide: { | ||
min: { | ||
value: 1280, | ||
...attributes(), | ||
}, | ||
max: { | ||
value: 1439, | ||
...attributes(), | ||
}, | ||
}, | ||
ultra: { | ||
min: { | ||
value: 1440, | ||
...attributes(), | ||
}, | ||
max: { | ||
value: 2579, | ||
...attributes(), | ||
}, | ||
}, | ||
}; |
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
Oops, something went wrong.