@gyldendal/kobber-base
Advanced tools
Comparing version 0.1.0 to 0.2.0
import fs from "fs"; | ||
import StyleDictionary from "style-dictionary"; | ||
import { additionalTokens } from "./additionalTokens"; | ||
import { esmFormat } from "./src/styleDictionary/formats/esm"; | ||
import { jsonFormat } from "./src/styleDictionary/formats/json"; | ||
import { getStyleDictionaryConfig } from "./src/styleDictionary/getStyleDictionaryConfig"; | ||
import { jsonNested } from "./src/styleDictionary/jsonNestedFormat"; | ||
import { sanitizeJsonFromFigma } from "./src/styleDictionary/sanitizeJsonFromFigma"; | ||
import { additionalTokens } from "./additionalTokens"; | ||
@@ -30,4 +31,6 @@ const jsonString = fs.readFileSync("tokens-from-figma.json", "utf-8"); | ||
StyleDictionary.registerFormat(jsonNested); | ||
StyleDictionary.registerFormat(jsonFormat); | ||
StyleDictionary.registerFormat(esmFormat); | ||
// Convert Figma modes into themes | ||
@@ -34,0 +37,0 @@ |
# @gyldendal/kobber-base | ||
## 0.2.0 | ||
### Minor Changes | ||
- Tokens in js and ts formats | ||
### Patch Changes | ||
- 49ace2a: Tokens in js and ts formats | ||
## 0.1.0 | ||
@@ -4,0 +14,0 @@ |
{ | ||
"name": "@gyldendal/kobber-base", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"license": "MIT", | ||
@@ -16,2 +16,3 @@ "type": "commonjs", | ||
"devDependencies": { | ||
"@types/node": "20.9.0", | ||
"style-dictionary": "^3.9.0", | ||
@@ -18,0 +19,0 @@ "ts-node": "^10.9.1", |
@@ -8,6 +8,6 @@ # Base | ||
```JavaScript | ||
import theme from "~@gyldendal/kobber-base/themes/default/tokens.json"; | ||
import * as tokens from "~@gyldendal/kobber-base/themes/default/tokens"; | ||
export const Button = styled.button` | ||
background-color: ${theme.component.button.color.background}; | ||
background-color: ${tokens.component.button.color.background}; | ||
`; | ||
@@ -14,0 +14,0 @@ ``` |
@@ -6,5 +6,6 @@ import StyleDictionary, { | ||
} from "style-dictionary"; | ||
import { fluidClampTransform } from "./fluidClampTransform"; | ||
import { jsonNested } from "./jsonNestedFormat"; | ||
import { pxToRemTransform } from "./pxToRemTransform"; | ||
import { esmFormat } from "./formats/esm"; | ||
import { jsonFormat } from "./formats/json"; | ||
import { fluidClampTransform } from "./transforms/fluidClamp"; | ||
import { pxToRemTransform } from "./transforms/pxToRem"; | ||
@@ -65,3 +66,3 @@ StyleDictionary.registerTransform(pxToRemTransform); | ||
}, | ||
js: { | ||
json: { | ||
transforms: [ | ||
@@ -76,3 +77,3 @@ ...transformGroup.js, | ||
destination: `${themeName}/tokens.json`, | ||
format: jsonNested.name, | ||
format: jsonFormat.name, | ||
filter, | ||
@@ -82,4 +83,24 @@ }, | ||
}, | ||
js: { | ||
transforms: [ | ||
...transformGroup.js, | ||
fluidClampTransform.name, | ||
...transforms, | ||
], | ||
buildPath, | ||
files: [ | ||
{ | ||
destination: `${themeName}/tokens.js`, | ||
format: esmFormat.name, | ||
filter, | ||
}, | ||
{ | ||
destination: `${themeName}/tokens.ts`, | ||
format: esmFormat.name, | ||
filter, | ||
}, | ||
], | ||
}, | ||
}, | ||
}; | ||
}; |
@@ -1025,2 +1025,2 @@ { | ||
} | ||
} | ||
} |
@@ -1025,2 +1025,2 @@ { | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
454418
39
14614
0
4