You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
3 months ago | |
|---|---|---|
| .. | ||
| .storybook | 3 months ago | |
| src | 3 months ago | |
| test | 3 months ago | |
| .eslintrc.cjs | 3 months ago | |
| .gitignore | 3 months ago | |
| AGENTS.md | 3 months ago | |
| README.md | 3 months ago | |
| components.json | 3 months ago | |
| package.json | 3 months ago | |
| postcss.config.cjs | 3 months ago | |
| preflight.css | 3 months ago | |
| styles.css | 3 months ago | |
| tailwind.cjs | 3 months ago | |
| tailwind.config.cjs | 3 months ago | |
| tsconfig.declaration.json | 3 months ago | |
| tsconfig.json | 3 months ago | |
| tsconfig.node.json | 3 months ago | |
| vite.config.ts | 3 months ago | |
README.md
Shade
Ghost Design System that can be used by micro-frontends.
Usage
Shade is consumed internally across Ghost apps. The package is currently private; when published, consumption will follow standard npm usage.
Example:
import {Button} from '@tryghost/shade';
export function Example() {
return <Button>Continue</Button>;
}
Tailwind preset:
// tailwind.config.cjs
module.exports = {
presets: [require('@tryghost/shade/tailwind')],
// your overrides...
};
Scoping and dark mode:
- All styles are scoped under a
.shadecontainer. - Dark mode is toggled by adding
.darkwithin that scope.
Wrap your surface with ShadeApp (includes provider and scoping):
import ShadeApp from '@tryghost/shade';
<ShadeApp darkMode={false}>
{/* your UI */}
</ShadeApp>
Develop
This is a monorepo package.
Follow the instructions for the top-level repo.
git clonethis repo &cdinto it as usual- Run
yarnto install top-level dependencies.
Local docs with Storybook:
yarn storybook— run Storybook and view docs undersrc/docs/yarn build-storybook— build a static export
Test
yarn test— type-checks and runs Vitest with coverageyarn test:unit— type-checks and runs Vitestyarn test:types— TypeScript onlyyarn lint— ESLint forsrc/andtest/
Notes
- Utilities live at
@/lib/utils(not@/utils). Usecn(...)to merge class names and prefer CVA for variants. - Docs live alongside the code and are rendered via Storybook (
src/docs/*).