
CSS Gradient Button with Hover Animation
Published
18 hand-coded CSS gradient UI demos: gradient buttons (6-hover lab), feature cards, 3 border techniques (double-bg / mask ring / conic orbit), badges + status pills, search + input, progress bars + conic rings, mesh/aurora background, glassmorphism, full-page pan, hero overlay, neon glow cards, gradient text clipping, hover-reveal text, link underlines, metallic chrome + gold text, radial cursor spotlight, conic avatar rings, scroll mask fade. 16 Pure CSS + 2 tiny JS snippets. WCAG 2.2 AA, uses modern @property, oklch(), color-mix(), conic-gradient(), background-clip: text with progressive-enhancement @supports fallbacks. Scoped under .cgu-NN for no-collision pasting, prefers-reduced-motion guarded, framework-agnostic.
Related16 CSS Gradient Animations22 CSS Gradient Buttons20 CSS Gradient Text Designs22 CSS Brutalism

Published

Published

Published

Published

Published

Published

Published

Published

Published

Published

Published

Published

Published

Published

Published
Published
Published

Published
--tint, --acc, --from, --to) so you can rebrand the whole system by swapping 4 CSS variables. Contrast to isolated gradients — a single gradient button dropped into an otherwise flat UI reads as an accident (a designer just discovered linear-gradient()). A gradient UI system reads as intentional visual language. Google's own 2024-2026 Material Design 3 refresh moved this direction with tonal palettes derived from a single source color; Apple's iOS 26 refresh doubled down on gradient surface tiers; every AI-product launch in 2025-2026 (Perplexity, Claude, Gemini, Copilot X) shipped with gradient-first UI because gradients read premium and modern in a way flat design does not. This collection gives you the working ingredients: pick 3-6 patterns per surface, share the palette across them, and your product looks like it was designed by a team with a design system instead of a solo dev copy-pasting from CodePen.@property (Baseline: Chrome 85 / Safari 16.4 / Firefox 128) — registers a custom property with a syntax + inherits + initial-value. Registered angle-typed properties (@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false }) can be animated smoothly by transitions and @keyframes. Without @property, animating --angle: 0deg → 360deg just jump-swaps at the end because the browser sees them as strings. WITH @property, the browser interpolates through 1° per frame at 60fps on the compositor thread. This is what makes conic-gradient border spinning (Demo 03) and rotating avatar rings (Demo 17) possible in pure CSS. (2) oklch() (Baseline: Chrome 111 / Safari 15.4 / Firefox 113 — widely available since 2023) — perceptually-uniform color space where a fixed lightness increment (e.g. 0.15 → 0.10) gives you a visually-equal step across every hue. Sass mixins used to fake this via lighten($color, 15%) but sRGB isn't perceptual — the same 15% shift makes blue look black and yellow look identical. oklch() ships the fix at the browser level, zero preprocessing. (3) color-mix() (same Baseline) — declaratively blend two colors: color-mix(in oklch, var(--brand) 30%, var(--surface)). Replaces 6-tier hand-tuned tonal palettes with one derivation formula. (4) conic-gradient() (Baseline: Chrome 69 / Safari 12.1 / Firefox 83) — sweeps a gradient around a center point instead of along a line. Powers rotating spinners (Demo 06), border sweeps (Demo 03), donut charts, and Instagram-style story rings (Demo 17). Combined with @property --angle for the rotation, you replace ~40KB of GSAP + animation code with 6 lines of CSS. Every demo in this collection uses at least 2 of these 4 primitives — see each demo's howItWorks for the exact recipe..gradient-text { background: linear-gradient(90deg, var(--from), var(--to)); background-clip: text; -webkit-background-clip: text; color: transparent }. Demos 12, 13, 14, 15 in this collection show four variations (aurora text, hover-reveal flow, animated link underlines, metallic chrome text). The accessibility trap: color: transparent makes the text invisible if the gradient fails to paint. Failure modes: (a) old browsers that don't support background-clip: text — the text shows as transparent-on-background, effectively invisible; (b) high-contrast forced-colors mode (Windows High Contrast, macOS Increase Contrast) — some browsers force color to system colors but leave background-clip: text active, painting text in system color while the gradient goes invisible (which is actually what you want) but some engines get this backwards; (c) print stylesheets — printers often ignore background-clip and print transparent text as white. The fix: wrap the entire declaration in @supports (background-clip: text) or (-webkit-background-clip: text) { ... } so the fallback is the normal color: var(--ink) declaration outside the @supports block. Every gradient-text demo in this collection ships this @supports guard — audit any codebase you inherit for gradient text without it, because the invisible-text failure mode is a WCAG 1.4.3 (Contrast) violation that Axe DevTools flags and enterprise procurement audits reject. Additional accessibility non-negotiable: never use gradient text on interactive elements (buttons, links) as the SOLE indicator of a state (active, hover, focus) — colorblind users can't distinguish gradient hues. Pair gradient text state changes with an underline, weight shift, or box (Demo 14 does this by pairing gradient underlines with underline-thickness changes).seeAlso.background: #7c3aed; background: linear-gradient(90deg, oklch(0.55 0.19 300), oklch(0.72 0.16 280)). Browser reads both, uses the last it understands. @property — Baseline newly available since April 2024 (Chrome 85 / Safari 16.4 / Firefox 128). Without it, animated angles jump-cut instead of interpolating. Wrap in @supports (background: paint(worklet)) as a rough proxy — most fine-grained detection is via CSS.registerProperty feature test. Every demo in this collection using @property degrades to a static angle (still-visible) — no invisible-content failure mode. background-clip: text — Baseline since 2020 (with -webkit- prefix); Firefox 49+ / Chrome 3+ / Safari 4+ prefixed. Always paired with -webkit-background-clip: text for Safari. Wrap in @supports (background-clip: text) or (-webkit-background-clip: text) { ... } so the fallback (normal color: var(--ink)) is used when unsupported — this is the invisible-text-in-old-browsers fix. mask-image / mask-composite — universal via -webkit-mask-* prefix + Baseline unprefixed since 2023. Always pair prefixed + unprefixed. backdrop-filter (Demo 08 glassmorphism) — Baseline widely available since March 2024 (Chrome 76 / Safari 9 / Firefox 103). Wrap in @supports not (backdrop-filter: blur()) fallback with a semi-transparent background. Every demo in this collection ships the appropriate @supports guards — no post-migration accessibility surprises.class to className, drop the JSX into any server or client component (no 'use client' directive needed for the 16 Pure CSS demos because they have no interactivity that requires hydration; only Demo 06 progress ticker and Demo 16 cursor-tracking spotlight need it, each under 30 lines JS). Vue 3 / Nuxt 3: accepts as-is, class attribute is native. Svelte / SvelteKit: accepts as-is. Astro: drop into any .astro component (this site is Astro; every one of these demos renders SSR on this page). Remix / Solid.js / Qwik: accepts as-is. Tailwind CSS v3/v4: gradients port to bg-gradient-to-r from-purple-500 via-pink-500 to-orange-500 or arbitrary values bg-[linear-gradient(90deg,#7c3aed,#ec4899)]; conic-gradients require Tailwind v3 arbitrary values or v4 utility classes. For @property + oklch() + color-mix(), use Tailwind's arbitrary-value bracket syntax or drop into a @layer components block. Compared to framework-specific gradient libraries: Aceternity UI (React + Tailwind gradient components, subscription $299+/yr for premium) — this collection ships the same visual patterns MIT-licensed. Magic UI (React + Framer Motion + Tailwind, ~150KB of dependencies) — matches this collection's Demo 03 border-beam and Demo 16 spotlight in zero-dependency form. shadcn/ui — no dedicated gradient primitives; you build them yourself atop Radix + Tailwind. @radix-ui — no gradient utilities; primitives are unstyled. @mui/material Gradient — locked into MUI's ~85KB total bundle. Chakra UI Gradient — locked into Chakra's Emotion runtime ~50KB. Every gradient primitive in this collection is native CSS since Baseline 2023 — no library replicates what the browser doesn't already do. The .cgu-NN numeric-prefix scoping means all 18 gradient UI patterns coexist on the gallery page without a single class collision, and the same prefix guarantees you can drop any one demo into a codebase that already uses .gradient, .card, .btn, .hero, or .badge classes without renaming a single selector. MIT licensed, no attribution required, no signup.9 hand-coded CSS 3D scenes built with real transforms, perspective, and preserve-3d — iridescent flip cards, a midnight coverflow carousel, kinetic tilt pricing cards, a page-turn flipbook, a Bauhaus drag-cube navigator, a modular synth control panel, a luxury hover-flip product showcase, a 5×5 spinning cube matrix, and a 60-orb DNA double helix. No WebGL, no libraries.
22 hand-coded brutalist and neubrutalist CSS designs covering the full spectrum of the aesthetic — from the anti-design brutalism of 2014-2018 (raw system fonts, zero border radius, monochrome density, visible structure) through to the neubrutalism of 2021-present (bright pastel fills, thick black borders, hard offset shadows with zero blur, rounded blocks). The neubrutalist half ships SaaS pricing cards with sticker badges, a pastel admin dashboard, signup forms, rotated feature cards, an offset-shadow navbar, a playful button set, a native dialog modal, a testimonial wall, blog cards, chunky toggles, a landing hero, an image gallery, stats panels and a rounded footer. The brutalist half covers product grids, raw form controls, a monochrome data dashboard, a portfolio index, indie SaaS pricing, Windows 95 desktop chrome, editorial long-read and a streetwear catalog. Every design is scoped under a .brt-NN prefix for no-collision pasting, guards prefers-reduced-motion, and ports unchanged to React, Vue, Svelte, Astro, Next.js and Tailwind.
22 hand-coded CSS dark-mode UI patterns — prefers-color-scheme root strategy, data-theme attribute override, color-mix token system, light-dark() function, sidebar navigation, dashboard card grid, modal dialog, focus-ring contrast audit, three-state switcher, code editor surface, OLED true black, layered slate, aurora dim and more.