A small, opinionated CSS framework to make sites look good with minimal effort
- ๐ฅ Embraces semantic HTML to make native elements look great out of the box, without classes
- ๐ Small set of utilities for additional states and convenience
- ๐ Tiny footprint (~6 kB min+gzip) with no runtime dependencies and no build step required
- ๐ Automatic color system that reduces time spent fiddling with color palettes
- ๐ช Fully responsive
From a CDN:
@import url("https://esm.sh/gh/andreasphil/design-system@<tag>/dist/design-system.css") layer(theme);
/* Optional: import utilities */
@import url("https://esm.sh/gh/andreasphil/design-system@<tag>/dist/design-system-utils.css");With a package manager:
pnpm install github:andreasphil/design-system#<tag>๐ https://andreasphil.github.io/design-system/
First, import the CSS. I recommend using layers to avoid conflicts and specificity chaos when customizing.
@layer base, utils;
@import "@andreasphil/design-system/style.css" layer(base);
@import "@andreasphil/design-system/utils.css" layer(utils);
@layer base {
/* Add customizations and override variables here. */
}The CSS loosely follows CUBE CSS:
-
Global, high-level styles: Most styles apply globally to plain HTML elements.
src/base/variables.csscontains design tokens for colors, fonts, shared spacing, and more. You can use them to customize the Design System or apply them to your own components. -
Blocks: The framework includes opinionated styling for almost all common HTML elements.
-
Exceptions: Some blocks, such as buttons, come with variants (also called exceptions). According to CUBE CSS, you apply variants with attributes.
-
Composition & utilities: Apart from a few utilities, these are outside the scope of the framework.
Tools: Node โ pnpm โ Lightning CSS
node --run dev # compile stylesheets in watch mode
node --run build # bundle for productionFor a demo, open index.html in a browser.
- Open source packages listed in package.json
- Icons by Lucide
- Inspired by Pico.css
Thanks ๐