All skills
onmax avatar

/unocss

@de09c7b official
by Maxonmax/nuxt-skills715 stars
38

UnoCSS instant atomic CSS engine, superset of Tailwind CSS. Use when configuring UnoCSS, writing utility rules, shortcuts, or working with presets like Wind, Icons, Attributify.

Use this Skill: https://skilld.dev/gh/onmax/nuxt-skills/unocss

This session only. Nothing lands on disk.

referencespreset-attributify.md

≈645 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Preset Attributify

Group utilities in HTML attributes for better readability.

Installation

import { defineConfig, presetAttributify, presetWind3 } from 'unocss'

export default defineConfig({
  presets: [
    presetWind3(),
    presetAttributify(),
  ],
})

Basic Usage

Instead of long class strings:

<button class="bg-blue-400 hover:bg-blue-500 text-sm text-white font-mono font-light py-2 px-4 rounded border-2 border-blue-200">
  Button
</button>

Group by prefix in attributes:

<button
  bg="blue-400 hover:blue-500"
  text="sm white"
  font="mono light"
  p="y-2 x-4"
  border="2 rounded blue-200"
>
  Button
</button>

Prefix Self-Referencing

For utilities matching their prefix (flex, grid, border), use ~:

<!-- Before -->
<button class="border border-red">Button</button>

<!-- After -->
<button border="~ red">Button</button>

Valueless Attributify

Use utilities as boolean attributes:

<div m-2 rounded text-teal-400 />

Handling Property Conflicts

When attribute names conflict with HTML properties:

<!-- Use un- prefix -->
<a un-text="red">Text color to red</a>

Enforce Prefix

presetAttributify({
  prefix: 'un-',
  prefixedOnly: true,
})

Options

presetAttributify({
  strict: false,           // Only generate CSS for attributify
  prefix: 'un-',           // Attribute prefix
  prefixedOnly: false,     // Require prefix for all
  nonValuedAttribute: true, // Support valueless attributes
  ignoreAttributes: [],    // Attributes to ignore
  trueToNonValued: false,  // Treat value="true" as valueless
})

TypeScript Support

Vue 3

// html.d.ts
declare module '@vue/runtime-dom' {
  interface HTMLAttributes { [key: string]: any }
}
declare module '@vue/runtime-core' {
  interface AllowedComponentProps { [key: string]: any }
}
export {}

React

import type { AttributifyAttributes } from '@unocss/preset-attributify'

declare module 'react' {
  interface HTMLAttributes<T> extends AttributifyAttributes {}
}

JSX Support

For JSX where <div foo> becomes <div foo={true}>:

import { transformerAttributifyJsx } from 'unocss'

export default defineConfig({
  transformers: [
    transformerAttributifyJsx(),
  ],
})

Important: Only use attributify if uno.config.* shows presetAttributify() is enabled.

<!-- Source references: - https://unocss.dev/presets/attributify -->

Source: SKILL.md on GitHub

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    The skill is a comprehensive documentation set for UnoCSS, providing guidance on configuration, rules, presets, and framework integrations. It is a legitimate resource for web development, although it involves standard development tasks like installing packages and analyzing project files which presents a standard attack surface.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at de09c7b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated last week
Other metadata
metadata
{
  "author": "Anthony Fu",
  "version": "2026.1.28",
  "source": "Generated from https://github.com/unocss/unocss, scripts located at https://github.com/antfu/skills"
}

README badge

README badge for onmax/nuxt-skills/unocss