Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Configure and use UnoCSS atomic CSS engine with presets like Wind (Tailwind-compatible), Icons, and Attributify.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/preset-mini.md
1---2name: preset-mini3description: Minimal preset with essential utilities for UnoCSS4---56# Preset Mini78The minimal preset with only essential rules and variants. Good starting point for custom presets.910## Installation1112```ts13import { defineConfig, presetMini } from 'unocss'1415export default defineConfig({16presets: [17presetMini(),18],19})20```2122## What's Included2324Subset of `preset-wind3` with essential utilities aligned to CSS properties:2526- Basic spacing (margin, padding)27- Display (flex, grid, block, etc.)28- Positioning (absolute, relative, fixed)29- Sizing (width, height)30- Colors (text, background, border)31- Typography basics (font-size, font-weight)32- Borders and border-radius33- Basic transforms and transitions3435## What's NOT Included3637Opinionated or complex Tailwind utilities:38- `container`39- Complex animations40- Gradients41- Advanced typography42- Prose classes4344## Use Cases45461. **Building custom presets** - Start with mini and add only what you need472. **Minimal bundle size** - When you only need basic utilities483. **Learning** - Understand UnoCSS core without Tailwind complexity4950## Dark Mode5152Same as preset-wind3:5354```ts55presetMini({56dark: 'class' // or 'media'57})58```5960```html61<div class="dark:bg-red:10" />62```6364Class-based:65```css66.dark .dark\:bg-red\:10 {67background-color: rgb(248 113 113 / 0.1);68}69```7071Media query:72```css73@media (prefers-color-scheme: dark) {74.dark\:bg-red\:10 {75background-color: rgb(248 113 113 / 0.1);76}77}78```7980## CSS @layer Variant8182Native CSS layer support:8384```html85<div class="layer-foo:p4" />86```8788```css89@layer foo {90.layer-foo\:p4 {91padding: 1rem;92}93}94```9596## Theme Customization9798```ts99presetMini({100theme: {101colors: {102veryCool: '#0000ff',103brand: {104primary: 'hsl(var(--hue, 217) 78% 51%)',105}106},107}108})109```110111**Note:** `breakpoints` property is overridden, not merged.112113## Options114115```ts116presetMini({117// Dark mode: 'class' | 'media' | { light: string, dark: string }118dark: 'class',119120// Generate [group=""] instead of .group for attributify121attributifyPseudo: false,122123// CSS variable prefix (default: 'un-')124variablePrefix: 'un-',125126// Utility prefix127prefix: undefined,128129// Preflight generation: true | false | 'on-demand'130preflight: true,131})132```133134## Building on Mini135136Create custom preset extending mini:137138```ts139import { presetMini } from 'unocss'140import type { Preset } from 'unocss'141142export const myPreset: Preset = {143name: 'my-preset',144presets: [presetMini()],145rules: [146// Add custom rules147['card', { 'border-radius': '8px', 'box-shadow': '0 2px 8px rgba(0,0,0,0.1)' }],148],149shortcuts: {150'btn': 'px-4 py-2 rounded bg-blue-500 text-white',151},152}153```154155<!--156Source references:157- https://unocss.dev/presets/mini158-->159