Theming

Lightpack CSS supports full theming using CSS custom properties without any need to depend on tools like Less, Sass, PostCSS, etc.

Default Theme

All colors, typography, spacing, etc. use variables from :root.

Dark Mode

Theme Switching (JS)

Usage

  <button onclick="Lightpack.toggleTheme()">Toggle</button>

Custom Themes

.theme-brand {
  --color-primary: #FF5722;
  --color-background: #1a1a1a;
  --color-text: #fff;
}

Usage

<body class="theme-dark">
  ...
</body>