ZSS is a Sass framework that helps you build design systems with configurable design scales.
This overview provides an in depth view of all of the available properties/classes in ZSS.
- Provides a simple base for your typography.
- Provides abstractions of common UI patterns, so you can focus on the specific design details.
- Functional CSS: generates immutable, configurable, and responsive utility classes.
- Provides a flexible and configurable flexbox grid.
- Provide compile time checking of your configuration for design smells.
- No pre-defined colors.
- Unlike Bootstrap, ZSS does not contain pre-made components or JavaScript.
ZSS is built on a few principles.
- Composition over repetition
Theclass
attribute is perfect for composing your design with multiple classes. It leads to better re-usability of your design and smaller CSS stylesheets. - Configurable and optional
In ZSS, generated utility classes have configurable values. Need an extra value, or don’t like the default values? Just override a variable in your project. Don’t need the button abstraction class? Just don’t import it. - Responsiveness
All utility classes have responsive equivalents, so you can use different values on different screens. - Design scales
ZSS uses scales to limit the number of available values for certain properties, likecolor
andmargin
.
Install:
npm install zss --save
After that, import the files you need into your Sass stylesheet.
@import "../node_modules/zss/src/utilities/background-color";
ℹ️ Please note that some utility classes make use of the responsive helper mixins. To make sure ZSS compiles correctly import these before you import the utility classes:
@import "../node_modules/zss/src/helpers/responsive";
@import "../node_modules/zss/src/utilities/margin";
ℹ️ You can use the accompanying file zss.scss
as a starting point for your project's stylesheet. It imports all files that are available in ZSS.
ZSS uses namespaces, similar to the system CSS Wizardry wrote about.
o-
prefix for abstract objects.u-
prefix for utility classes.
ZSS advocates importing sources files in the way ITCSS prescribes, with an inverted specificity.
- Settings and variables
- Mixins and other Sass helpers
- Generic: common resets
- Base: unclassed HTML and page setup
- Abstract objects
- Components
- Scopes
- Theming
- Visual classes
- Utility classes
ZSS uses an @breakpoint
suffix to indicate if a class only works on a certain breakpoint, e.g. u-black@md
.