Skip to content

Commit

Permalink
move component tokens into indididual files (#1142)
Browse files Browse the repository at this point in the history
* move component tokens into indididual files

* fixing deprecated

* fix
  • Loading branch information
lukasoppermann authored Dec 19, 2024
1 parent b3bea1a commit e8ba280
Show file tree
Hide file tree
Showing 13 changed files with 196 additions and 471 deletions.
1 change: 1 addition & 0 deletions src/preprocessors/themeOverrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const themeOverrides: Preprocessor = {
// get override
const override =
token.$extensions?.[extensionProp][currentTheme] || token.$extensions?.[extensionProp][fallbackTheme]

// token an theme value exist
return {
...token,
Expand Down
65 changes: 65 additions & 0 deletions src/tokens/component/header.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
header: {
bgColor: {
$value: '{base.color.neutral.12}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
group: 'component (internal)',
scopes: ['bgColor'],
},
'org.primer.overrides': {
dark: {
$value: '{base.color.neutral.2}',
alpha: 0.95,
},
},
},
},
fgColor: {
default: {
$value: '{base.color.neutral.0}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
group: 'component (internal)',
scopes: ['fgColor'],
},
'org.primer.overrides': {
dark: '{base.color.neutral.13}',
},
},
alpha: 0.7,
},
logo: {
$value: '{base.color.neutral.0}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
group: 'component (internal)',
scopes: ['fgColor'],
},
'org.primer.overrides': {
dark: '{base.color.neutral.12}',
},
},
},
},
borderColor: {
divider: {
$value: '{base.color.neutral.8}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
group: 'component (internal)',
scopes: ['borderColor'],
},
},
},
},
},
}
32 changes: 32 additions & 0 deletions src/tokens/component/headerSerach.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
headerSearch: {
bgColor: {
$value: '{base.color.neutral.12}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
group: 'component (internal)',
scopes: ['bgColor'],
},
'org.primer.overrides': {
dark: '{base.color.neutral.1}',
},
},
},
borderColor: {
$value: '{base.color.neutral.8}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
group: 'component (internal)',
scopes: ['borderColor'],
},
'org.primer.overrides': {
dark: '{base.color.neutral.5}',
},
},
},
},
}
68 changes: 68 additions & 0 deletions src/tokens/component/overlay.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
overlay: {
bgColor: {
$value: '{base.color.neutral.0}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
group: 'component (internal)',
scopes: ['bgColor'],
},
'org.primer.overrides': {
dark: '{bgColor.muted}',
'dark-dimmed': '{base.color.neutral.5}',
},
},
},
borderColor: {
$value: '{borderColor.muted}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
group: 'component (internal)',
},
'org.primer.overrides': {
dark: {
alpha: 1,
$value: '{borderColor.muted}',
},
'dark-dimmed': {
$value: '{base.color.neutral.7}',
alpha: 0.7,
},
'light-high-contrast': {
alpha: 1,
$value: '{borderColor.default}',
},
'dark-high-contrast': {
$value: '{borderColor.default}',
alpha: 1,
},
},
},
alpha: 0.5,
},
backdrop: {
bgColor: {
$value: '{base.color.neutral.7}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
group: 'component (internal)',
scopes: ['bgColor'],
},
'org.primer.overrides': {
dark: '{base.color.neutral.3}',
'dark-dimmed': '{base.color.neutral.4}',
'light-high-contrast': '{base.color.neutral.11}',
'dark-high-contrast': '{base.color.neutral.11}',
},
},
alpha: 0.4,
},
},
},
}
29 changes: 29 additions & 0 deletions src/tokens/component/skeletonLoader.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
skeletonLoader: {
bgColor: {
$value: '{base.color.neutral.8}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',
group: 'component',
scopes: ['bgColor'],
},
'org.primer.overrides': {
dark: {
alpha: 0.2,
},
'light-high-contrast': {
$value: '{base.color.neutral.5}',
alpha: 1,
},
'dark-high-contrast': {
$value: '{base.color.neutral.5}',
alpha: 1,
},
},
},
alpha: 0.1,
},
},
}
81 changes: 0 additions & 81 deletions src/tokens/functional/color/dark/app-dark.json5
Original file line number Diff line number Diff line change
Expand Up @@ -251,85 +251,4 @@
},
},
},
header: {
fgColor: {
default: {
$value: '{fgColor.onEmphasis}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',

group: 'component',
scopes: ['fgColor'],
},
},
alpha: 0.7,
},
logo: {
$value: '{fgColor.onEmphasis}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',

group: 'component',
scopes: ['fgColor'],
},
},
},
},
bgColor: {
$value: '{base.color.neutral.10}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',

group: 'component',
scopes: ['bgColor'],
},
},
},
borderColor: {
divider: {
$value: '{base.color.neutral.4}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',

group: 'component',
scopes: ['borderColor'],
},
},
},
},
},
headerSearch: {
bgColor: {
$value: '{base.color.neutral.10}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',

group: 'component',
scopes: ['bgColor'],
},
},
},
borderColor: {
$value: '{base.color.neutral.7}',
$type: 'color',
$extensions: {
'org.primer.figma': {
collection: 'mode',

group: 'component',
scopes: ['borderColor'],
},
},
},
},
}
18 changes: 0 additions & 18 deletions src/tokens/functional/color/dark/overrides/dark.dimmed.json5
Original file line number Diff line number Diff line change
Expand Up @@ -176,24 +176,6 @@
},
},
},
overlay: {
backdrop: {
bgColor: {
$value: '{base.color.neutral.4}',
$type: 'color',
alpha: 0.4,
},
},
bgColor: {
$value: '{base.color.neutral.5}',
$type: 'color',
},
borderColor: {
$value: '{base.color.neutral.7}',
$type: 'color',
alpha: 0.7,
},
},
button: {
primary: {
bgColor: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,20 +517,6 @@
},
},
},
overlay: {
borderColor: {
$value: '{borderColor.default}',
$type: 'color',
alpha: null,
},
backdrop: {
bgColor: {
$value: '{base.color.neutral.11}',
$type: 'color',
alpha: 0.4,
},
},
},
display: {
blue: {
bgColor: {
Expand Down Expand Up @@ -885,11 +871,4 @@
$type: 'color',
},
},
skeletonLoader: {
bgColor: {
$value: '{base.color.neutral.5}',
$type: 'color',
alpha: 1,
},
},
}
Loading

0 comments on commit e8ba280

Please sign in to comment.