25% off ProSNIPC25OFF

Snippet library

CSS snippets for WordPress.

27 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.

CSS

Respect prefers-reduced-motion

Disables CSS animations and transitions for users who have enabled the reduce-motion accessibility setting in their operating system.

#accessibility#animation#css
CSSPro

CSS-Only Hamburger Toggle

A fully CSS-driven hamburger menu toggle using a hidden checkbox and sibling selectors — no JavaScript required.

#css#hamburger#mobile
CSS

Aspect-Ratio Media Wrapper

CSS utilities for maintaining consistent aspect ratios on images, videos, and iframes using the native aspect-ratio property.

#css#layout#media
CSSPro

Fluid Typography With clamp()

Scales heading and body font sizes smoothly across all viewport widths using CSS clamp(), eliminating hard breakpoint jumps.

#css#fluid#responsive
CSS

Mobile/Desktop Visibility Classes

Provides utility classes to show or hide elements at mobile, tablet, and desktop breakpoints without any JavaScript.

#css#layout#responsive
CSSPro

Sticky Sidebar on Scroll

Pins the sidebar to the viewport as the user scrolls using CSS position: sticky, with a configurable offset for fixed headers.

#css#layout#sidebar
CSSPro

Responsive Stacking Tables on Mobile

Makes wide HTML tables readable on small screens by collapsing each row into a labelled card layout using data attributes and no JavaScript.

#css#mobile#responsive
CSS

Equal-Height Card Grid

Uses CSS Grid and flexbox to build a responsive card layout where every card in the same row shares the same height with footers pinned to the bottom.

#cards#css#grid
CSSPro

Custom-Styled Checkboxes and Radios

Replaces native checkbox and radio button appearance with fully CSS-styled controls that match brand colours and scale with the font size.

#accessibility#checkboxes#css
CSS

Style Form Placeholder Text

Applies consistent colour and font-style to placeholder text in all form inputs and textareas, with a subtle fade on focus.

#css#forms#placeholder
CSS

Prevent Widows in Headings

Uses CSS text-wrap: balance on headings and text-wrap: pretty on body copy to prevent orphaned single words on the last line.

#accessibility#css#headings
CSS

Modern CSS Reset

A lightweight opinionated CSS reset that normalises browser defaults, enforces border-box sizing, and improves baseline typography across all elements.

#css#layout#reset
CSS

Add font-display swap to Fonts

Provides a @font-face template with font-display: swap so self-hosted fonts use a fallback immediately, eliminating invisible text during load (FOIT).

#css#fonts#optimization
CSSPro

Color-Code Post Status in List

Applies subtle background tints to draft, pending, scheduled, private, and trashed rows in the Posts list table.

#admin#css#list-table
CSS

Move Admin Bar to Bottom

Repositions the WordPress toolbar from the top of the viewport to the bottom using CSS overrides.

#admin#admin-bar#css
CSSPro

Dark Mode via prefers-color-scheme

Applies a full dark-mode palette through CSS custom properties when the OS dark-mode preference is active.

#accessibility#css#dark-mode
CSSPro

Skeleton Loading Shimmer Animation

Provides animated shimmer placeholder blocks (text lines, avatar, card) to show while content is loading.

#animation#css#loading
CSS

Smooth Scroll with Header Offset

Enables CSS smooth scrolling globally and adds a scroll-margin-top to anchor targets so they clear a fixed header.

#anchor#css#navigation
CSS

Custom Text Selection Color

Overrides the browser default text-selection highlight with brand colours, with a separate scheme for code blocks.

#branding#css#selection
CSS

Visible Focus Outline (Accessibility)

Hides the focus ring for mouse/touch users while preserving a clear, high-contrast outline for keyboard navigation.

#a11y#accessibility#css
CSS

Responsive 16:9 Video Wrapper

Wraps iframes and video embeds in a fluid container that maintains a 16:9 aspect ratio at any viewport width.

#css#embed#iframe
CSS

Print Stylesheet

Hides navigation and sidebars, forces black text, and expands link URLs for a clean print layout.

#accessibility#css#media-query
CSSPro

Custom Scrollbar Styling

Replaces the browser default scrollbar with a slim, themed scrollbar using WebKit and Firefox APIs.

#css#scrollbar#styling
CSS

Sticky Footer Layout

Forces the page footer to stay at the bottom of the viewport on short-content pages using flexbox.

#css#flexbox#footer