Sassy
A Sass framework built from placeholder selectors. You extend the utilities and components you need onto your own selectors, so your HTML stays clean and your CSS holds only the rules you use.
@use "sassy/src" as sassy
.card
@extend %bf-p-3
@extend %bf-p-5-md
@extend %bf-rounded
@extend %bf-shadow-1
.card-title
@extend %bf-c-primary
@extend %bf-font-weight-700@layer sassy.base {
@layer utilities {
.card-title {
font-weight: 700;
}
.card {
padding: 0.75rem;
}
.card {
border-radius: var(--sassy-radius, 0.375rem);
}
.card {
box-shadow: 0 0.125rem 0.25rem color-mix(in oklab, var(--sassy-shadow-colour, #000) 7.5%, transparent);
}
}
@layer theme {
.card-title {
color: color-mix(in oklab, var(--sassy-theme-primary) var(--sassy-text-opacity, 100%), transparent);
}
}
}
@layer sassy.md {
@layer utilities {
@media (width >= 768px) {
.card {
padding: 1.25rem;
}
}
}
}Each placeholder sets one thing, and has a version for each breakpoint, such as %bf-p-5-md. Sassy outputs them in a fixed order, so breakpoints override base styles and utilities override components, whichever order you extend them in.
The layers
Sassy is built in six layers, numbered in the order their CSS is output. Each page shows its layer working, with the Sass, HTML and CSS for every example.
Test pages
Pages used to check Sassy in different browsers: utilities, form controls and theme colours.
Getting started
Add Sassy to your project and load it with @use "sassy/src" as sassy, or link dist/full.css to use every utility as a class. The README covers both, and the docs cover each layer in full.