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 (~6kb min+gzip) footprint with no runtime dependencies or 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:
npm install github:andreasphil/design-system#<tag>Find the demo at https://andreasphil.github.io/design-system/.
First, import the CSS. I recommend using layers to avoid conflicts and specificity chaos when customizing.
@import "@andreasphil/design-system/style.css" layer(theme);
@import "@andreasphil/design-system/utils.css";
@layer theme {
/* You can add customizations and override variables here. */
}The CSS loosely follows CUBE CSS:
-
Global, high-level styles: nost styling is global styling of plain HTML elements. There are a bunch of design tokens for colors, fonts, shared spacing, etc. in
src/base/variables.cssthat you can use to customize the Design System or apply to your own components. -
Blocks: The framework includes opinionated styling for almost all common HTML elements inside
src/blocks/. -
Exceptions: Some blocks, such as buttons, come with variants (also called exceptions). According to CUBE CSS, variants are applied using attributes.
-
Composition & utilites: With the exception of a few utilities, these are outside the scope of the framework.
Design System is built with Lightning CSS. Packages are managed by npm. The following commands are available:
node --run dev # Compile stylesheets in watch mode
node --run build # Bundle for productionFor a demo, open index.html in a browser.
Deployment should work out of the box on GitHub Pages.
This library uses a number of open source packages listed in package.json. Icons are from Lucide. It was inspired by Pico.css.
Thanks 🙏