MCPInstall

pseudo-elements

Audit CSS for pseudo-element best practices and View Transitions API usage. Use when reviewing hover effects, decorative layers, or page transitions. Outputs file:line findings.

Installs
139
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/raphaelsalaja/userinterface-wiki --skill pseudo-elements
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads pseudo-elements automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Pseudo Elements

Review CSS and JavaScript for pseudo-element best practices and View Transitions API usage.

How It Works

  1. Read the specified files (or prompt user for files/pattern)
  2. Check against all rules below
  3. Output findings in file:line format

Rule Categories

PriorityCategoryPrefix
1Before/Afterpseudo-
2View Transitionstransition-
3Native Stylingnative-

Rules

Before/After Rules

pseudo-content-required

::before and ::after require content property to render.

Fail:

.button::before {
  position: absolute;
  background: var(--gray-3);
}

Pass:

.button::before {
  content: "";
  position: absolute;
  background: var(--gray-3);
}

pseudo-over-dom-node

Use pseudo-elements for decorative content instead of extra DOM nodes.

Fail:

<button className={styles.button}>
  <span className={styles.background} /> {/* Unnecessary DOM node */}
  Click me
</button>

Pass:

<button className={styles.button}>
  Click me
</button>
.button::before {
  content: "";
  /* decorative background */
}

pseudo-position-relative-parent

Parent must have position: relative for absolute pseudo-elements.

Fail:

.button::before {
  content: "";
  position: absolute;
  inset: 0;
}
/* .button has no position */

Pass:

.button {
  position: relative;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
}

pseudo-z-index-layering

Pseudo-elements need z-index to layer correctly with content.

Fail:

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gray-3);
}
/* Covers button text */

Pass:

.button {
  position: relative;
  z-index: 1;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gray-3);
  z-index: -1;
}

pseudo-hit-target-expansion

Use negative inset values to expand hit targets without extra markup.

Fail:

<div className={styles.wrapper}> {/* Extra wrapper for hit target */}
  <a className={styles.link}>Link</a>
</div>

Pass:

.link {
  position: relative;
}

.link::before {
  content: "";
  position: absolute;
  inset: -8px -12px;
}

View Transitions Rules

transition-name-required

Elements participating in view transitions need view-transition-name.

Fail:

document.startViewTransition(() => {
  // No view-transition-name assigned
  targetImg.src = newSrc;
});

Pass:

sourceImg.style.viewTransitionName = "card";
document.startViewTransition(() => {
  sourceImg.style.viewTransitionName = "";
  targetImg.style.viewTransitionName = "card";
});

transition-name-unique

Each view-transition-name must be unique on the page during transition.

Fail:

.card {
  view-transition-name: card;
}
/* Multiple cards with same name */

Pass:

// Assign unique name only to transitioning element
element.style.viewTransitionName = `card-${id}`;

transition-name-cleanup

Remove view-transition-name after transition completes.

Fail:

sourceImg.style.viewTransitionName = "card";
document.startViewTransition(() => {
  targetImg.style.viewTransitionName = "card";
});
// sourceImg still has name, causes conflict on next transition

Pass:

sourceImg.style.viewTransitionName = "card";
document.startViewTransition(() => {
  sourceImg.style.viewTransitionName = "";
  targetImg.style.viewTransitionName = "card";
});

transition-over-js-library

Prefer View Transitions API over JavaScript animation libraries for page transitions.

Fail:

import { motion } from "motion/react";

function ImageLightbox() {
  return (
    <motion.img layoutId="hero" /> // JS-based shared element transition
  );
}

Pass:

function openLightbox(img: HTMLImageElement) {
  img.style.viewTransitionName = "hero";
  document.startViewTransition(() => {
    // Native browser transition
  });
}

transition-style-pseudo-elements

Style view transition pseudo-elements for custom animations.

Fail:

document.startViewTransition(() => { /* ... */ });
// Uses default crossfade

Pass:

::view-transition-group(card) {
  animation-duration: 300ms;
  animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}

Native Styling Rules

native-backdrop-styling

Use ::backdrop pseudo-element for dialog/popover backgrounds.

Fail:

<>
  <div className={styles.overlay} onClick={close} />
  <dialog className={styles.dialog}>{children}</dialog>
</>

Pass:

dialog::backdrop {
  background: var(--black-a6);
  backdrop-filter: blur(4px);
}

native-placeholder-styling

Use ::placeholder for input placeholder styling, not wrapper elements.

Fail:

<div className={styles.inputWrapper}>
  {!value && <span className={styles.placeholder}>Enter text...</span>}
  <input value={value} />
</div>

Pass:

input::placeholder {
  color: var(--gray-9);
  opacity: 1;
}

native-selection-styling

Use ::selection for text selection styling.

Pass:

::selection {
  background: var(--blue-a5);
  color: var(--gray-12);
}

Output Format

When reviewing files, output findings as:

file:line - [rule-id] description of issue

Example:
components/button/styles.module.css:12 - [pseudo-content-required] ::before missing content property
components/lightbox/index.tsx:45 - [transition-over-js-library] Using motion layoutId instead of View Transitions API

Summary Table

After findings, output a summary:

RuleCountSeverity
pseudo-content-required2HIGH
pseudo-over-dom-node1MEDIUM
transition-name-cleanup1MEDIUM

References

FAQ

What does the pseudo-elements skill do?

Audit CSS for pseudo-element best practices and View Transitions API usage. Use when reviewing hover effects, decorative layers, or page transitions. Outputs file:line findings.

How do I install pseudo-elements?

Run npx skills add https://github.com/raphaelsalaja/userinterface-wiki --skill pseudo-elements in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/pseudo-elements/ (personal) or .claude/skills/pseudo-elements/ (project).

Which AI agents can use pseudo-elements?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is pseudo-elements safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains pseudo-elements?

It is published by raphaelsalaja in raphaelsalaja/userinterface-wiki. It has 139 recorded installs.

More from raphaelsalaja/userinterface-wiki

View all →

userinterface-wiki

raphaelsalaja/userinterface-wiki

UI/UX best practices for web interfaces. Use when reviewing animations, CSS, audio, typography, UX patterns, prefetching, or icon implementations. Covers 11 categories from animation principles to typography. Outputs file:line findings.

Frontend & Design4.6K installs

12-principles-of-animation

raphaelsalaja/userinterface-wiki

Open the skill to read its SKILL.md instructions.

Frontend & Design275 installs

generating-sounds-with-ai

raphaelsalaja/userinterface-wiki

Open the skill to read its SKILL.md instructions.

177 installs

sounds-on-the-web

raphaelsalaja/userinterface-wiki

Open the skill to read its SKILL.md instructions.

152 installs

to-spring-or-not-to-spring

raphaelsalaja/userinterface-wiki

Open the skill to read its SKILL.md instructions.

Backend & APIs152 installs

mastering-animate-presence

raphaelsalaja/userinterface-wiki

Open the skill to read its SKILL.md instructions.

147 installs

Popular frontend & design skills

View category →

setup-matt-pocock-skills

mattpocock/skills

Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.

Frontend & Design1.1M installs

frontend-design

anthropics/skills

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

OfficialFrontend & Design1M installs

hyperframes-animation

heygen-com/hyperframes

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.

prototype

mattpocock/skills

Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.

Frontend & Design999.2K installs

hyperframes-core

heygen-com/hyperframes

The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.

Frontend & Design930.5K installs

vercel-react-best-practices

vercel-labs/agent-skills

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

OfficialFrontend & Design843.1K installs