♻️(tokens) expose default tokens in a lib and various config
This allow to use the default tokens from Typescript or Javascript file of dependents repos. For instance this wîll be used by packages/react to aggregate components tokens files.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
module.exports = {
|
||||
theme: {
|
||||
colors: {
|
||||
primary: "#055FD2",
|
||||
primary: "#002d7f",
|
||||
"primary-gradient": "linear-gradient(90deg,#002d7f,#0069b3)",
|
||||
secondary: "#DA0000",
|
||||
},
|
||||
},
|
||||
|
||||
7
packages/tokens/src/bin/tests/assets/cunningham.ts
Normal file
7
packages/tokens/src/bin/tests/assets/cunningham.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export default {
|
||||
theme: {
|
||||
colors: {
|
||||
primary: "typescript",
|
||||
},
|
||||
},
|
||||
};
|
||||
14
packages/tokens/src/bin/tsconfig.json
Normal file
14
packages/tokens/src/bin/tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"extends": "@openfun/typescript-configs/node.json",
|
||||
"include": [
|
||||
"**/*",
|
||||
],
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"*": ["*"]
|
||||
},
|
||||
"resolveJsonModule": true,
|
||||
"outDir": "../../dist/bin",
|
||||
}
|
||||
}
|
||||
1
packages/tokens/src/lib/cunningham-tokens.ts
Normal file
1
packages/tokens/src/lib/cunningham-tokens.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const tokens = {"theme":{"colors":{"primary":"#002d7f","primary-gradient":"linear-gradient(90deg,#002d7f,#0069b3)","secondary":"#DA0000"}}};
|
||||
4
packages/tokens/src/lib/index.ts
Normal file
4
packages/tokens/src/lib/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { tokens } from "./cunningham-tokens";
|
||||
|
||||
export type DefaultTokens = typeof tokens;
|
||||
export const defaultTokens = tokens;
|
||||
11
packages/tokens/src/lib/tsconfig.json
Normal file
11
packages/tokens/src/lib/tsconfig.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "@openfun/typescript-configs/node.json",
|
||||
"include": [
|
||||
"./*"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"outDir": "../../dist/lib",
|
||||
"declaration": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user