(tokens) generate css utility classes

These were the missing parts in order to use every design tokens
of Cunningham. Including: spacing, font weight, size, family, and
colors. In order to be really versatile and to allow users to
define new design tokens I had to re-organize the way those tokens
are sub divided in sub objects in cunningham.ts file. That's why
sub division are created for theme.typ.sizes for instance.
This commit is contained in:
Nathan Vasse
2023-01-19 15:30:23 +01:00
committed by NathanVss
parent 3bb74d8594
commit b908136224
20 changed files with 769 additions and 98 deletions

View File

@@ -89,7 +89,7 @@ const colorsDanger = {
"danger-900": "#5C0000",
};
const typoSizes = {
const fontSizes = {
h1: "1.75rem",
h2: "1.375rem",
h3: "1.125rem;",
@@ -101,7 +101,7 @@ const typoSizes = {
s: "0.6875rem",
};
const typoWeights = {
const fontWeights = {
thin: 100,
regular: 300,
medium: 400,
@@ -110,18 +110,18 @@ const typoWeights = {
black: 900,
};
const typeFamilies = {
"font-base": "Roboto",
"font-accent": "Roboto",
const fontFamilies = {
base: "Roboto",
accent: "Roboto",
};
const spacings = {
xl: "64px",
l: "48px",
b: "24px",
s: "16px",
t: "8px",
st: "4px",
xl: "4rem",
l: "3rem",
b: "1.625rem",
s: "1rem",
t: "0.5rem",
st: "0.25rem",
};
const transitions = {
@@ -142,10 +142,10 @@ export default {
...colorsWarning,
...colorsDanger,
},
typo: {
...typoSizes,
...typoWeights,
...typeFamilies,
font: {
sizes: fontSizes,
weights: fontWeights,
families: fontFamilies,
},
spacings,
transitions,