Fylgja Utilities use a 'Dynamic CSS' approach where a single utility class (or no class) is combined with inline CSS variables to control behavior, rather than using a large set of predefined utility classes.
- Spacing: Margin and padding can be set directly via inline variables without a class.
- Breakpoints: Responsive values are applied by prefixing the variable with the breakpoint name (e.g.,
lg_).
npm install @fylgja/utilities
@import "@fylgja/utilities";
/* Or granularly */
@import "@fylgja/utilities/flex.css";
<!-- Using a utility class with a variable -->
<div class="align" style="--align: center"></div>
<!-- Using auto-grid with a variable -->
<div class="auto-grid" style="--max-cols-size: 15ch"></div>
<!-- Spacing without classes -->
<div style="--my: 1rem; --px: 2rem"></div>
<!-- Responsive spacing (lg breakpoint) -->
<div style="--my: 1rem; --lg_my: var(--size-4)"></div>