Skip to content

Commit

Permalink
build: update config to better filter darkmode tokens
Browse files Browse the repository at this point in the history
This commit updates the config files to address the following:

1. Remove unused legacy resources
2. Use `darkmode` json flag to better filter output of tokens

Changes to be committed:
modified:   scripts/config-darkmode.json
modified:   scripts/config.json
  • Loading branch information
blackfalcon committed Sep 14, 2023
1 parent 8b76b9c commit d6d87b4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 243 deletions.
210 changes: 36 additions & 174 deletions scripts/config-darkmode.json
Original file line number Diff line number Diff line change
@@ -1,203 +1,60 @@
{
"include": ["./src/asset/*.json", "./src/size/*.json", "./src/*.json"],
"include": ["./src/color/base.json", "./src/color/brand.json", "./src/color/alert.json", "./src/comments.json"],
"source": ["./src/color-darkmode/*.json"],
"platforms": {
"SCSSVariables--darkmode": {
"SCSSVariables": {
"transformGroup": "scss",
"prefix": "ds",
"comment": "File type: SCSS; variable type: Sass; filter: public, theme: dark mode",
"buildPath": "./dist/tokens/",
"buildPath": "./dist/tokens/darkmode/",
"files": [
{
"destination": "SCSSVariables--darkmode.scss",
"destination": "SCSSVariables.scss",
"format": "scss/variables",
"filter": {
"public": true
}
},
{
"destination": "SCSSVariablesMapFlat--darkmode.scss",
"format": "custom/scss/map-flat",
"mapName": "auroTokens",
"filter": {
"public": true
}
}
]
},
"CSSVariables--darkmode": {
"transformGroup": "css",
"prefix": "ds",
"comment": "File type: CSS; variable type: css; filter: public",
"buildPath": "./dist/tokens/",
"files": [
{
"destination": "CSSVariables--darkmode.css",
"format": "css/variables",
"filter": {
"public": true
"public": true,
"darkmode": true
}
},
{
"destination": "CSSVariablesMapFlat--darkmode.css",
"destination": "SCSSVariablesMapFlat.scss",
"format": "custom/scss/map-flat",
"mapName": "auroTokens",
"filter": {
"public": true
}
}
]
},
"SCSSOpacityVariables--darkmode": {
"transformGroup": "scss",
"prefix": "ds",
"comment": "File type: SCSS; variable type: Sass; filter: opacity, theme: dark mode",
"buildPath": "./dist/tokens/",
"files": [
{
"destination": "SCSSOpacityVariables--darkmode.scss",
"format": "scss/variables",
"filter": {
"opacity": true
}
}
]
},
"SCSSVariableMap--darkmode": {
"transformGroup": "scss",
"prefix": "ds",
"comment": "File type: SCSS; variable type: Sassmap; filter: size, public, theme: dark mode",
"dependency": "WCSS: ./src/utilityMixins/_spacingUtility.scss",
"buildPath": "./dist/tokens/",
"files": [
{
"destination": "SCSSVariableMap--darkmode.scss",
"format": "scss/map-deep",
"filter": {
"attributes": {
"category": "size"
},
"public": true
"public": true,
"darkmode": true
}
}
]
},

"CSSCustomProperties--darkmode": {
"CSSCustomProperties": {
"transformGroup": "css",
"prefix": "ds",
"comment": "File type: CSS; variable type: CSS; filter: public, theme: dark mode",
"buildPath": "./dist/tokens/",
"files": [
{
"destination": "CSSCustomProperties--darkmode.css",
"format": "css/variables",
"filter": {
"public": true
}
}
]
},
"CSSCustomPropertiesColorRGB--darkmode": {
"transformGroup": "css",
"transforms": ["attribute/cti", "name/cti/kebab", "custom/color/rgb"],
"prefix": "ds-rgb",
"comment": "File type: CSS; variable type: CSS; filter: color; custom rgb output, theme: dark mode",
"buildPath": "./dist/tokens/",
"files": [
{
"destination": "CSSCustomPropertiesColorRGB--darkmode.css",
"format": "css/variables",
"filter": {
"attributes": {
"category": "color"
},
"public": true
}
}
]
},
"SassCustomPropertiesColorRGB--darkmode": {
"transformGroup": "css",
"transforms": ["attribute/cti", "name/cti/kebab", "custom/color/rgb"],
"prefix": "ds-rgb",
"comment": "File type: Sass; variable type: CSS; filter: color; custom rgb output, theme: dark mode",
"buildPath": "./dist/tokens/",
"files": [
{
"destination": "SassCustomPropertiesColorRGB--darkmode.scss",
"format": "css/variables",
"filter": {
"attributes": {
"category": "color"
},
"public": true
}
}
]
},
"CSSOpacityCustomProperties--darkmode": {
"transformGroup": "css",
"prefix": "ds",
"comment": "File type: SCSS; variable type: Sass; filter: opacity, theme: dark mode",
"buildPath": "./dist/tokens/",
"buildPath": "./dist/tokens/darkmode/",
"files": [
{
"destination": "CSSOpacityProperties--darkmode.scss",
"destination": "CSSCustomProperties.css",
"format": "css/variables",
"filter": {
"opacity": true
}
}
]
},
"CSSSizeCustomProperties--darkmode": {
"transformGroup": "css",
"prefix": "ds",
"comment": "File type: CSS; variable type: CSS; filter: size, public, theme: dark mode",
"buildPath": "./dist/tokens/",
"files": [
{
"destination": "CSSSizeCustomProperties--darkmode.css",
"format": "css/variables",
"filter": {
"attributes": {
"category": "size"
},
"public": true
}
}
]
},
"SassSizeCustomProperties--darkmode": {
"transformGroup": "scss",
"prefix": "ds",
"comment": "File type: Sass; variable type: Sass; filter: size, public, theme: dark mode",
"buildPath": "./dist/tokens/",
"files": [
{
"destination": "SassSizeCustomProperties--darkmode.scss",
"format": "css/variables",
"filter": {
"attributes": {
"category": "size"
},
"public": true
"public": true,
"darkmode": true
}
}
]
},
"SassCustomProperties--darkmode": {
"SassCustomProperties": {
"transformGroup": "css",
"prefix": "ds",
"comment": "File type: SCSS; variable type: CSS; filter: public, theme: dark mode",
"buildPath": "./dist/tokens/",
"buildPath": "./dist/tokens/darkmode/",
"files": [
{
"destination": "SassCustomProperties--darkmode.scss",
"destination": "SassCustomProperties.scss",
"format": "css/variables",
"filter": {
"public": true
"public": true,
"darkmode": true
}
}
]
Expand All @@ -206,35 +63,37 @@
"prefix": "ds",
"transformGroup": "js",
"comment": "File type: JS; data type: JS; filter: colors || public, theme: dark mode",
"buildPath": "./dist/tokens/",
"buildPath": "./dist/tokens/darkmode/",
"transforms": ["attribute/cti", "name/cti/kebab", "color/css"],
"files": [
{
"destination": "JSData--darkmodeColor.js",
"destination": "JSDataColor.js",
"format": "javascript/module",
"filter": {
"attributes": {
"category": "color"
},
"public": true
"public": true,
"darkmode": true
}
}
]
},
"JSes6--darkmodeColor": {
"JSes6Color": {
"prefix": "ds",
"transformGroup": "js",
"comment": "File type: JS; data type: JS; filter: colors || public, theme: dark mode",
"buildPath": "./dist/tokens/",
"buildPath": "./dist/tokens/darkmode/",
"files": [
{
"destination": "JSVariables--darkmodeColor.js",
"destination": "JSVariablesColor.js",
"format": "javascript/es6",
"filter": {
"attributes": {
"category": "color"
},
"public": true
"public": true,
"darkmode": true
}
}
]
Expand All @@ -243,40 +102,43 @@
"transformGroup": "js",
"prefix": "ds",
"comment": "File type: JS; data type: JS; filter: classic colors, theme: dark mode",
"buildPath": "./dist/tokens/",
"buildPath": "./dist/tokens/darkmode/",
"transforms": ["attribute/cti", "name/cti/kebab", "color/css"],
"files": [
{
"destination": "JSObject--allDarkTokens.js",
"format": "javascript/module",
"filter": {
"public": true,
"darkmode": true,
"deprecated": false
}
}
]
},
"JSONtest--darkmode": {
"JSONtest": {
"transformGroup": "css",
"buildPath": "./test/",
"files": [
{
"destination": "validJSON--darkmode",
"destination": "validJSON",
"format": "css/variables"
}
]
},
"JSObject--deprecatedDarkTokens": {
"transformGroup": "js",
"comment": "File type: JS; data type: JS; filter: deprecated, theme: dark mode",
"buildPath": "./dist/tokens/",
"buildPath": "./dist/tokens/darkmode/",
"transforms": ["attribute/cti", "name/cti/kebab", "color/css"],
"files": [
{
"destination": "JSObject--deprecatedDark.js",
"format": "javascript/module",
"filter": {
"deprecated": true
"deprecated": true,
"public": true,
"darkmode": true
}
}
]
Expand Down
Loading

0 comments on commit d6d87b4

Please sign in to comment.