Skip to content
Back to skills

Admin Theme

ASecurity

The admin has its own look, independent of the consumer app's public site: the Pluto UI tokens (a tholin primary, haze secondary, kuiper neutrals), its own chart palette, surfaces, and the Pluto fonts.

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
designgovuenodegit

Works with

  • cli

Security analysis

A100/100

Scanned November 24, 2026

npx -y skills add plutocms/pluto --skill admin-theme --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Admin Theme?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Admin Theme
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/plutocms-admin-theme/badge)](https://www.skillsdirectory.com/skills/plutocms-admin-theme)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Admin theme

The admin has its own look, independent of the consumer app's public site: the Pluto UI tokens
(a tholin primary, haze secondary, kuiper neutrals), its own chart palette, surfaces, and the
Pluto fonts.

## The Pluto UI tokens

`app/assets/css/pluto-tokens.css` holds the official palette and fonts of Pluto in
`@theme static`: the scales `tholin` (red-orange, the action color), `haze` (blue), `heart`
(tan and cream) and `kuiper` (a cool deep neutral), 50 to 950, and `--font-pluto` (Public Sans)
and `--font-pluto-display` (Fredoka). Every app gets the utilities (`bg-tholin-600`,
`font-pluto`) and the variables. The tokens only add names; they never change the app's own
colors or fonts. `pluto-layer.css` imports the file before `admin-theme.css`.

The generator reads the scales from this file, so the admin and the tokens cannot drift. Change a
token, then run the generator.

## Why

The consumer app styles its public site through its own `app.config` colors and `@theme`.
Both used to reach the admin:

- `app.config` `ui.colors` sets Nuxt UI's `--ui-color-*` scales on `:root`. A site that set
  `primary: 'brand'` turned every admin primary to its brand color.
- `@theme` can redefine a Tailwind color, such as `--color-red-400`, which feeds Nuxt UI's
  `error` color.

## Files

- `app/assets/css/admin-theme.css` — generated. Do not edit it by hand.
- `app/assets/css/pluto-tokens.css` — the Pluto UI tokens (see above).
- `scripts/generate-admin-theme.cjs` — generates it from the Pluto tokens and, for the status
  colors, the installed Tailwind palette. Run
  `node scripts/generate-admin-theme.cjs` from `packages/core`.
- `app/composables/pluto-admin-theme.ts` — `usePlutoAdminTheme()`.
- `app/layouts/admin.vue`, `app/layouts/auth.vue` — call `usePlutoAdminTheme()`.
- `app/components/Pluto/Navbar/PlutoNavbarAdmin.vue` — carries `data-pluto-admin-scope`.

## How it works

Two selectors carry the theme:

- `:root[data-pluto-admin]`. `usePlutoAdminTheme()` sets `data-pluto-admin` on `<html>` while
  an admin layout is mounted, and `useHead` removes it after. The theme then also covers
  overlays (modals, slideovers, menus, toasts, the command palette) that render at the end of
  `<body>`, outside the layout.
  In the browser, `useHead` writes `<html>` a frame after the render, and the admin build only
  matches under the attribute. So the composable also sets the attribute in `onMounted` (the same
  task as the DOM change, before the paint) and removes it in `onUnmounted` when no admin layout
  is left (a count). Without it, a client navigation from the public site shows one frame of the
  admin with no styles.
- `[data-pluto-admin-scope]`, for admin chrome that also shows on the public site, such as
  the admin navbar for a logged-in admin.

Every value is a literal OKLCH color, never `var(--color-*)`, which an app can redefine. The
selectors are more specific than Nuxt UI's `:root` and `.dark` rules.

The stylesheet declares the semantic tokens (`--ui-primary`, `--ui-bg`, `--ui-text`, ...)
again, not only the color scales. A custom property inherits as a resolved value. On a
scoped element, the `:root` tokens would still hold the app's colors.

## Palette

| Role      | Color  | Light step | Dark step |
| --------- | ------ | ---------- | --------- |
| primary   | tholin | 600        | 400       |
| secondary | haze   | 700        | 400       |
| success   | green  | 500        | 400       |
| info      | haze   | 500        | 400       |
| warning   | amber  | 500        | 400       |
| error     | rose   | 500        | 400       |
| neutral   | kuiper |            |           |

The light steps of tholin and haze give 4.5:1 on white, as on the docs site. Errors use rose, not
red: tholin is a red-orange (OKLCH hue 37) and red (hue 27) looks like it next to a primary
button. Rose is at hue 17. Every value is an OKLCH literal (the generator converts the hex tokens).

Surfaces (`--pluto-admin-canvas`, `--pluto-admin-sidebar`, `--pluto-admin-navbar`): in light
mode, a white canvas, a kuiper-50 sidebar, and a kuiper-950 (near black navy) navbar. The navbar
is near black in both modes. `PlutoNavbarAdmin` sets `data-pluto-admin-dark`, so its text and
buttons take the dark tokens in light mode too. In dark mode the surfaces go from darkest at the
top to lightest in the content, all on the kuiper hue (273):

| Surface                           | Dark value                                                  |
| --------------------------------- | ----------------------------------------------------------- |
| Navbar (`--pluto-admin-navbar`)   | kuiper-950                                                  |
| Sidebar (`--pluto-admin-sidebar`) | `oklch(20.5% 0.040 273)`, between kuiper-950 and kuiper-900 |
| Canvas (`--pluto-admin-canvas`)   | kuiper-900                                                  |
| Cards (`--ui-bg`)                 | `oklch(28% 0.042 273)`, one step above the canvas           |

Chart series (`--ui-chart-1` to `-6`), in a fixed order: tholin, haze, lime, violet, teal,
amber. Light: tholin-600, haze-600, lime-700, violet-500, teal-600, amber-600. Dark: tholin-500
(the primary 400 is too light for the dark band), haze-500, lime-600, violet-500, teal-600,
amber-600. The dataviz palette checks pass for both: lightness band, chroma floor, colorblind
separation of neighbors (worst 12.6), normal-vision separation, and 3:1 contrast, on white and on
the dark card surface. Lime must not sit next to amber: that pair fails the colorblind check.
Amber is also the warning color; no other hue passed in the sixth slot without a status color.
Run the checks again before you change a slot.

## Fonts

The admin has one font, Public Sans (`--font-sans` under the admin selectors), a literal like the
colors. `@nuxt/fonts` finds it in the stylesheet and serves it. Page titles (`h1`: the dashboard,
Settings, the sign-in card) are semibold with tighter letter spacing: a sober face. Fredoka, the
rounded face of the wordmark, is for the public site only (`pluto-site-theme.css`). The `h1` rule
reads `--pluto-admin-font-display` first, so a brand can set its own title font (`fontDisplay`);
the theme does not declare it.

`pluto-layer.css` still declares `--font-outfit` (the font of the admin before the Pluto tokens)
in `@theme`. Some sites use `font-outfit` for their own text, so it stays until they move.

## Corner radius

The admin radius is one step smaller than before: `--ui-radius: 0.25rem` (it was 0.375rem). So
`rounded-md` is 6px in the admin (it was 9px). It lives in `app/assets/css/pluto-layer.css`, not in
the generated `admin-theme.css`, under the same two selectors as the theme:
`:root[data-pluto-admin]` and `[data-pluto-admin-scope]`. Overlays follow the same way as colors.
An admin overlay on a public page needs a `data-pluto-admin-scope` ancestor (the admin menu
slideover has a wrapper. The user menu uses a portal target).

A custom property that uses `var()` resolves where it is declared. So the rule declares
`--radius-xs` to `--radius-3xl` again, next to `--ui-radius`, with the multipliers of Nuxt UI. Never
put the radius in `@theme`: it would reach the public site of the app.

## Snappy hovers

`pluto-layer.css` gives the color, opacity and `transition` utilities no duration in the admin
(also on the `::before` layer of the menu items), so a hover shows at once. A Nuxt UI button
(`[data-slot=base]` on a `button` or `a`) keeps 75ms. The navbar (`data-pluto-admin-dark`) has no
transition at all. Transforms and keyframe animations are not touched. To keep a transition on
purpose, use the important modifier (`before:duration-150!`), as the resize handles do.

## Admin surfaces

Light mode is not white only. The `@utility` classes of `pluto-layer.css`:

- The admin sidebar (`app/layouts/admin.vue`): the navbar color in both modes
  (`bg-(--pluto-admin-navbar)`), with `data-pluto-admin-dark`. It has no border.
- `bg-pluto-panel`: the side panels of a canvas form (`PlutoViewSidePanel`, the Outline): `--ui-bg`
  in both modes, the background of the editor.
- `bg-pluto-rail`: the rail of a canvas form and the right panel (`PlutoViewAside`, desktop):
  `--ui-bg-muted` in light mode, transparent in dark mode. Neither is a dark panel.
- `bg-pluto-frame`: the frame around the canvas "sheet" (see the admin-view-chrome skill):
  `--ui-bg-muted` in light mode, `--pluto-admin-canvas` in dark mode.
- Put `data-pluto-admin-dark` on a dark surface, so its text and buttons take the dark tokens. A
  menu or a popover that opens from it teleports to `<body>` and keeps the normal tokens.

The toolbar bar of the post editor uses plain Tailwind classes, the same in core and in
supabase-blog: `border border-[oklch(0_0_0/0.19)] bg-white shadow-[0px_12px_15px_-15px_#0000007a] dark:border-default dark:bg-(--pluto-admin-sidebar)`. White with a soft shadow and a thin border in light mode, the dark sidebar
color in dark mode (the shadow stays).

## Inline code

Every `<code>` of the admin (not inside `pre`) is a small box: the accented border, the elevated
background, the highlighted text and the mono font at 0.875em. The rule is in `pluto-layer.css`, in
`@layer base`, so a utility class on the element (`text-xs`, `break-all`) and the styles of an
editor win. Do not style a `<code>` again in a component.

`PlutoCodeText` (`app/components/Pluto/`) renders a translated string with code: the parts between
backticks become `<code>` (`plutoCodeTextParts` in `shared/utils/code-text.ts`; no `v-html`).
Mark an env var, a file, a path or a command in a string with backticks, and render the string with
`<PlutoCodeText :text="t('...')" />`. The GitHub setup pages of the server do the same with
`escapeCodeText`. Test: `test/code-text.test.ts`.

## The search overlay

The admin search (`UDashboardSearch`) gets `ui.modal: 'pluto-admin-search'`. A rule in
`pluto-layer.css` (`[data-slot=overlay]:has(+ .pluto-admin-search)`) makes its overlay darker
(`oklch(13% 0.03 273 / 0.6)`) with a 6px backdrop blur. Other modals keep the Nuxt UI overlay.
The sidebar search button is the `soft` variant (no border).

## Rules for admin code

- Use Nuxt UI semantic classes (`bg-default`, `text-muted`, `border-default`, `bg-primary`)
  and the surface variables, not raw Tailwind colors such as `bg-zinc-100` or `bg-green-600`.
  Raw colors do not follow the admin theme.
- Call `usePlutoAdminTheme()` in every new admin layout.
- Put `data-pluto-admin-scope` on admin chrome that renders outside an admin layout.
- Use Lucide icons (`i-lucide-*`) for admin icons. Core does not install other Iconify collections,
  because `@nuxt/icon` puts each installed collection in the server bundle. For a brand icon, add it
  to the `pluto` custom collection in `nuxt.config.ts` (`pluto:github` is there). Do not add
  `@iconify-json/*` packages to core.

## Component defaults: `PlutoAdminTheme`, not `app.config`

`app.config` is global. When core put the admin sizes there (`xl` buttons, inputs and form
fields), they reached every public site, and a site's own `app.config` reached the admin: the
docs site set `md` for its pages, so its admin was `md` and other admins `xl`; a site's
`ui.button.slots.base: 'font-outfit'` gave the admin buttons the font of the site.

Now the admin defaults are in `app/composables/pluto-admin-theme.ts`:

- `PLUTO_ADMIN_UI_PROPS`: the default size of Nuxt UI (`md`) for every component that has a
  size. The admin pins it, so a site's `defaultVariants.size` does not reach the admin. Do not
  set `size="md"` on a component: it is the default. Set a size only for a component that must
  be smaller or larger (an `xs` icon button in a toolbar). It also sets `arrow: true` on the
  tooltip, the popover, the dropdown menu, the select, the select menu and the input menu: every
  floating surface points to its trigger. A component that sets `:arrow` itself wins.
- `PLUTO_ADMIN_UI`: `font-sans` on the base of the form components (the admin font), after the
  classes of the site, so tailwind-merge drops a site font class.

The elevation is not a slot class: Nuxt UI merges a component's own `ui` over the theme `ui` with
`defu`, so a component that sets `ui.content` (the editor menus, the user menu) would drop it. A
rule in `pluto-layer.css`, outside any layer, gives `shadow-pluto-elevated` (a strong shadow,
stronger in dark mode, that keeps the ring of the surface) to every popper content (popover,
dropdown, context menu, select and combobox lists), every dialog (modal, slideover, command
palette) and the editor menus (`/`, mention, emoji). Tooltips keep their small shadow. The core
`Modal` component uses the utility directly.

Tooltips are dark in both modes, for the same reason a CSS rule: the tooltip content
(`[data-reka-popper-content-wrapper] > [data-slot='content']:has([role='tooltip'])`) is in the
selector list of the dark tokens in `admin-theme.css` (text, borders, kbds), and `pluto-layer.css`
gives it and its arrow the navbar color (`--pluto-admin-navbar`).

`PlutoAdminTheme` gives them with `UTheme` (no element, provide/inject, so overlays opened
from inside get them too). The admin layout, the auth layout and the admin bar
(`PlutoNavbarAdmin`) wrap their content in it. Core has no `app.config`.

A site `app.config` slot class that is not a font (a radius, a shadow) can still reach the
admin. Add its reset to `PLUTO_ADMIN_UI` when one shows up.

The body: `admin-theme.css` sets the font and the color of `body` under `[data-pluto-admin]`,
and `pluto-layer.css` sets its `color-scheme` (light, or dark with `.dark`), so a site's
`body` rules do not reach the admin.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in design →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.