feat: use style-dictionary for common styling across all webs#263
Conversation
| "types": "./dist/pricing/index.d.ts" | ||
| } | ||
| }, | ||
| "./styles/*.css": "./dist/styles/*.css" |
There was a problem hiding this comment.
This should cover any other styling we want to apply across both webs (ie: fonts).
There was a problem hiding this comment.
Curiosity: why is this export like this i.e. *.css ?
Also, are we missing the .theme export?
| "@types/node": "^22.10.10", | ||
| "@types/react": "^19.1.9", | ||
| "@vitest/eslint-plugin": "^1.1.36", | ||
| "clsx": "^2.1.1", |
There was a problem hiding this comment.
There were some dependencies out-of-order and they were put in their place (alphabetically) when installing tinycolor2 and style-dictionary.
| "import": "./dist/theme/index.js", | ||
| "types": "./dist/theme/index.d.ts" | ||
| }, | ||
| "./styles": "./dist/styles/index.css", |
There was a problem hiding this comment.
I've defined ./styles and ./styles/*.css because in TS we can either import the index.ts or whatever the index exports, but there's nothing like that in CSS, so this allows us to either import the index.css (w/o being explicit): @import '@notifycal/shared/styles'; or a .css file within styles/ if we don't want everything.
It's a WIP for now, because there are some questions we need to answer:
dist/at buildtime (hence the fuglycpcommands inpackage.json). Open to alternatives.style-dictionaryto output them directly intodist/.theme) rather than 2 (themefor Mantine andstylesfor CSS) to avoid polluting this repo? Probably, right?But, it works!
(Might need to tweak something in VSCode so the Tailwind IntelliSense picks them up though.)
Forgot to mention the generated
.tsfile (for Mantine) is automatically bundled in dist (because it's .ts), so we wouldn't need to copy it totheme/