English · Русский
Basic styles for quick prototyping: typography, semantic colors with light and dark themes, color palette, sizes, containers and columns, breakpoints, borders, rounding, opacity and shadows — as CSS, LESS, SCSS and a Tailwind v4 theme.
🌐 Website · 📖 Documentation · 🎨 Figma community · 🖼 Behance · 📝 Releases
- Features
- Installation
- Quick start
- What's included
- Dark theme
- Overriding tokens
- Design tokens
- Related projects
- Contributing
- Author
- License
- Four formats. CSS variables, LESS and SCSS variables with mixins, and a Tailwind CSS v4 theme — from one source.
- Light and dark themes. Follows
prefers-color-schemeor is switched manually withdata-themeon any DOM level. - Design tokens as the source. W3C Design Tokens (DTCG 2025.10)
in
tokens/, generated with Style Dictionary. - Figma file. The same styles are available as a Figma community file.
- Overridable. Semantic colors are plain CSS variables — override them with a regular cascade rule.
npm install @prosazhin/pbstyles
# or
yarn add @prosazhin/pbstylesThe package contains only a basic set of variables: CSS has no mixins yet.
@import '@prosazhin/pbstyles/styles/css';Variables and mixins for LESS.
@import '@prosazhin/pbstyles/styles/less';Variables and mixins for SCSS.
@import '@prosazhin/pbstyles/styles/scss';The Tailwind theme goes after Tailwind:
@import 'tailwindcss';
@import '@prosazhin/pbstyles/styles/tailwind/theme.css';It also works with a Tailwind prefix,
e.g. @import 'tailwindcss' prefix(tw); — the dark theme and token overrides keep working.
| Category | CSS | LESS | SCSS | Tailwind |
|---|---|---|---|---|
| Typography | ✅ | ✅ | ✅ | ✅ |
| Semantic colors | ✅ | ✅ | ✅ | ✅ |
| Colors palette | ✅ | ✅ | ✅ | ✅ |
| Basic sizes | ✅ | ✅ | ✅ | ✅ |
| Containers sizes | ✅ | ✅ | ✅ | ✅ |
| Columns | ✅ | ✅ | ✅ | — |
| Border sizes | ✅ | ✅ | ✅ | ✅ |
| Border rounding sizes | ✅ | ✅ | ✅ | ✅ |
| Opacity | ✅ | ✅ | ✅ | ✅ |
| Shadows | ✅ | ✅ | ✅ | ✅ |
| Mixin | CSS | LESS | SCSS | Tailwind |
|---|---|---|---|---|
| Animation | — | ✅ | ✅ | ✅ |
| Typography | — | ✅ | ✅ | ✅ |
| Breakpoints | — | ✅ | ✅ | ✅ |
Semantic colors (basic, primary, secondary, success, danger, warning, outline, text) have light and dark
values. The color palette (gray, blue, etc.) is the same in both themes.
The dark theme is enabled in two ways:
- System — automatically via
@media (prefers-color-scheme: dark). - Manual — with the
data-theme="dark"attribute on<html>or on any container. Nested containers work too: everything inside<div data-theme="dark">uses dark colors.
data-theme="light" works the same way in the opposite direction: it forces the light theme even when the system
prefers dark, on <html> or on any nested container.
<html data-theme="dark">
...
<div data-theme="dark">This block is always dark</div>
<div data-theme="light">This block is always light</div>
</html>Semantic colors are plain CSS variables, so any of them can be overridden with a regular cascade rule — on :root,
inside [data-theme='dark'] or on a specific element. In the Tailwind theme they have their own --theme-color-* names,
which do not depend on the Tailwind prefix.
| Format | Variable name |
|---|---|
| CSS | --color-basic-0, --color-primary-300, ... |
| LESS | @color-basic-0 → var(--color-basic-0) |
| SCSS | $color-basic-0 → var(--color-basic-0) |
| Tailwind Theme | --theme-color-basic-0, --theme-color-primary-300, ... |
In the Tailwind theme semantic colors are declared as --theme-color-* variables outside @theme and mapped via
@theme inline (--color-basic-0: var(--theme-color-basic-0)). Utilities like bg-basic-0 compile to
var(--theme-color-basic-0) directly, so the override works at any DOM level and with any Tailwind prefix:
@import 'tailwindcss';
@import '@prosazhin/pbstyles/styles/tailwind/theme.css';
:root {
--theme-color-primary-300: #7c3aed;
}
[data-theme='dark'] {
--theme-color-primary-300: #a78bfa;
}The styles are generated from design tokens: CSS, LESS and SCSS with Mixin Dictionary, the Tailwind theme with Tailwind Dictionary.
- Text styles are composite
typographytokens withfontSize,lineHeightandfontWeight: the font family and letter spacing are inherited. - Breakpoints (
screen.<name>.{min,max}) and animations (keyframes.<name>.<frame>.<property>) become mixins by their structure. container.full(100%), animations and text decorations are plain string tokens: DTCG has no matching type for them.- Since 1.4.0 the tokens use DTCG instead of the legacy Style Dictionary format. The generated styles are the same as in 1.3.1.
- mixin-dictionary — tokens to CSS variables and LESS/SCSS variables and mixins.
- tailwind-dictionary — tokens to a Tailwind CSS theme (v3 and v4).
- pbcomponents — React components on top of pbstyles.
Bug reports and ideas are welcome in issues. Edit the tokens in
tokens/ and regenerate the styles with npm run build — never edit styles/ by hand.
Evgenii Sazhin, frontend developer & designer — prosazhin.dev · GitHub · Telegram · LinkedIn
If the package is useful to you, give it a ⭐ on GitHub.
MIT © Evgenii Sazhin