Styling

From Esposter/Esposter · View interactive version

Styling is an AI agent skill from the GitHub repository Esposter/Esposter. Apply when writing or reviewing styles in .vue or .css files, or laying out a page, panel, sidebar, or border. Esposter's UnoCSS Attributify styling conventions for the app's templates and styles, and for laying out its pages.

How to use this skill

Skill file

Styling — UnoCSS Attributify Mode

Settled — do not re-propose

Deep Dives

Core Rules

The look is the app's, on every page

An immersive page (apps/web/app/layouts/immersive.vue) is one with no app frame, and nothing more: it brings its own way back, not a look of its own. The look is the UI library's tokens, which every page reads whichever library draws it — a colour on any page is a token, and a page that sets its own palette on its root is a finding (the ui-library skill, references/document-chrome.md). Every rule on this page holds inside an immersive page as on any other.

What stays in `class="..."`

Only a scoped CSS ref, a :class binding (the home of a valueless utility switched on a condition), a third-party or SVG class, group and an aria-state variant (aria-pressed:, aria-disabled:) — everything else is an attribute (references/class-attribute.md).

Theme utilities are attributify too — `references/theme-utilities.md`

presetAttributify() is active, so every token colour, named opacity and palette colour is a standalone attribute; which names generate a utility at all, and the opacity spelling, are in references/theme-utilities.md.

Links use `text-info` (the blue), never `text-accent`

A link is text-info with hover:underline; inline text that runs an action is a native <button type="button"> in the link colour (references/links.md).

State variants are utilities, not `&:hover` blocks

A state colour is a variant utility (hover:text-text), never an &:hover block, and a hover or selected background is the library's tint, never a picked surface (references/state-variants.md).

Utility vocabulary — `references/utility-vocabulary.md`

Where two spellings say the same thing, one is the repo's. Choosing between an abbreviation and its long form, a named step and a numeric one, a directional gap, or a slash value against a bare one is in references/utility-vocabulary.md.

Images Are `<NuxtImg>` — `references/images.md`

A raw <img> is a vue/no-restricted-html-elements error. Read references/images.md when adding or sizing one: width/height are html attributes rather than styles, sizing is CSS utilities, and object-contain/object-cover is stated wherever both dimensions are constrained.

The Parent Owns Spacing

Space between siblings is the container's gap-*, space inside a boundary its padding; a reset, a negative margin or one margin repeated across siblings means the space is in the wrong place (references/spacing.md).

Absolute Positioning Within a Container

Use relative on the parent and absolute top-0 right-0 (or other corners) to pin UI elements. Prefer this over manual margin/padding tricks when an element should float independent of sibling flow.

Style Block — `references/style-blocks.md`

<style scoped> always (vue/enforce-style-attribute), plain CSS with native nesting and no lang, library CSS imported in script setup. A Fragment-rooted child defeats scoped and :deep() alike, silently — references/style-blocks.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.