20 CSS Gradient Text Designs

16 Pure CSS4 Light JSPublished

CSS gradient text uses background-clip: text to mask a gradient through the shape of a letterform — the gradient becomes the visible fill, the text becomes the clipping mask. These 20 hand-coded designs cover the full modern playbook — animated @property flow, aurora sweep, conic hue spin, per-letter rainbow wave, neon glow, outline stroke, metallic chrome/gold/copper, holographic foil, duotone, texture fills, cursor-tracked radials, glitter sparkle and more. Every demo uses scoped .gt-NN class names that never collide with your existing styles, honours prefers-reduced-motion, and ships under the MIT license.

Related20 CSS Text Gradient Effects20 CSS Neon Text Effects30 CSS Text Animations

Premium design systemPartner: Untitled UI

Affiliate link

Taking this style from one component to a whole product?

You just browsed 20 gradient text effects. Untitled UI is the Figma UI kit 380,000+ designers use, with 10,000+ components and variants in Pro, plus a matching React library on Tailwind CSS. Figma Pro is a one-time purchase from $129.

Get Untitled UI Pro

Untitled UI. We may earn a commission, at no extra cost to you.

Newsletter

Enjoying these demos? Get new ones by email.

A short email when a new collection ships. Unsubscribe any time.

at

Almost there: check your inbox to confirm.Manage

Newsletter

Enjoying these demos? Get new ones by email.

A short email when a new collection ships. Unsubscribe any time.

at

Almost there: check your inbox to confirm.Manage

FAQ

Frequently asked questions

What is CSS gradient text and how does it actually work?
CSS gradient text uses the background-clip: text property to mask a gradient through the shape of a letterform — the gradient becomes the visible fill while the text glyph becomes the clipping mask. The canonical four-line recipe: (1) set a background to your gradient on the text element, (2) set background-clip: text AND -webkit-background-clip: text (Safari + older Chrome still need the prefix in 2026), (3) set color: transparent OR -webkit-text-fill-color: transparent to make the text itself see-through, (4) the gradient now shows through the letter shapes. Demo #01 (Animated Gradient Text Flow) ships the modern @property --angle typed-custom-property version that animates smoothly (the older background-position trick is jerky because percentages can't be interpolated with sub-pixel precision). The technique works for any gradient: linear, radial, conic, repeating, or animated.
Which gradient text pattern should I pick for my use case?
Decision rule by intent. Hero headline / above-the-fold: Demo #01 (Animated Gradient Text Flow) for a subtle continuous shimmer, or Demo #02 (Aurora Borealis Sweep) for premium SaaS. Logo / brand mark: Demo #08 (Metallic Chrome Gold Copper) for luxury / premium, Demo #09 (Holographic Foil) for trendy / tech-forward, Demo #07 (Outline Stroke) for editorial. CTA / button text: Demo #06 (Neon Pulse Glow) for cyberpunk / gaming, Demo #13 (Hover Reveal) for understated interactivity. Editorial / magazine headline: Demo #10 (Duotone) for art-direction restraint, Demo #11 (Texture Fill — Sunset / Starfield / Ocean) for image-style fills without an actual PNG. Interactive / playful: Demo #04 (Per-Letter Rainbow Wave) for kid-friendly apps, Demo #17 (Cursor-Tracked Radial) for design-forward marketing, Demo #19 (Glitter Sparkle) for celebration moments. Tech / data / dashboards: Demo #03 (Conic Hue Spin) for analytics, Demo #12 (Liquid Mercury) for fintech / crypto. Demo / showcase / scroll page: Demo #15 (Scroll Reveal) for storytelling, Demo #18 (Typewriter Loop) for landing-page rotators. All 20 demos use scoped .gt-NN class names so you can drop multiple onto the same page without conflicts.
Why use background-clip: text instead of a gradient image PNG?
Three reasons. 1. Editable: change the gradient colors / angle / stops in milliseconds via CSS — no Photoshop, no re-export. 2. Crisp at any size: PNGs pixelate above their source resolution; CSS gradients are vector-rendered and stay sharp at any zoom level, on any DPI screen (retina, 4K, the new 8K displays). 3. Performant: an inline CSS gradient is ~50 bytes in your stylesheet; a PNG screenshot of the same text at 2x retina is 8-40KB and adds an HTTP request. Page-weight savings compound across a marketing page with several headline elements. 4. Animatable: a PNG can't shimmer, sweep aurora, or track your cursor — gradient text can. 5. Selectable + accessible: gradient text is real <h1> / <p> content — selectable by the user, indexable by Google, readable by screen readers, translatable by Google Translate / DeepL. A PNG is just an image; even with alt text, search engines and assistive tech can't extract the actual words. The only reason to use a PNG is if you need exact pixel-perfect rendering of a custom font with effects no CSS technique can produce (e.g. distressed grunge texture from a 3D render). For 99% of marketing UI, gradient text wins on every dimension.
Is gradient text WCAG-accessible? Doesn't it fail contrast?
It CAN fail contrast easily — the gradient varies across the text, so depending on the stops, parts of the letter may sit at 1.5:1 or 2:1 contrast against the page background. WCAG 2.2 AA requires 4.5:1 for body text and 3:1 for large text (24px+ regular, 18.66px+ bold). To keep gradient text compliant: (1) Use gradient text only on large display sizes (40px+, ideally 60px+ for hero headlines) where the 3:1 threshold applies — the lower bar makes mid-gradient sections more forgiving. (2) Pick gradient stops where the worst single point still clears 3:1 against your page background — test it with axe DevTools, Lighthouse, WAVE, or the WebAIM contrast checker by sampling the lightest and darkest pixel in your gradient. (3) For body-size text (16px), use solid color, not gradient — the WCAG 4.5:1 threshold is too narrow for safe gradient implementation. (4) Add a high-contrast fallback color that solid-fills the text when background-clip isn't supported or when prefers-reduced-motion is set (some users with cognitive disabilities find gradient text harder to read). The CSS recipe: color: #fff; background: ...; background-clip: text; -webkit-text-fill-color: transparent; — if background-clip fails, the color: #fff falls back gracefully. Regulatory frameworks that mandate WCAG compliance: EU EAA (European Accessibility Act, enforceable June 2025), US Section 508, Canada ACA, UK Equality Act.
Browser support — does background-clip: text still need the -webkit- prefix in 2026?
Yes, awkwardly. Spec-compliant background-clip: text reached Chrome 120+, Firefox 117+, and Safari 18.2+ — but you should still ship BOTH declarations in 2026 because Safari on iOS lags behind desktop Safari by ~6 months on user adoption (most users haven't updated past iOS 17 yet). The canonical recipe in modern code: background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; The -webkit-text-fill-color: transparent is the older Safari/Chromium way of making text see-through; modern code can use just color: transparent instead, but the -webkit-text-fill-color version takes precedence over color inheritance in some edge cases (forms, inputs) so it's the safer cross-browser default. Caniuse data: as of mid-2026, ~96% of global browser usage supports unprefixed background-clip: text; the 4% gap is iOS Safari < 16.4 and Samsung Internet < 23. Shipping both declarations costs you 30 bytes per element — cheap insurance. The Animated Gradient Flow demo (#01) ships both.
How does gradient text compare to Tailwind / shadcn / MUI / Chakra / styled-components gradient text recipes?
Tailwind v3 / v4: the canonical recipe is bg-gradient-to-r from-violet-500 to-pink-500 bg-clip-text text-transparent — Tailwind doesn't have a single utility for 'gradient text', you assemble three utilities. Our CSS to Tailwind converter outputs this combination automatically when you paste a gradient-text CSS rule. shadcn/ui: doesn't ship a gradient-text primitive; you write the Tailwind classes inline or in a custom component. MUI / Material UI: pass the gradient via sx prop — sx={{ background: 'linear-gradient(...)', WebkitBackgroundClip: 'text', WebkitTextFillColor: 'transparent' }}. The camelCased React style names hide the -webkit- prefix. Chakra UI: similar pattern via the bgGradient prop + bgClip='text' — Chakra ships this as a first-class shorthand, which is nice. Ant Design / Mantine: no first-class gradient-text component; same React-inline pattern as MUI. styled-components / Emotion: identical to plain CSS inside the template literal. For complex effects (per-letter wave, cursor-tracked, scroll-reveal): every framework requires the same custom JS that we ship in the demo's JS tab — copy it as-is. The CSS-in-JS layer doesn't change the underlying technique.
Why does my gradient text disappear when I add a text-shadow?
Because -webkit-text-fill-color: transparent (or color: transparent) makes the text glyph transparent — text-shadow then casts the shape of TRANSPARENT pixels, which means the shadow shows through and over the gradient, often producing visual chaos. The fix: use filter: drop-shadow() on the parent element instead of text-shadow on the text itself. drop-shadow respects the gradient-filled appearance because it operates on the rendered pixels, not the glyph alpha channel. The Neon Pulse Glow demo (#06) ships this pattern: filter: drop-shadow(0 0 8px rgba(255, 0, 255, 0.6)) wraps the gradient text in a magenta glow without breaking the fill. Performance note: drop-shadow is more expensive than text-shadow (it creates a paint layer); use it sparingly on hero text, not body text. Multiple shadows: stack multiple drop-shadow filters: filter: drop-shadow(0 0 8px ...) drop-shadow(0 0 16px ...) — each is its own GPU-rendered layer.
How do I animate gradient text smoothly? My background-position animation looks jerky.
Animating background-position from 0% 50% to 100% 50% is the legacy 2018 recipe — it animates the gradient stops shifting across the text, but because percentage values aren't interpolated with sub-pixel precision on all browsers, you get visible stuttering, especially on retina screens. The modern fix: use @property to declare a typed custom property and animate THAT instead. @property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; } declares --angle as an actual <angle> value (not a string) so the browser can interpolate between angle values with sub-degree precision. Then write your gradient as linear-gradient(var(--angle), #f43f5e, #8b5cf6, #06b6d4) and animate --angle from 0deg to 360deg. Result: silky-smooth rotation at 120fps, GPU-accelerated, no main-thread cost. Demos #01 (Animated Flow) and #03 (Conic Hue Spin) both ship this pattern. @property is supported in Chrome 85+, Safari 16.4+, Firefox 128+ — for older browsers, fall back gracefully to the static gradient (the typed property degrades to undefined, so the gradient uses its initial value). The same trick works for any animatable gradient parameter: hue rotation, conic from-angle, radial position.
Can I use OKLCH and Display-P3 wide-gamut colors in gradient text?
Yes — and you should for production marketing pages on modern displays. OKLCH (Chrome 111+, Safari 16.4+, Firefox 113+) is a perceptually uniform color space — interpolating between two OKLCH colors produces visually smoother gradients than interpolating between two hex codes, because hex (sRGB) interpolation passes through muddy mid-gray midpoints. Example: linear-gradient(45deg, oklch(0.7 0.18 30), oklch(0.7 0.18 250)) produces a clean magenta→cyan sweep where the equivalent hex gradient would muddy through grey-purple. Display-P3 (Chrome 111+, Safari 15+, Firefox 113+) extends color into the wider P3 gamut available on every Apple device since 2018, recent Pixel phones, and high-end Windows laptops. Reds and greens are ~25% more saturated than sRGB. Example: color(display-p3 1 0 0) is a more vivid red than #ff0000. Cross-browser strategy: layered declarations — color: #ff0000; color: oklch(0.6 0.25 30); color: color(display-p3 1 0 0); — browsers ignore declarations they don't understand and use the last supported one. Modern color-mix() function (Chrome 111+, Safari 16.2+, Firefox 113+) lets you blend two colors at runtime: color-mix(in oklch, #f43f5e 60%, #8b5cf6) — useful for theme-aware gradient stops. Demos #02 (Aurora) and #09 (Holographic) use OKLCH gradients; Demo #20 (Crystalline Prism) uses color-mix for the prism refractions.
Are these gradient text designs free, and how should I attribute them?
Yes — all 20 designs are MIT licensed and free for personal and commercial use, including client projects, SaaS products, design systems, and open-source libraries. The MIT license requires only that you keep the copyright notice if you redistribute the source code as-is; in shipped production HTML / CSS that you've adapted, no visible attribution is needed. If you ship one as part of an open-source UI library or component kit, a one-line credit pointing to https://codefronts.com is appreciated but not legally required. Accessibility: every demo uses semantic HTML, honours prefers-reduced-motion: reduce (animations fall back to static gradients), and includes a high-contrast solid-color fallback for browsers that don't support background-clip: text. Verify your specific use case with axe DevTools, Lighthouse, WAVE, or WebAIM contrast checker before shipping to EU EAA / US Section 508 / Canada ACA / UK Equality Act audits — the demos are AA-compliant at large display sizes but body-text usage may need a different approach.

Related collections

20 CSS 3D Effects preview

20 CSS 3D Effects

20 hand-coded CSS 3D patterns covering the transform pipeline reference build, the perspective property versus the perspective function, perspective-origin as the camera position, why transform function order changes the result, backface-visibility on two sided elements, what silently flattens preserve-3d, building a cube from six faces, transform-origin in three dimensions, translateZ versus scale for depth, z-fighting on coplanar surfaces, rotate3d and the transform matrix, plus ring layouts, stacked z-planes, pointer tilt with parallax, a hinged page-turn flipbook, a drag-rotate cube navigator, an extruded synth panel, perspective floor geometry, nested 3D contexts, and helix distribution. 14 demos are pure CSS; 6 use vanilla JavaScript.

22 CSS Brutalism preview

22 CSS Brutalism

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.

20 CSS Claymorphism preview

20 CSS Claymorphism

20 hand-coded CSS claymorphism designs covering the three-layer shadow recipe that defines the style, inner highlight and inner shadow layering, the border radius scale that makes shapes read as puffy rather than merely rounded, claymorphism compared side by side with neumorphism, a clay and glassmorphism hybrid, single light-source discipline across a layout, depth tiers for visual hierarchy, a Tailwind implementation with both arbitrary values and theme tokens, squishy button press states, toggles and checkboxes, inset input wells and search bars, badge and pill systems, cards, popover-based modals, pricing tables, mobile tab bars, app icon grids, toast and alert bubbles, dark mode shadow recalibration, and the paint cost of animating shadows. 19 demos are pure CSS; 1 uses vanilla JavaScript.

Search CodeFronts

Loading…