The minimal preset for UnoCSS, providing essential utilities for atomic CSS generation with modular theme, rules, and variants.
—
Modular CSS rule generators covering layout, typography, colors, effects, and responsive design utilities. These rules transform utility class names into CSS properties and values.
Collection of all CSS rule generators for the preset.
const rules: Rule[];Usage Example:
import { rules } from "@unocss/preset-mini/rules";
// Rules are used internally by UnoCSS to generate CSS
// Each rule is either a static rule or dynamic matcher
console.log(rules.length); // ~200+ rules for comprehensive coverageLayout and positioning utilities for controlling element placement and structure.
Position Rules:
static, fixed, absolute, relative, stickytop-*, right-*, bottom-*, left-* (position offsets)inset-* (shorthand for all sides)z-* (z-index values)Display Rules:
block, inline-block, inline, flex, inline-flexgrid, inline-grid, table, table-cellhidden (display: none)Container Rules:
container (responsive container)Modern layout system utilities for flexbox and CSS grid.
Flexbox Rules:
flex-* (flex-grow, flex-shrink, flex-basis)flex-row, flex-col, flex-row-reverse, flex-col-reverseflex-wrap, flex-nowrap, flex-wrap-reversejustify-* (justify-content values)items-* (align-items values)self-* (align-self values)content-* (align-content values)Grid Rules:
grid-cols-* (grid-template-columns)grid-rows-* (grid-template-rows)col-span-*, row-span-* (grid column/row span)col-start-*, col-end-* (grid column placement)row-start-*, row-end-* (grid row placement)gap-*, gap-x-*, gap-y-* (grid and flexbox gaps)Width, height, and sizing utilities with comprehensive value support.
Size Rules:
w-*, h-* (width, height)min-w-*, min-h-* (minimum sizes)max-w-*, max-h-* (maximum sizes)size-* (width and height together)Value Support:
[200px]Margin and padding utilities with directional support.
Margin Rules:
m-* (all sides), mx-* (horizontal), my-* (vertical)mt-*, mr-*, mb-*, ml-* (individual sides)ms-*, me-* (logical start/end)Padding Rules:
p-* (all sides), px-* (horizontal), py-* (vertical)pt-*, pr-*, pb-*, pl-* (individual sides)ps-*, pe-* (logical start/end)Value Support:
- prefix[10px]Comprehensive color utilities with opacity support and theme integration.
Text Colors:
text-* (text color from theme)text-opacity-* (text color opacity)Background Colors:
bg-* (background color from theme)bg-opacity-* (background color opacity)Border Colors:
border-* (border color from theme)border-opacity-* (border color opacity)Color Value Support:
red-500, blue, gray-100[#ff0000], hex-ff0000[$primary-color]red-500/50 (50% opacity)Border styling with width, style, radius, and color control.
Border Width:
border, border-* (all sides)border-t-*, border-r-*, border-b-*, border-l-* (individual sides)border-x-*, border-y-* (horizontal/vertical)Border Style:
border-solid, border-dashed, border-dottedborder-double, border-hidden, border-noneBorder Radius:
rounded (default), rounded-* (themed values)rounded-t-*, rounded-r-*, rounded-b-*, rounded-l-*rounded-tl-*, rounded-tr-*, rounded-bl-*, rounded-br-*Text styling utilities covering fonts, sizes, weights, and text properties.
Font Rules:
font-* (font family from theme)text-* (font size from theme)font-* (font weight: thin, light, normal, medium, semibold, bold, extrabold, black)Text Styling:
italic, not-italicunderline, no-underline, line-throughuppercase, lowercase, capitalize, normal-caseText Layout:
text-left, text-center, text-right, text-justifyalign-* (vertical-align values)whitespace-* (white-space property)break-* (word-break and overflow-wrap)Line Height and Spacing:
leading-* (line-height from theme)tracking-* (letter-spacing from theme)Visual effects including shadows, filters, and transforms.
Shadow Rules:
shadow, shadow-* (box-shadow from theme)shadow-none (remove shadow)shadow-red-500Transform Rules:
scale-*, scale-x-*, scale-y-*rotate-* (rotation angles)translate-x-*, translate-y-*skew-x-*, skew-y-*transform, transform-noneFilter Rules:
blur-* (blur filter from theme)brightness-*, contrast-*, saturate-*hue-rotate-*, invert, sepiafilter, filter-noneAnimation and transition utilities for smooth interactions.
Transition Rules:
transition, transition-nonetransition-* (transition-property from theme)duration-* (transition-duration from theme)ease-* (transition-timing-function from theme)delay-* (transition-delay)CSS custom property utilities for dynamic theming.
Variable Definition:
[--variable-name:value] (define CSS variables)Pre-defined utility classes for common patterns.
Common Utilities:
sr-only (screen reader only)not-sr-only (undo screen reader only)focus-within, focus-visiblepointer-events-none, pointer-events-autoselect-none, select-text, select-allSpecial debugging and development utilities.
Debug Rules:
? utilities for development debuggingRules use sophisticated value handlers for processing utility values:
[value]Many rules use dynamic matchers for flexible value support:
// Example: margin utilities
['m', directionSize('margin')] // Matches m-4, mx-2, mt-auto, etc.Utilities support negative values where appropriate:
// Negative margin
'm--4' // margin: -1rem
'-m-4' // margin: -1rem (alternative syntax)Install with Tessl CLI
npx tessl i tessl/npm-unocss--preset-mini