✨(tokens) add TS generator and re-organize the repo
Add TS Generator which is a lot based on JS Generator.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
"scripts": {
|
||||
"lint": "eslint . 'src/**/*.{ts,tsx}'",
|
||||
"dev": "vite",
|
||||
"build-theme": "cunningham -o src",
|
||||
"build-theme": "cunningham -o src -g css,ts",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
:root {
|
||||
--c--colors--primary: purple;
|
||||
--c--colors--secondary: #DA0000;
|
||||
--c--text--primary: purple;
|
||||
--c--text--secondary: #DA0000;
|
||||
}
|
||||
1
apps/demo/src/cunningham-tokens.ts
Normal file
1
apps/demo/src/cunningham-tokens.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const tokens = {"colors":{"primary":"purple","secondary":"#DA0000"}};
|
||||
@@ -20,7 +20,7 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
h1 {
|
||||
h1, h3 {
|
||||
color: white;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import "./index.scss";
|
||||
import { Button } from "@openfun/cunningham-react";
|
||||
import { tokens } from "./cunningham-tokens";
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<div className="center">
|
||||
<h1 className="test">Cunningham Demo.</h1>
|
||||
<Button />
|
||||
<h3>Primary color is {tokens.colors.primary}</h3>
|
||||
</div>
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user