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/components';
export function Example() {
return <Button>Continue</Button>;
}
CSS-first styling contract:
/* app entry CSS */
@import "@tryghost/shade/styles.css";
No Tailwind preset/config import is required for Shade runtime styling.
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/app';
<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
pnpmto install top-level dependencies.
Local docs with Storybook:
pnpm storybook— run Storybook and view docs undersrc/docs/pnpm build-storybook— build a static export
Test
pnpm test— type-checks and runs Vitest with coveragepnpm test:unit— type-checks and runs Vitestpnpm test:types— TypeScript onlypnpm 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/*).