
Pseudo Elements
Run a focused CSS and View Transitions audit that flags missing pseudo content, decorative DOM bloat, and transition API misuse with file:line citations.
Overview
Pseudo-elements is an agent skill most often used in Ship (also Build frontend, Operate iterate) that audits CSS pseudo-elements and View Transitions usage with file:line findings.
Install
npx skills add https://github.com/raphaelsalaja/skill --skill pseudo-elementsWhat is this skill?
- Three prioritized rule categories: Before/After (pseudo-), View Transitions (transition-), Native Styling (native-)
- Fails ::before/::after without content and nudges decorative layers off extra DOM nodes
- View Transitions API checks alongside pseudo-element hover and overlay patterns
- Outputs findings in strict file:line format for agent or human fix loops
- Grounded in pseudo-elements and View Transitions best-practice content (skill v2.0.0)
- 3 prioritized rule categories with distinct prefixes: pseudo-, transition-, native-
Adoption & trust: 2 installs on skills.sh; 18 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+200% hot-view momentum).
What problem does it solve?
Your UI uses extra DOM nodes and half-configured ::before layers or view transitions, and nothing summarizes what to fix per file.
Who is it for?
Indie frontends polishing hover states, decorative buttons, and SPA route transitions with agent-assisted CSS review.
Skip if: Greenfield theme design from scratch or teams that only need color-token linting without pseudo or View Transitions scope.
When should I use this skill?
Reviewing hover effects, decorative layers, or page transitions; outputs file:line findings.
What do I get? / Deliverables
You receive categorized pseudo- and transition-rule violations at file:line so you can remove junk markup and add required content properties before shipping.
- File:line audit findings
- Pass/fail rule examples per violation type
- Category-tagged issue list (pseudo-, transition-, native-)
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Pseudo-element and view-transition mistakes surface late as polish bugs—canonical shelf is pre-release code review. Review subphase matches checker skills that read specified files and emit actionable findings, not greenfield styling.
Where it fits
Refactor a button that uses a span overlay into ::before before merging the feature branch.
Scan changed stylesheets for missing content on pseudo-elements ahead of a production deploy.
Re-audit route transition CSS after a navigation redesign introduces invalid View Transitions patterns.
How it compares
Targeted pseudo/transition checker—not a broad ESLint or full accessibility audit suite.
Common Questions / FAQ
Who is pseudo-elements for?
Solo builders and small frontend teams reviewing CSS and TSX for pseudo-element and View Transitions best practices before release.
When should I use pseudo-elements?
Use it in Ship review when auditing hover effects or page transitions; in Build frontend when refactoring decorative layers; in Operate iterate when UI regressions involve ::before/::after or view-transition-name usage.
Is pseudo-elements safe to install?
The skill reads files you specify for static review; check the Security Audits panel on this Prism page before granting repository access to an agent.
SKILL.md
READMESKILL.md - Pseudo Elements
# 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 | Priority | Category | Prefix | |----------|----------|--------| | 1 | Before/After | `pseudo-` | | 2 | View Transitions | `transition-` | | 3 | Native Styling | `native-` | ## Rules ### Before/After Rules #### `pseudo-content-required` ::before and ::after require content property to render. **Fail:** ```css .button::before { position: absolute; background: var(--gray-3); } ``` **Pass:** ```css .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:** ```tsx <button className={styles.button}> <span className={styles.background} /> {/* Unnecessary DOM node */} Click me </button> ``` **Pass:** ```tsx <button className={styles.button}> Click me </button> ``` ```css .button::before { content: ""; /* decorative background */ } ``` #### `pseudo-position-relative-parent` Parent must have position: relative for absolute pseudo-elements. **Fail:** ```css .button::before { content: ""; position: absolute; inset: 0; } /* .button has no position */ ``` **Pass:** ```css .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:** ```css .button::before { content: ""; position: absolute; inset: 0; background: var(--gray-3); } /* Covers button text */ ``` **Pass:** ```css .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:** ```tsx <div className={styles.wrapper}> {/* Extra wrapper for hit target */} <a className={styles.link}>Link</a> </div> ``` **Pass:** ```css .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:** ```ts document.startViewTransition(() => { // No view-transition-name assigned targetImg.src = newSrc; }); ``` **Pass:** ```ts 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:** ```css .card { view-transition-name: card; } /* Multiple cards with same name */ ``` **Pass:** ```ts // Assign unique name only to transitioning element element.style.viewTransitionName = `card-${id}`; ``` #### `transition-name-cleanup` Remove view-transition-name after transition completes. **Fail:** ```ts sourceImg.style.viewTransitionName = "card"; document.startViewTransition(() => { targetImg.style.viewTransitionName = "card"; }); // sourceImg still has name, causes conflict on next transition ``` **Pass:** ```ts sourceImg.style.viewTransitionName = "card"; document.startViewTransition(() => { sourceImg.style.viewTransitionName = ""; targetImg.style.viewTransitionName = "card"; }); ``` #### `transition-over-js-li