UI rules: mobile-first responsive design, text of at least 16px in form controls on touch devices so that an iPhone doesn't zoom the page, Tailwind CSS, shadcn/ui on Base UI in React projects and shadcn-vue or Nuxt UI in Vue projects, the inset shell with light, dark, and system themes for the screens customers don't see, the icon library, theme tokens, separate font families for headings and body text, and the bans on inline styles and CSS files. Load when changing UI, components, styles, or...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Ui?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/the-up-skill-f7h0gc)
---
name: ui
description: "UI rules: mobile-first responsive design, text of at least 16px in form controls on touch devices so that an iPhone doesn't zoom the page, Tailwind CSS, shadcn/ui on Base UI in React projects and shadcn-vue or Nuxt UI in Vue projects, the inset shell with light, dark, and system themes for the screens customers don't see, the icon library, theme tokens, separate font families for headings and body text, and the bans on inline styles and CSS files. Load when changing UI, components, styles, or a design system."
---
# UI
- Build every interface mobile-first and responsive; serve images sized for the screen (`srcset` or the framework's image component).
- Give every form control that a person types in or picks from a computed font size of at least 16px on touch devices: every `input` that takes text, a number, a date, or a time, every native `select` and `textarea`, and every `contenteditable` element. On an iPhone, Safari, Chrome, and Firefox zoom the page to a focused control whose text is under 16px, and the page stays zoomed in after the control loses focus.
- Use the theme's 16px text size, such as Tailwind's `text-base`. Apply it on touch devices, with `@media (any-pointer: coarse)` or Tailwind's `any-pointer-coarse:` variant (Tailwind 4.1 or later), or at every width. Never tie it to a width breakpoint: an iPhone zooms at any width, and a large one held sideways is wider than 768px.
- Check the classes of the library components that the controls you add or restyle come from, such as the input inside a combobox, a command menu, or a search field, and fix them in the project's copy of the component or through the library's theme. In most of shadcn/ui's styles, `Input` and `Textarea` ship `text-base md:text-sm` and `NativeSelect` ships `text-sm`; in its Lyra and Mira styles, all three are under 16px at every width, and the command menu's input is under 16px in every style.
- Don't turn zoom off or cap it under 2 in the viewport tag to stop this, such as with `user-scalable=no` or `maximum-scale=1`, not even while a control has focus: a browser that obeys the tag takes pinch zoom away, which fails WCAG 1.4.4, Resize Text. If the tag already does it, propose, as separate work, removing it after every control the project draws measures at least 16px.
- Raise the text size without changing the control's box: keep its height, width, padding, and line height, and keep it on one line with the controls beside it, such as a code field and its Apply button. Tailwind's `text-base` sets a line height of its own, so set the old one with it, such as `text-base/5` at the widths where the control had `text-sm`.
- Measure the font sizes instead of reading the styles, on each page type where a control you add or restyle appears. That is every page type when you change a shared form component, the theme's text sizes, or the viewport tag.
- Use a browser that emulates a touch screen, such as the device mode of Chrome DevTools or a Playwright context with `hasTouch`, and check there that `matchMedia("(any-pointer: coarse)").matches` is `true`.
- Measure at a phone's upright width, such as 390px, and at a large iPhone's sideways width. Open every drawer, dialog, pop-up, and collapsed section on the page, signed out and signed in where the page has both states, and report a state you couldn't reach as unmeasured.
- List every control this rule covers, including those in open shadow roots, with its computed font size from `getComputedStyle`. Accept nothing under 16px among the controls you add or restyle.
- Report the other controls you find under 16px as separate work. Report with them the controls that another service draws and that measure under 16px, and every other control you couldn't measure, such as those of an embedded form, a chat window, or a hosted checkout, each with the service that draws it. Keep that list in your report, not in a committed test.
- Then ask the user to confirm on a real iPhone, held upright and sideways, that tapping each control you added or restyled doesn't zoom the page, or, when you change the viewport tag, each control the project draws. Until the user confirms it, report the check as unconfirmed. A viewport tag with `user-scalable=no` or `maximum-scale=1` passes this check by itself, so say so when the page has one.
- In projects where Tailwind applies, use the latest stable release of Tailwind CSS; report it if the browsers the project supports don't meet that release's requirements. In an existing project, propose installing or upgrading it as separate work.
- In React projects that use Tailwind, use shadcn/ui based on Base UI for UI components (`shadcn init -b base`) and add components with the shadcn CLI. If the project's shadcn setup uses Radix, continue with it. In Vue projects, use shadcn-vue or Nuxt UI, which are both open source and built on Tailwind: continue with the one the project already uses, and otherwise choose the one that fits the project and say why. In projects that use neither React nor Vue, ask the user which component library to use.
- Build every screen that customers don't see on an inset shell, as in shadcn's `sidebar-08` block and GitLab's current interface: admin and back-office panels, and their sign-in, password reset, and other auth screens.
- The sidebar sits on the page background, with the brand or the organization switcher at the top, the navigation in labeled groups, and the support links and the user menu at the bottom.
- Mark the current page's item in the sidebar with a subtle background and a bolder weight, as shadcn's `isActive` does, and with `aria-current="page"` on its link. Don't mark it with a border or a bar on its edge.
- The content sits in a panel with rounded corners, inset from the edges of the window so that the background shows around it, with the sidebar toggle and the breadcrumb at its top. On mobile, the panel takes the full width and the sidebar opens as a drawer.
- The auth screens show their form in the same kind of panel on the same background, without the sidebar.
- In React, start from the `sidebar-08` block (`shadcn add sidebar-08`), whose `Sidebar` uses `variant="inset"` next to a `SidebarInset`; in Vue, start from shadcn-vue's `sidebar-08` block or from Nuxt UI's `DashboardGroup`, `DashboardSidebar`, and `DashboardPanel`.
- In an existing panel with another layout, propose the move to this shell as separate work.
- Always offer light, dark, and system themes on these screens, with system as the default. Remember each person's choice, apply it before the page first paints, define every color token for both themes, and check each screen in both. Use the setup that the component library documents, such as `next-themes` with shadcn/ui, `useColorMode` from VueUse with shadcn-vue, or Nuxt UI's color mode components.
- Ask the user to choose the icon library among Lucide, Phosphor, and Tabler; if the project already uses one of them, continue with it without asking. Use icons as SVG components, not as an icon font, and set the component library to the same icon library, for shadcn/ui with `shadcn migrate icons`.
- Use theme tokens (the component library's CSS variables, `@theme`) for color, spacing, radius, and typography; don't write hard-coded values (`#1a1a1a`, `bg-[#1a1a1a]`).
- Use at least two font families in every interface and design system: one for headings and one for body text. Define them as theme tokens, such as `--font-heading` next to `--font-sans` in `@theme`, apply the heading family to headings through the theme instead of on each element, and self-host both with the framework's font tooling, such as `next/font`, `@nuxt/fonts`, or Fontsource packages.
- Don't write inline JS or CSS: don't use the `style` attribute, `<style>` and inline `<script>` blocks, or event attributes such as `onclick` in HTML. Exceptions: passing a runtime value through `style` only as a CSS variable that a Tailwind class uses (for example `bg-(--brand-color)`), JSON-LD data blocks, and framework-generated code.
- In Tailwind projects, don't create new CSS files, and don't use CSS modules, Sass/Less, CSS-in-JS, or component-scoped `<style>`. Only the entry CSS file that contains `@import "tailwindcss"` and the configuration files of Tailwind and the component library may exist; if a custom style is needed, define it in the entry file with `@theme`, `@utility`, or `@layer`.
- In the files you change, move CSS files, inline styles, and the use of other UI libraries to Tailwind and the project's component library from these rules; if Tailwind isn't installed or the migration would grow the task, propose the migration as separate work.
- Automate Tailwind class ordering with a formatter; enforce the inline style and CSS file bans with lint as far as the tools support it.
Sources: [`WKWebViewIOS.mm`](https://github.com/WebKit/WebKit/blob/main/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm), [`WKContentViewInteraction.mm`](https://github.com/WebKit/WebKit/blob/main/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm), and [`UserInterfaceIdiom.mm`](https://github.com/WebKit/WebKit/blob/main/Source/WebCore/PAL/pal/system/ios/UserInterfaceIdiom.mm), WebKit; [Meta viewport allows for zoom](https://www.w3.org/WAI/standards-guidelines/act/rules/b4f0c3/), W3C ACT rule; [16px or Larger Text Prevents iOS Form Zoom](https://css-tricks.com/16px-or-larger-text-prevents-ios-form-zoom/), CSS-Tricks, 2021-05-04.