smithery/neversight

pseudo-elements

Modern CSS pseudo-elements for styling without extra DOM nodes.

Installation

$ npx skills add smithery/neversight --skill pseudo-elements

Summary

  • Modern CSS pseudo-elements for styling without extra DOM nodes.
  • Use when implementing view transitions, adding decorative layers, or styling native browser UI.
  • Triggers on tasks involving ::before, ::after, view-transition, backdrop styling, or reducing JavaScript for visual effects.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/neversight · top by installs.

npx skills add smithery/neversight

Browse all from smithery/neversight

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1.1.0
LicenseMIT
More metadata
author
raphael-salaja
version
1.1.0
source
/content/taking-advantage-of-pseudo-elements/index.mdx

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,497 B
  • docs SUMMARY.md 307 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Pseudo Elements

Modern CSS pseudo-elements provide direct styling hooks into browser-native features—dialogs, popovers, view transitions—reducing the need for JavaScript. Sometimes you don't need to install a library; the browser has you covered.

When to Apply

Reference these guidelines when:

  • Adding decorative elements without DOM nodes
  • Implementing view transitions (image lightboxes, page transitions)
  • Building hover/focus states
  • Styling native browser UI components
  • Reducing JavaScript for visual effects

Core Pseudo-Elements

Pseudo-Element Purpose
::before / ::after Decorative layers, icons, hit targets
::view-transition-group(name) Control view transition animations
::view-transition-old(name) Style the outgoing snapshot
::view-transition-new(name) Style the incoming snapshot
::backdrop Style dialog/popover backdrops
::placeholder Style input placeholders
::selection Style selected text

::before & ::after

Create anonymous inline elements as first/last child. Require content to render.

Hover Effect Pattern

.button {
  position: relative;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.2s, opacity 0.2s;
}

.button:hover::before {
  transform: scale(1);
  opacity: 1;
}

Use cases:

  • Decorative layers and backgrounds
  • Expanding hit targets without DOM nodes
  • Keeping HTML clean while enabling visual complexity

View Transitions API

Animate between DOM states with document.startViewTransition(). The browser captures snapshots and generates pseudo-elements for both states.

How It Works

  1. Assign view-transition-name to source element
  2. Call document.startViewTransition()
  3. Inside callback, move the name to target element
  4. Browser morphs between positions, sizes, styles
sourceImg.style.viewTransitionName = "card";

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

Styling Transitions

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

When two elements share the same view-transition-name across a transition, the browser treats them as the same element and interpolates between their positions, sizes, and styles.

Key Guidelines

  • Prefer pseudo-elements over extra DOM nodes for decorative content
  • Use view transitions instead of JavaScript libraries for page/state transitions
  • Check browser support: View Transitions API is modern, use progressive enhancement
  • Keep HTML clean: Pseudo-elements reduce markup clutter

References