Category: CSS Tools

  • CSS Pattern Generator: Pure-CSS Backgrounds [2026]

    CSS Pattern Generator: Pure-CSS Backgrounds [2026]

    TL;DR: A CSS pattern generator outputs pure-CSS code for repeating background patterns — dots, grids, stripes, checks, isometric, halftone — with no image files needed. The technique uses repeating-linear-gradient, radial-gradient, and (modern browsers) image() + masks to draw geometric tiles directly in CSS. Result: tiny payloads (often under 100 bytes), infinite scaling, and styles that change with CSS variables. Our free CSS pattern generator ships 30+ presets with size, color, and angle controls.

    Background patterns used to mean a 1KB tileable PNG. Modern CSS makes most of them unnecessary — a dot grid is two short lines of radial-gradient; diagonal stripes are one repeating-linear-gradient; a graph-paper grid is two layered linear gradients. The CSS approach beats raster images on every axis: smaller payload, perfectly crisp on retina displays, theme-aware (use CSS variables for colors), and editable in DevTools without rebuilding assets.

    Our CSS pattern generator ships 30+ tested patterns across categories: dots (uniform dot grid, scattered, halftone), lines (horizontal, diagonal, crosshatch), grids (graph paper, isometric, hex), geometric (zigzag, chevron, scales). Adjust pattern size, foreground/background color, and angle. Outputs production-ready CSS with the canonical pattern declaration plus a fallback for older browsers.

    Pattern types and what each looks like

    Pattern Technique Best for
    Dot grid radial-gradient tile Subtle background, hero sections
    Graph paper Two linear-gradient layers Notebook / sketch UIs, illustrations
    Diagonal stripes repeating-linear-gradient Caution / warning blocks, accents
    Checkerboard Two linear-gradient layers at 45° offset Transparency indicator, retro aesthetic
    Isometric grid Three linear-gradient layers at 60° 3D illustrations, blueprint look
    Crosshatch Two diagonal repeating-linear-gradient Editorial, illustration backgrounds
    Halftone Sized radial-gradient with background-size Comic / pop-art aesthetic

    A simple dot-grid example

    The minimal CSS for a 2px dot every 24px:

    .dot-grid {
      background-color: #fffdf8;
      background-image: radial-gradient(circle, #635BFF 1px, transparent 1px);
      background-size: 24px 24px;
    }

    Two lines plus background color = a perfect dot grid. Resize the background-size to change spacing, swap the colors for different themes. No image, no PNG asset, scales infinitely.

    How to generate a CSS pattern

    1. Open the CSS pattern generator
    2. Pick a pattern type from the gallery
    3. Adjust pattern size (the spacing of the repeat), foreground color, background color, and angle (where supported)
    4. Watch the live preview update across the full panel
    5. Click Copy CSS for the production-ready declaration with comments and CSS variables

    Why CSS patterns beat image tiles

    • Tiny payload. A dot grid is ~80 characters of CSS. The same as an image is 0.8–2 KB after PNG compression.
    • Infinitely scalable. A 24px tile renders crisp on a 5K display because the gradient is rasterised at the actual pixel density. PNG tiles need 2× / 3× variants for retina.
    • Theme-aware. Use CSS variables for colors and the same pattern adapts automatically to dark mode without separate assets.
    • Editable in DevTools. Tweak background-size live without rebuilding any image.
    • Server caching is irrelevant. No separate request — the pattern is part of the CSS file.

    Common gotchas

    • Performance on huge fills. A repeating-gradient pattern on a full-page background performs fine. Stacking 4+ pattern layers on the same element can slow down older mobile devices — keep complex patterns to small areas.
    • Background-attachment fixed + patterns. Using background-attachment: fixed with a CSS pattern can cause repaints on scroll. Use scroll (default) for performance unless the parallax effect is essential.
    • Patterns don’t shift with mouse / scroll. If you want a “parallax” pattern effect, you need JavaScript or transform-based motion — pure CSS patterns are static relative to their element.
    • Print stylesheets. Browsers often disable background images and patterns for print to save toner. Set -webkit-print-color-adjust: exact if printing the pattern matters.
    • Edge alignment. Pattern tiles align to the element’s background-origin. If you have padding or border-radius, the pattern continues underneath them — useful for seamless backgrounds, but watch for asymmetric clipping at corners.
    • Color overlap. When stacking multiple gradient layers (e.g., grid = horizontal lines + vertical lines), check that they blend correctly. Use the + blend mode or rgba() colors with appropriate transparency.

    When NOT to use a CSS pattern

    For organic, illustrated, or photographic patterns (watercolor textures, fabric, paper grain), use a real image — CSS gradients can’t produce non-geometric shapes. For animated patterns (slowly drifting backgrounds), use SVG with smil animations or a canvas — CSS background-position animation is choppy. For SEO-relevant images (where the pattern is content, not decoration), use a real image with proper alt text. For very complex patterns (snowflakes, paisley, custom logos repeated), use a tileable SVG instead — more efficient than 10+ stacked gradients.

    Frequently asked questions

    Are CSS patterns supported in all browsers?

    Yes — radial-gradient and repeating-linear-gradient have been supported since Chrome 26, Firefox 16, Safari 7. Universal support in 2026. Even IE 11 had partial support (no repeating gradients but solid patterns work).

    Will CSS patterns slow down my page?

    Single patterns: no — they’re rendered at GPU speed and cached. Multiple stacked patterns on the same large element can slow paint times on older mobiles, but typical use (one pattern per page) has zero measurable impact.

    Can I animate a CSS pattern?

    Limited — you can animate background-position for a “scrolling” effect, or animate background-size for pulsing. More complex animation (morphing patterns, shape changes) requires SVG or canvas. Animating background-position is GPU-accelerated and smooth.

    How do I make the pattern darker / lighter?

    Adjust the foreground and background colors directly in the CSS. Pure black/dark patterns on light backgrounds maximise contrast; semi-transparent foregrounds (e.g., rgba(0,0,0,0.05)) produce subtle textures that don’t compete with content.

    Is my data uploaded?

    No. The generator runs in your browser. Pattern selections, customisations, and the generated CSS stay on your device.

    Can I export the pattern as an image?

    Yes — there’s a “Download as PNG” option that rasterises the pattern at chosen size (256×256, 512×512, or full-screen). Useful for fallbacks in old browsers, or when an image asset is required (CMS that doesn’t accept inline CSS, email templates, etc.).

    Related tools and guides

     

  • CSS Triangle Generator: Border Trick + Clip-Path [2026]

    CSS Triangle Generator: Border Trick + Clip-Path [2026]

    TL;DR: CSS triangles use one of two techniques: the classic border trick (a zero-size element with thick transparent borders, where one border has a color — that color shows as a triangle) or modern clip-path with a polygon(). Border trick has perfect browser support back to IE 6; clip-path is cleaner CSS but needs a real-sized box. Our free CSS triangle generator outputs both forms with size, color, and direction controls.

    CSS triangles solve a specific problem: drawing a small triangular shape (tooltip arrows, dropdown indicators, breadcrumb separators, accent shapes) without an SVG or image. The two techniques have been around forever — the border-trick variant is famously hacky CSS that works because of how browsers render border miters at the corners of an element. The clip-path variant is straightforward but needs more recent browser support.

    Our CSS triangle generator builds either form. Pick a direction (up, down, left, right, or one of four diagonals), set size and color, and copy the production CSS. Both versions are inline-able — no extra HTML elements needed beyond the triangle’s own div or span. This guide explains both techniques, when to use which, and the rendering quirks that make one or the other choice for specific contexts.

    Border trick vs clip-path — which to use

    Technique Pros Cons
    Border trick Universal browser support; zero-size element Hard to gradient-fill; smaller hit area
    clip-path polygon() Cleaner CSS; can have content; gradient-fillable Modern only; needs real-size box

    For tooltip arrows and dropdown indicators (decoration only): use the border trick. For triangular badges, decorative shapes, or any triangle that needs gradients, text inside, or animation: use clip-path.

    The border-trick technique explained

    An element with width: 0; height: 0; and thick borders renders as four diagonal-mitered triangles meeting at the centre. Make three of those borders transparent and you’re left with a single triangle in the colour of the visible border:

    /* Triangle pointing up — 30px wide, 20px tall */
    .triangle-up {
      width: 0;
      height: 0;
      border-left: 15px solid transparent;
      border-right: 15px solid transparent;
      border-bottom: 20px solid #635BFF;
    }
    
    /* Triangle pointing down */
    .triangle-down {
      width: 0;
      height: 0;
      border-left: 15px solid transparent;
      border-right: 15px solid transparent;
      border-top: 20px solid #635BFF;
    }

    The size is implicit: the triangle’s width is twice the border-left/right width (30px above), and its height is whatever the visible border thickness is (20px). To change direction, change which border is solid and which are transparent.

    The clip-path technique explained

    A real-sized div clipped to a polygon shape produces an editable, fill-able triangle:

    /* Triangle pointing up */
    .triangle-up {
      width: 60px;
      height: 60px;
      background: #635BFF;
      clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    }
    
    /* Add gradient or border easily */
    .triangle-gradient {
      width: 60px;
      height: 60px;
      background: linear-gradient(45deg, #635BFF, #00D4FF);
      clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    }

    Bonus: clip-path triangles can have text inside (it’s a real div), can be flex/grid containers, and can be animated. The cost is needing modern browser support (Chrome 23+, Firefox 54+, Safari 7+ — universal in 2026 except IE).

    How to generate a CSS triangle

    1. Open the CSS triangle generator
    2. Pick direction (up, down, left, right, top-left/top-right/bottom-left/bottom-right diagonals)
    3. Set width and height
    4. Pick color, plus a stroke for the clip-path version
    5. Toggle between Border trick and clip-path output
    6. Click Copy CSS

    When you’d use a triangle in real CSS

    • Tooltip arrows. A triangle pointing at the trigger element. The classic use — small (8–12px), border-trick, positioned absolutely against the tooltip body.
    • Dropdown carets. The little ▼ next to “More” buttons. Often replaced by SVG icons in modern UIs but still common in plain-CSS contexts.
    • Breadcrumb separators. The “›” between items. Often a real character, but a CSS triangle gives precise control over color and angle.
    • Speech-bubble pointers. Chat-bubble UIs use a triangle pointing at the speaker. Border trick or clip-path both work.
    • Decorative section dividers. A wide, flat triangle as a wedge between page sections. Use clip-path on a full-width div for this.
    • Custom badges. Triangular accent on the corner of a card. clip-path with text inside.

    Common gotchas

    • Sub-pixel rendering. Triangles smaller than 8px can look blurry on non-retina displays because the diagonal isn’t a clean pixel boundary. Either use larger triangles or accept slight anti-aliasing artefacts.
    • Background colour bleeds. The transparent borders in the border trick still occupy hit-test area. The visible triangle’s clickable region extends to the full bounding box, not just the visible part.
    • Inline element issues. A border-trick triangle on a <span> may render with line-height padding around it. Use display: inline-block or wrap in a container.
    • Right-to-left layouts. A triangle pointing “left” should flip to point “right” in RTL layouts. CSS logical properties (margin-inline-start etc.) help, but border-direction names don’t have logical equivalents — handle the flip manually with [dir="rtl"] selectors.
    • Animation cost. Border-trick triangles can be expensive to animate (changing border width triggers layout). clip-path triangles animate cheaply (transform-only).
    • Don’t try to gradient-fill a border-trick triangle. Borders take a single solid color. For gradients, use clip-path; for the border trick, use a wrapper element with the gradient and the triangle as a mask.

    When NOT to use a CSS triangle

    For complex shapes (chevron with rounded corners, triangular logos, multi-color triangles), use SVG inline — much more flexible. For a triangle with shadows, drop-shadow, or stroke effects, use clip-path with filter: drop-shadow(). For very tiny triangles (under 4px), consider Unicode characters (▲ ▼ ◀ ▶) which are font-rendered and crisp at small sizes. For animated character indicators (like a pulse arrow), an SVG with proper SVG animations is smoother than a CSS-only approach.

    Frequently asked questions

    Why does the border trick work?

    Browsers render borders with diagonal miters at corners. An element with zero width and height is just a point — the corners meet at the centre — and each border becomes a triangle pointing inward. Make three transparent and one solid coloured, and you see only the solid triangle.

    Which technique should I use?

    For tooltip arrows and small UI triangles: border trick (universal support, simpler positioning). For decorative triangles with content, gradients, or animation: clip-path. Both are universally supported in 2026 except IE (retired).

    Can I make a triangle with rounded corners?

    Not with the border trick. With clip-path, the polygon corners are sharp by default — for rounded triangles, use SVG with stroke-linejoin or a custom path. There’s a CSS proposal for shape-radius but it’s not implemented yet.

    How do I rotate a triangle?

    For arbitrary angles, generate a “pointing-up” triangle and apply transform: rotate(45deg). The triangle rotates around its centre. Combine with transform-origin to rotate around a different point.

    Is my data uploaded?

    No. The generator runs in your browser. Triangle settings, the live preview, and the generated CSS stay on your device.

    Can I have text inside a CSS triangle?

    Yes — only with the clip-path version. The border-trick triangle has zero width and height, so no content fits. clip-path triangles are real divs with full layout properties — text, flex, grid, anything.

    Related tools and guides

     

  • CSS Checkbox Generator: Custom Style, Accessible [2026]

    CSS Checkbox Generator: Custom Style, Accessible [2026]

    TL;DR: A CSS checkbox generator outputs custom-styled checkboxes that wrap a native <input type="checkbox"> for accessibility — keyboard navigation, screen reader announcements, form-submit semantics — while letting you control every visual aspect. The technique uses appearance: none to strip the default style, then renders a custom check via ::before pseudo-element. Our free CSS checkbox generator ships 20+ presets (rounded, bordered, animated, brand-colored), custom check icons, and the indeterminate state.

    HTML checkboxes look the same on every site by default — and every site replaces them. Bootstrap, Tailwind UI, Material Design, every CMS, every shadcn-ui clone has a custom checkbox component. The challenge isn’t visual — it’s keeping the accessibility intact while restyling. A custom div-based checkbox loses keyboard support, form submission, screen-reader announcements, and pointer-events behaviour. The trick: keep the native <input> for accessibility, hide it visually, and style a sibling element that responds to its state.

    Our CSS checkbox generator outputs the canonical pattern: a hidden native input + an associated label with a custom-styled box. Keyboard Space still toggles, Tab still navigates, screen readers still announce “checkbox, checked”, and the form still submits the value. This guide explains the accessibility-preserving CSS pattern, the gotchas with :focus-visible rings, and how to add the indeterminate state correctly.

    The accessibility-preserving CSS pattern

    The pattern uses appearance: none on the input to strip default OS styling, then customises every visual aspect with CSS — without losing the underlying <input>:

    input[type="checkbox"] {
      appearance: none;
      -webkit-appearance: none;
      width: 24px;
      height: 24px;
      border: 2px solid #d0d5dd;
      border-radius: 6px;
      background: white;
      cursor: pointer;
      position: relative;
      transition: all 150ms ease;
    }
    
    input[type="checkbox"]:checked {
      background: #635BFF;
      border-color: #635BFF;
    }
    
    input[type="checkbox"]:checked::after {
      content: "";
      position: absolute;
      inset: 4px 6px;
      border-right: 2px solid white;
      border-bottom: 2px solid white;
      transform: rotate(45deg);
    }
    
    input[type="checkbox"]:focus-visible {
      outline: 2px solid #635BFF;
      outline-offset: 2px;
    }

    That’s it — a fully custom-styled checkbox with keyboard support, form support, and accessibility intact. The native <input> still receives focus, still toggles on space, still submits. appearance: none works in every modern browser since 2020.

    Visual variations and presets

    Preset Look Best for
    Rounded square 8px corner radius (default in 2026 design) Modern web apps
    Sharp square No radius Brutalist or technical UIs
    Circle 50% radius — like a radio button Soft, friendly UIs
    Animated check Stroke-dash animation on toggle Premium feel
    Material ripple Tap-feedback ripple animation Material Design apps
    iOS-style Filled fill on check iOS-feel UIs

    How to generate a custom checkbox

    1. Open the CSS checkbox generator
    2. Pick a preset shape (rounded square, sharp, circle)
    3. Set border color, fill color, check icon style
    4. Toggle features: animation, ripple, indeterminate-state support, focus ring style
    5. Click Copy CSS for the production code (includes :focus-visible for accessibility)

    The indeterminate state — what most generators skip

    HTML checkboxes have three states: unchecked, checked, and indeterminate. Indeterminate is set programmatically (via JavaScript: el.indeterminate = true;) and represents “partially selected” — common in tree views where a parent is partially-but-not-fully checked among children.

    The CSS selector for indeterminate is :indeterminate. Our generator outputs a third visual state for it (typically a horizontal bar instead of a checkmark):

    input[type="checkbox"]:indeterminate {
      background: #635BFF;
      border-color: #635BFF;
    }
    
    input[type="checkbox"]:indeterminate::after {
      content: "";
      position: absolute;
      left: 4px;
      right: 4px;
      top: 50%;
      height: 2px;
      background: white;
      transform: translateY(-50%);
    }

    Common gotchas

    • Don’t replace the input with a div. Common mistake: hide the input entirely and use a custom <div> for the visual. You lose all accessibility — keyboard nav, screen-reader, form submit. Always keep the real input and style it.
    • :focus-visible vs :focus. Use :focus-visible for the focus ring — it shows only on keyboard focus, not on click. Without this, every click also shows the focus ring, which looks bad. :focus-visible is supported everywhere except the very oldest browsers.
    • Disabled state. A custom checkbox needs :disabled styling — usually 50% opacity and cursor: not-allowed. Don’t forget this state; users who don’t notice a disabled checkbox will tap it repeatedly in frustration.
    • Hover-only feedback isn’t enough. Touch users don’t have hover. Make sure your checked / unchecked / focus states all work without depending on hover.
    • Don’t forget the label. A bare checkbox without a label is unusable for screen readers. Wrap your checkbox + text in a <label> or use aria-labelledby. Most accessibility audits flag missing checkbox labels first.
    • iOS Safari and -webkit-appearance. Older Safari needs -webkit-appearance: none alongside appearance: none. Both prefixes work in Safari 14+; for iOS 12 and below, you need -webkit-appearance first.

    When NOT to use a CSS checkbox

    For toggle switches (on/off), use a switch component instead — visually different from checkboxes, semantically same. For radio buttons (mutually exclusive options), use type="radio" with the same custom-CSS pattern. For custom multi-select UIs (chip-style filters, tag pickers), button + aria-pressed is more appropriate than a checkbox. For very heavy custom interactions (slider toggles with drag gestures), a JS-driven component beats CSS-only — but for the 95% case, the native checkbox + custom CSS is the right call.

    Frequently asked questions

    Will custom CSS break accessibility?

    Not if you keep the native <input type="checkbox">. The element handles all accessibility — keyboard, screen reader, form submission. Hide its default visual with appearance: none and style it. Don’t replace the input with a div.

    Does this support the indeterminate state?

    Yes — set via JavaScript (checkbox.indeterminate = true) and styled via the :indeterminate CSS pseudo-class. Our generator outputs a third visual state for indeterminate (typically a bar instead of a checkmark).

    How do I make the focus ring keyboard-only?

    Use :focus-visible instead of :focus. :focus-visible only triggers on keyboard navigation, not on click. Supported in Chrome 86+, Firefox 85+, Safari 15.4+ — universal in 2026.

    Can I animate the check appearing?

    Yes — animate the ::after pseudo-element’s transform or stroke-dasharray. Generator presets include “animated check” with stroke-dashoffset that draws the checkmark on toggle. Performance is fine for hundreds of checkboxes.

    Is my data uploaded?

    No. The generator runs in your browser. Settings, the live preview, and the exported CSS stay on your device.

    What’s the difference between a checkbox and a switch?

    Semantically the same (binary on/off), visually different. Checkboxes are for forms with multiple selections (filter lists, terms-acceptance). Switches are for settings that take effect immediately (notifications on/off, dark mode). Native HTML doesn’t have a switch — use a checkbox + ARIA role="switch" for the same accessibility behaviour with switch styling.

    Related tools and guides

     

  • Instagram Filters in CSS: Clarendon, Gingham, More [2026]

    Instagram Filters in CSS: Clarendon, Gingham, More [2026]

    TL;DR: Instagram’s classic filters (Clarendon, Gingham, Moon, Lark, Reyes, Juno, etc.) can be approximated in CSS by stacking filter properties — contrast, saturate, hue-rotate, sepia — with carefully tuned values per filter. The output isn’t pixel-identical to Instagram’s proprietary algorithms, but it captures the look closely enough for previews, demo apps, and design mockups. Our free Instagram filters tool ships 30+ filter presets, applies them to any image in your browser, and copies the equivalent CSS.

    Instagram launched its filter library in 2010, popularising the now-iconic looks: Clarendon (cool, high-contrast), Gingham (vintage warm), Moon (dramatic black-and-white), Lark (high-saturation outdoor), Reyes (faded warmth), Juno (warm and saturated). Instagram’s actual implementations are proprietary GPU shaders. CSS approximations using filter functions get close to the look — close enough that web designers use them to mimic Instagram’s aesthetic in their own UIs.

    Our Instagram filters in CSS tool ships 30+ tested filter approximations. Drop an image, click a filter to preview, copy the CSS or export the filtered image as PNG. Useful for: feed-style mockups, photo galleries with consistent filter looks, hover effects that mimic Instagram, demo apps showing “before/after” filter comparisons. This guide explains how the CSS approximations work, where they fall short of Instagram’s real shaders, and the gotchas with hue-rotate.

    CSS approximations of classic filters

    Filter CSS approximation Aesthetic
    Clarendon contrast(120%) saturate(125%) High-contrast cool tones
    Gingham contrast(90%) brightness(105%) sepia(8%) Faded vintage warmth
    Moon grayscale(100%) contrast(110%) brightness(110%) Dramatic B&W
    Lark contrast(95%) saturate(110%) brightness(110%) Outdoor / nature
    Reyes sepia(22%) brightness(110%) contrast(85%) saturate(75%) Faded warm
    Juno saturate(130%) contrast(105%) hue-rotate(-10deg) Warm + saturated
    Walden brightness(110%) hue-rotate(-10deg) sepia(30%) saturate(160%) Bright yellow-tint
    1977 contrast(110%) brightness(110%) saturate(130%) sepia(50%) Faded film, retro

    Why CSS approximations aren’t exact

    Instagram’s filters are GPU shaders that operate per-pixel with custom curves, masks, and blend modes. CSS filter functions (contrast, saturate, hue-rotate, sepia) are simpler linear or per-channel transforms. The differences:

    • Tone curves: Instagram applies S-curves and custom tone-mapping that CSS can’t do directly. Our approximations use linear contrast/brightness, which gets close but not pixel-identical.
    • Per-channel adjustments: Real filters often boost reds and dampen blues separately. CSS can do hue-rotate (rotate all hues equally) but not selective per-color editing.
    • Lookup tables (LUTs): Many real filters use 3D LUTs to map every input color to an output color. CSS has no equivalent.
    • Blend modes: Instagram filters layer on tints with screen / multiply / overlay blend modes. CSS supports mix-blend-mode but only on stacked elements, not on the image itself directly.

    For a 95% accurate match in the browser, our approximations are the practical limit. For pixel-exact reproduction, use a dedicated image-processing library (Pixi.js, GLFX) with custom GLSL shaders.

    How to apply Instagram-style filters

    1. Open the Instagram filters tool
    2. Drop an image (or use one of the demo photos)
    3. Click any filter preset to preview live
    4. Adjust strength slider (0–150% — higher than 100% over-applies the effect)
    5. Click Export to bake the filter into a PNG/JPG, or Copy CSS for the equivalent filter declaration

    Common gotchas

    • The Instagram filter trademarks belong to Meta. Filter names like “Clarendon”, “Gingham”, “Moon” are Meta trademarks. Using them in your own product to label CSS approximations is legally grey — for commercial work, use generic names (“Cool”, “Vintage”, “B&W”) to avoid confusion. Our generator labels them with the recognisable names for educational reference.
    • Filters change Instagram’s CSS implementations evolve. Instagram has updated filter algorithms several times. Approximations that matched the look in 2018 may not match the 2026 version exactly.
    • Hue-rotate is unintuitive. Rotating hue by 10° shifts blue toward purple, but the same 10° from yellow lands in green. Test with the actual image — don’t pick angles by intuition.
    • Filters compound badly. Stacking 3+ filters at full strength produces over-processed output. Real Instagram filters are designed as single composites. Keep filter stacks short and adjust strength globally.
    • JPEG compression after filtering. Heavy filters (high contrast, high saturation) push pixels into JPEG’s compression-friendly bands, then JPEG compression can’t capture the subtleties. For high-quality output, export PNG and convert to JPEG only at the final step.
    • CSS filter is render-time, not destructive. Applied via CSS filter: declaration, the original image stays unchanged in the DOM. Apply via canvas (the export path) when you want a permanent change.

    When NOT to use CSS Instagram filters

    For pixel-exact recreation of Instagram’s filters (e.g., for a competitive analysis), you need either Instagram itself or a dedicated GLSL implementation — CSS can’t reach that fidelity. For commercial product features (“apply Instagram filter to your photo”), use proper trademark-friendly names and don’t mention “Instagram” in your UI without licensing. For batch image processing in CI, use sharp + custom transforms in Node — much faster than running through a browser tool. For animated filter transitions (smoothly cross-fading between filters), use CSS transitions on the filter property — works but limited to functions CSS supports.

    Frequently asked questions

    Are these the actual Instagram filters?

    No — they’re CSS approximations. Instagram’s real filters are proprietary GPU shaders. Our CSS combines contrast, saturate, hue-rotate, sepia, etc. to match the look. Visually similar; not pixel-identical.

    Can I use the filter names commercially?

    “Clarendon”, “Gingham”, “Moon” etc. are Meta trademarks. For commercial products labelling filter options, use generic names (“Cool”, “Vintage”) to avoid trademark issues. The CSS techniques themselves are open and free to use.

    Does it support PNG transparency?

    Yes — PNG alpha channels survive every filter. Drop-shadow specifically uses the alpha channel for the silhouette. JPEG inputs don’t have alpha; the rectangular bounding box shows in any drop-shadow.

    Can I apply filters in CSS without baking them in?

    Yes — that’s the use case for the “Copy CSS” option. Apply via img { filter: contrast(120%) saturate(125%); } in your stylesheet, and the original image stays untouched. Use baking (PNG export) when you want the filter permanent.

    Is my image uploaded?

    No. Filters apply via canvas in your browser. The image is loaded into a blob URL and processed locally.

    Can I create a custom filter?

    Yes — use the “Custom” mode and adjust each CSS filter function manually with sliders. Save your settings as a named preset. Useful for matching a brand-specific look across many images.

    Related tools and guides

     

  • SVG Stroke to Fill Converter: Outline-to-Path [2026]

    SVG Stroke to Fill Converter: Outline-to-Path [2026]

    TL;DR: An SVG stroke-to-fill converter takes paths drawn with stroke="..." + stroke-width="N" and replaces them with filled outline paths that produce identical visual rendering — but as filled regions, not strokes. Necessary for laser cutters, CNC routers, vinyl plotters, embroidery machines, and any pipeline that scales SVGs without honouring stroke-width. Our free SVG stroke-to-fill tool uses the same path-offset algorithms as Inkscape and Illustrator’s “Stroke to Path” command.

    SVG paths can be rendered two ways: with a stroke (a line drawn along the path with a configurable width) or as a fill (the area enclosed by the path is filled with colour). Visually they can look identical — a 4px black stroke around a circle and a filled donut shape with the same dimensions render the same. But many pipelines that consume SVG ignore stroke entirely:

    • Laser cutters (Glowforge, Epilog, AxiDraw): cut along path centerlines, but interpret fill as engraving area. A stroked path may be cut as the path itself with no width.
    • CNC routers (vCarve, Carbide Create): treat stroke-width as visual decoration, not toolpath geometry.
    • Vinyl plotters (Cricut, Silhouette): cut along paths; stroke-width has no effect on the cut.
    • Embroidery digitisers: convert paths to stitches; strokes need explicit fill geometry.
    • Some printers and PDF generators: round stroke-width to nearest pixel multiple at low DPI.

    The fix: convert every stroke to a filled outline path before exporting. Our SVG stroke-to-fill converter does this automatically — paste your SVG, get back a version where every stroked path has been replaced with an equivalent filled outline. The visual rendering is unchanged in browsers but the geometry is now portable across every SVG-consuming pipeline.

    When you need stroke-to-fill conversion

    Pipeline Honours stroke-width? Action
    Web browser rendering Yes No conversion needed
    Print PDF Mostly Convert if printing under 100 DPI
    Laser cutter (Glowforge, Epilog) No Convert before export
    CNC router (Shapeoko, Carbide) No Convert before export
    Vinyl plotter (Cricut) No Convert before export
    Embroidery (PE-Design) No Convert before export
    Figma / Illustrator export Yes No conversion needed

    How the conversion works

    The technique is path offsetting. For a path defined by a series of points, the offset path is a new path running parallel to the original at a constant distance (half the stroke-width) on each side. The two offset paths plus the rounded line caps form a closed outline — a filled region equivalent to the stroked line.

    Edge cases that need careful handling:

    • Line caps: butt, round, square. Each requires different geometry at the path endpoints.
    • Line joins: miter, round, bevel. Where path segments meet, the corners need different treatments.
    • Self-intersections: a path that crosses itself produces overlapping offset regions that need union-ing.
    • Bezier curves: the offset of a Bezier isn’t itself a Bezier — it’s approximated with multiple Bezier segments.

    Most converters (including ours) use the Clipper library or paper.js’s PathOffset algorithm — the same code Inkscape’s “Stroke to Path” command runs.

    How to convert SVG strokes to fills

    1. Open the SVG stroke-to-fill converter
    2. Paste your SVG markup or upload an .svg file
    3. The tool detects every stroked path and converts each to a filled outline
    4. Preview shows before/after side by side — should look visually identical
    5. Click Download for the converted SVG

    Common gotchas

    • Output is bigger. A filled-outline path has more points than the stroked version. File size typically grows 30–80%. For laser/CNC export this is fine; for web rendering, keep the stroked version.
    • Anti-aliasing differs slightly. Browsers anti-alias strokes differently from filled paths. Visual difference is usually invisible but exists at the pixel level — zoom to 400% and you may see edge differences.
    • Doesn’t simplify nested groups. If your SVG has nested <g> groups with transforms, the conversion preserves the structure. Some legacy laser-cutter software trips on nested groups; flatten with a separate pass if needed.
    • Stroke-dasharray becomes dashed filled paths. Dashed strokes (stroke-dasharray) convert to multiple separate filled segments. Visual is correct but the path count multiplies.
    • Round caps and joins add curve segments. A path with stroke-linecap="round" gets quarter-circle Bezier curves at endpoints in the output. Visual unchanged; geometry slightly more complex.
    • Variable stroke widths aren’t standard SVG. If you’ve used a non-standard stroke-width-variable extension (Illustrator’s variable-width strokes), the tool can’t reproduce that — it treats stroke-width as constant per path.

    When NOT to use this tool

    If your destination consumes SVG with full stroke support (modern browsers, Adobe Illustrator, Figma, Affinity), don’t convert — it bloats the file with no benefit. For web SVG, stroke-width is rendered correctly everywhere. For interactive SVG (paths animated with stroke-dasharray for “drawing” effects), don’t convert — you’ll lose the ability to animate the stroke offset. For SVGs you’ll edit later in a vector tool, keep strokes — they’re easier to manipulate than filled outlines. Use this tool only when exporting to a destination that ignores stroke-width.

    Frequently asked questions

    Why do I need to convert strokes for laser cutters?

    Laser cutters cut along path geometry, not stroke decoration. A 4mm-wide stroked line in your design isn’t a 4mm-wide cut — the cutter follows the centerline of the path. To produce a 4mm-wide cut region, the geometry must be a filled 4mm-wide outline shape. Conversion makes the geometry match what the cutter sees.

    Will the output look the same in a browser?

    Yes — visually identical at typical viewing zoom. Browsers anti-alias strokes and fills slightly differently, so at 400%+ zoom you might see edge differences, but the rendered effect is the same.

    Does it support all SVG features?

    Most: line caps (butt, round, square), line joins (miter, round, bevel), dashed strokes, miter limits, transforms. It doesn’t handle: variable-width strokes (Illustrator extension), stroke alignment (Inkscape’s stroke-alignment=”inset/outset”), or pattern-based strokes. Those convert with imperfect approximations.

    What’s the file-size penalty?

    Typically 30–80% larger output. A 12 KB SVG with strokes becomes 18–22 KB after conversion. The growth comes from filled outlines having more path points than centerline strokes, especially with rounded line caps.

    Is my SVG uploaded?

    No. The converter runs in your browser. SVG markup is processed locally — never sent to our servers.

    Can I batch-convert many SVGs?

    For one or two files, this tool is fastest. For batch processing (50+ files), use Inkscape’s command line: inkscape --export-type=svg --export-text-to-path --export-area-page --export-stroke-to-path *.svg. Same algorithm, scriptable.

    Related tools and guides

     

  • CSS Toggle Switch Generator: iOS-Style Switches [2026]

    CSS Toggle Switch Generator: iOS-Style Switches [2026]

    TL;DR: A CSS toggle switch is the iOS-style “slider” UI for binary on/off settings. Built around a hidden native checkbox (for accessibility), with a custom-styled track and thumb that animates between off and on positions. Different from a checkbox visually, but semantically the same. Use switches for “settings that take effect immediately” (notifications on/off, dark mode); use checkboxes for forms with multi-select. Our free CSS switch generator ships 12+ presets — iOS, Material, brutalist — with full keyboard / screen-reader support.

    The toggle switch became the standard UI element for boolean settings around 2010 when iOS popularised it on iPhone. Compared to a checkbox, the switch communicates “this setting takes effect right now” rather than “this is part of a form”. By 2026, every settings screen uses switches; checkboxes are reserved for forms with multiple options to select.

    The implementation challenge: keep keyboard support, screen-reader announcements, and form behaviour while replacing the visual entirely. The pattern: a native <input type="checkbox"> hidden visually but kept in the DOM, plus a CSS-styled track and thumb that respond to :checked. Add ARIA role="switch" for the correct screen-reader announcement (“switch, on” vs “checkbox, checked”), and you have a switch that’s accessible by default. Our CSS switch generator outputs this pattern with 12+ visual presets.

    Switch vs checkbox — when to use which

    Use case Switch Checkbox
    Settings that change immediately (notifications) Yes No
    Form with submit button (newsletter signup) No Yes
    Multi-select filter No Yes
    Dark mode toggle Yes No
    Accept terms of service No (it’s a form input) Yes
    Visibility setting (public / private) Yes (immediate effect) No

    Rule: switch = immediate-effect binary; checkbox = form input.

    The accessible CSS switch pattern

    /* HTML: native input, ARIA role */
    <label class="switch">
      <input type="checkbox" role="switch">
      <span class="track"></span>
    </label>
    
    /* CSS: hide native input, style the track */
    .switch input {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }
    
    .switch .track {
      display: inline-block;
      width: 44px;
      height: 24px;
      background: #d0d5dd;
      border-radius: 999px;
      position: relative;
      transition: background 200ms;
      cursor: pointer;
    }
    
    .switch .track::after {
      content: "";
      position: absolute;
      top: 2px;
      left: 2px;
      width: 20px;
      height: 20px;
      background: white;
      border-radius: 50%;
      transition: transform 200ms;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    .switch input:checked + .track {
      background: #635BFF;
    }
    
    .switch input:checked + .track::after {
      transform: translateX(20px);
    }
    
    .switch input:focus-visible + .track {
      outline: 2px solid #635BFF;
      outline-offset: 2px;
    }

    The native input is hidden visually but kept in the DOM — keyboard Space still toggles it, screen readers announce “switch, on / off” because of role="switch", and form submission still works.

    Visual presets

    • iOS Default: rounded pill, white thumb, blue/green when on. Apple’s HIG style.
    • Material Design: wider thumb, slightly different proportions, M3 colour tokens.
    • Brutalist: sharp rectangular track, no border-radius, bold colours.
    • Outlined: visible border on the track, transparent track when off.
    • Squared: slight border-radius (8px) instead of pill — modern web app style.
    • Compact: 32×16 (smaller than default 44×24) for dense UI.
    • Animated icon: sun/moon icons fade in the thumb based on state.
    • 5 more presets in the gallery.

    How to generate a CSS switch

    1. Open the CSS switch generator
    2. Pick a preset (iOS, Material, brutalist, etc.)
    3. Adjust track color, thumb color, animation duration, and switch size
    4. Click Copy CSS + HTML for a complete drop-in component

    Common gotchas

    • Don’t replace the input with a div. Common bug: hide the input entirely, replace with custom div. Loses keyboard support, screen-reader announcements, form submission. Always keep the native input and style around it.
    • role=”switch” on input vs label. ARIA role="switch" goes on the input, not the wrapping label. Screen readers announce “switch, on / off” instead of “checkbox, checked / unchecked”.
    • :focus-visible is mandatory. Use :focus-visible for the focus ring, not :focus — otherwise every click shows the focus ring, looks bad. Universal browser support in 2026.
    • Don’t trap focus inside the switch. A common bug: pointer-events: none on the input but no clear focusable target. Result: keyboard users can’t tab to the switch. Verify keyboard navigation across all switches.
    • Animation can be disabled. Respect @media (prefers-reduced-motion: reduce) and skip the thumb-slide animation for users with vestibular disorders. Toggle still works; just snaps instantly.
    • Don’t make switches too small. Minimum touch target is 44×44 px (Apple HIG) or 48×48 px (Material). The visible track can be smaller, but the clickable area must hit minimum.

    When NOT to use a CSS switch

    For form inputs that submit with a button (newsletter signup, accept-terms, multi-select filters), use a checkbox — switches imply immediate effect. For binary settings that take significant action (deleting account, publishing content), use a button with confirmation, not a switch — accidental switch toggles are too easy. For three-way state (off / on / mixed), use a button group or radio. For very dense settings panels (10+ switches per screen), consider grouped settings with subheadings rather than a flat wall of switches.

    Frequently asked questions

    Switch or checkbox — what’s the difference?

    Semantically the same (binary state); visually and behaviourally different. Switch = immediate-effect setting (notifications on/off). Checkbox = form input that requires submit. Native HTML doesn’t have a switch element — use a checkbox + ARIA role="switch".

    Will custom CSS break accessibility?

    Not if you keep the native input. Hide it visually with positioning + opacity, but leave it in the DOM. Keyboard, screen reader, form submission all work. Don’t replace the input with a div.

    Is role=”switch” supported by screen readers?

    Yes — VoiceOver (iOS / macOS), TalkBack (Android), NVDA, JAWS all announce “switch, on” or “switch, off”. Older readers fall back to “checkbox, checked / unchecked”, which is acceptable.

    How do I prevent accidental toggles?

    For high-stakes actions, use a button with confirmation rather than a switch. For sensitive settings (e.g., “make profile public”), pair the switch with a confirmation modal on first use. Switches are designed for fast, reversible toggles — high-stakes actions deserve more friction.

    Is my data uploaded?

    No. The generator runs in your browser. Settings, the live preview, and the exported CSS stay on your device.

    Can I animate the switch differently?

    Yes — pick a “Bounce” or “Snap” preset, or write your own cubic-bezier() easing. Smooth slide is the default; bouncy animations feel playful but should respect prefers-reduced-motion.

    Related tools and guides

     

  • CSS Glitch Effect: Cyberpunk Text Animation [2026]

    CSS Glitch Effect: Cyberpunk Text Animation [2026]

    TL;DR: A CSS glitch effect creates the cyberpunk RGB-split look — text rendered three times in red, cyan, and white, with each layer offset slightly and animated to create a “broken display” feel. Used for hero text on cyberpunk-themed sites, gaming UIs, error states, and brand identities that want a “glitchy” aesthetic. Our free CSS glitch generator ships 8+ presets, animation controls, and respects prefers-reduced-motion for accessibility.

    The “glitch text” aesthetic peaked in the late 2010s alongside cyberpunk’s design revival — Cyberpunk 2077 marketing, gaming UIs, vaporwave Tumblr blogs, hacker-aesthetic indie sites all leaned on RGB-split text. The technique mimics a CRT display with misaligned colour channels. The CSS implementation: render the text three times — one layer in red shifted left, one in cyan shifted right, one in white at original position — then animate the offsets randomly to create the “stuttering” feel.

    Our CSS glitch effect generator ships 8+ tested presets ranging from subtle (a steady RGB split with no animation) to chaotic (rapidly stuttering text with clip-path slices). All output is pure CSS with no JavaScript dependency, and includes a @media (prefers-reduced-motion) branch that disables the animation for accessibility-sensitive users. This guide covers the technique, the accessibility considerations, and when the glitch aesthetic is the wrong choice.

    Glitch effect anatomy

    The classic RGB-split glitch uses CSS pseudo-elements and absolute positioning:

    .glitch {
      position: relative;
      color: white;
      font-weight: 700;
    }
    .glitch::before,
    .glitch::after {
      content: attr(data-text);
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
    .glitch::before {
      color: #ff0080;
      transform: translate(-2px, 0);
      mix-blend-mode: screen;
      animation: glitch-1 2s infinite;
    }
    .glitch::after {
      color: #00fff0;
      transform: translate(2px, 0);
      mix-blend-mode: screen;
      animation: glitch-2 2s infinite;
    }
    @keyframes glitch-1 {
      0%, 100% { transform: translate(-2px, 0); }
      20% { transform: translate(-3px, 1px); }
      40% { transform: translate(-1px, -1px); }
    }
    @keyframes glitch-2 {
      0%, 100% { transform: translate(2px, 0); }
      20% { transform: translate(3px, -1px); }
      40% { transform: translate(1px, 1px); }
    }
    @media (prefers-reduced-motion: reduce) {
      .glitch::before, .glitch::after { animation: none; }
    }

    The HTML uses data-text="GLITCH" on the element and the pseudo-elements pull that via content: attr(data-text). This avoids duplicating text in the DOM (which would break screen readers). Result: visually three layers of text; semantically just one.

    Glitch presets and what each looks like

    Preset Style Best for
    Static RGB-split No animation, just colour offsets Logo / wordmark with subtle effect
    Smooth glitch 2s sine-wave animation Hero headlines, soft cyberpunk
    Stuttering Discrete jumps with steps() Aggressive cyberpunk aesthetic
    Slice glitch clip-path random horizontal slices Error states, dramatic effect
    Color burst Hue-rotate animation on top Vaporwave, retro-tech
    Hover-only Glitch activates on hover Buttons, navigation links

    How to generate a glitch effect

    1. Open the CSS glitch effect generator
    2. Type the text you want to glitch (default: “GLITCH”)
    3. Pick a preset (static, smooth, stuttering, slice, etc.)
    4. Adjust intensity, speed, and the two RGB-split colours
    5. Click Copy CSS + HTML for a complete drop-in component

    Accessibility — glitch effects can cause harm

    Animated glitch effects can trigger problems for users with vestibular disorders, photosensitive epilepsy, and cognitive disabilities. Build them carefully:

    • Always include @media (prefers-reduced-motion: reduce). Disable animation entirely for users who set this preference. Keep the static colour offset (which is harmless).
    • Avoid rapid flashing. WCAG 2.1 prohibits content that flashes more than 3 times per second over an area larger than ~25% of the viewport. Stuttering glitch animations risk crossing this — keep frame jumps below 3/second or limit to small text areas.
    • Use aria-hidden on pseudo-elements. The duplicated text in pseudo-elements is decorative — screen readers shouldn’t read it three times. ::before and ::after are excluded from accessibility tree by default.
    • High contrast underneath. The base text colour must meet WCAG contrast against the background (4.5:1 for body, 3:1 for large text). The RGB-split layers are decoration; readability comes from the base.
    • Don’t glitch entire paragraphs. Reserve the effect for headlines, single words, or short labels. A glitching paragraph of body text is unreadable.

    Common gotchas

    • Pseudo-elements need data-text or duplicate content. If you skip data-text="GLITCH" and try to use a CSS variable, browsers don’t support content: var(--text) as text content. Use data-text + attr().
    • mix-blend-mode requires a stacking context. The RGB-split layers blend correctly only when their parent has its own stacking context. If colours look wrong, add position: relative; isolation: isolate; to the parent.
    • Animation easing matters. Smooth easing (cubic-bezier) produces a “vibrating” feel; steps(N) easing produces discrete glitchy jumps. Match easing to the aesthetic.
    • Custom colours must contrast. Pure red and pure cyan on white text reads as glitch; muted reds and cyans look like a printing error. Use saturated complementary colours.
    • Hover-only is best for navigation. Always-animated text in nav menus distracts from page content. Reserve hover-only glitch for interactive elements; full animation for hero headlines.
    • SEO impact. Glitched text is fully indexed (the base text is real DOM content). Pseudo-element duplication doesn’t pollute the index — search engines ignore ::before / ::after content.

    When NOT to use a glitch effect

    For text that needs to communicate clearly (body content, instructions, error messages), the glitch aesthetic interferes with readability. For brands targeting accessibility-conscious audiences (healthcare, education, government), the effect can be off-brand. For long-running UIs (dashboards, settings panels) where the same animation plays for hours, it gets distracting. For sites in regulated industries (financial, medical) where seriousness matters, choose calmer typography. The glitch effect is for hero moments — short, attention-grabbing, decorative — not for everyday UI.

    Frequently asked questions

    Will the glitch effect work in all browsers?

    Yes — the technique uses CSS pseudo-elements, transforms, and animations, all of which have been universally supported since 2015. mix-blend-mode is supported in Chrome 41+, Firefox 32+, Safari 8+. Even mobile browsers handle it cleanly.

    Can I disable the animation for accessibility?

    Yes — our generated CSS includes a @media (prefers-reduced-motion: reduce) branch that turns off the animation. Users who set this OS preference get the static RGB split without movement. Always include this; never assume motion is universally welcome.

    Does the glitch effect break SEO?

    No. The base text is real DOM content, fully indexed. Pseudo-element duplication via data-text + attr() doesn’t pollute the index — search engines ignore generated content.

    Can I use this on more than one element per page?

    Yes — but be conservative. Multiple glitching elements on the same page compete for attention and can feel chaotic. One hero glitch is plenty; reserve the effect for emphasis.

    Is my data uploaded?

    No. The generator runs in your browser. Your text, the live preview, and the exported CSS stay on your device.

    How do I customise the glitch colours?

    Pick any two complementary colours for the RGB-split layers. The defaults (pink-red #ff0080 and cyan #00fff0) are the cyberpunk classic. For brand-on-brand effects, use your brand’s accent colours — but verify they’re saturated enough to read as “glitch” rather than “blur”.

    Related tools and guides

     

  • CSS Border Radius Generator: Per-Corner & Blob [2026]

    CSS Border Radius Generator: Per-Corner & Blob [2026]

    TL;DR: A CSS border radius generator builds rounded-corner styles visually — uniform corners, per-corner radii, or organic “blob” shapes via the elliptical syntax. Modern UI uses 8-16px on cards, 6-10px on buttons, 999px (or 50%) for fully rounded pills. Our free generator produces both the 4-value and 8-value (elliptical) syntaxes with live preview.

    Border radius is the design primitive that shifted UIs from sharp corners (1995-2010) to soft corners (2010-now) and is now the difference between “modern” and “dated” interfaces. Get the value right and your card looks polished; get it wrong and it looks like a bootstrap default. Most CSS border-radius generators only show the simple uniform-corner case; the interesting work is per-corner control and the rarely-used elliptical syntax that produces organic blob shapes.

    Our CSS border radius generator handles all three modes — uniform, per-corner, and elliptical — with a live preview and copy-ready CSS. This guide explains the right values for each UI element, the elliptical syntax that produces blob shapes, and the framework-specific shortcuts.

    Standard border-radius values for UI elements

    Element Recommended radius Notes
    Cards 8-16 px Stripe and Linear use 12px; Apple HIG uses 14px
    Buttons 6-10 px Pills (999 px) for marketing CTAs
    Form inputs 4-8 px Match your buttons to keep visual rhythm
    Avatars 50% (perfect circle) Or 999px which works the same on small elements
    Tags / chips 999 px (pill) Modern look; 4 px reads as old-school
    Modals / dialogs 12-20 px Slightly softer than cards for visual hierarchy
    Code blocks 6-10 px Match cards or buttons in your design system

    The “design system rhythm” rule: use 2-3 distinct radius values across your UI, not one per component. A typical system: 6 px (form inputs, small buttons), 12 px (cards, tags-as-rectangles), 999 px (pills, avatars, dots). Inconsistent radii (6/8/10/14 mixed across components) reads as unintentional.

    Per-corner border radius — when uniform won’t do

    /* Uniform — all four corners */
    border-radius: 12px;
    
    /* Per-corner: top-left, top-right, bottom-right, bottom-left */
    border-radius: 12px 12px 0 0;       /* card with attached top */
    border-radius: 0 12px 12px 0;       /* tab attached to left side */
    border-radius: 12px 12px 12px 4px;  /* speech-bubble pointer */

    Per-corner control is essential for tabs, speech bubbles, attached cards, and any element that visually “connects” to another. The 4-value shorthand follows the same clockwise order as padding and margin — top, right, bottom, left.

    Elliptical border radius — the blob shape secret

    The 8-value border-radius syntax produces elliptical corners, which when used asymmetrically across corners creates organic “blob” shapes:

    /* The full syntax: horizontal-radii / vertical-radii */
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    /*              ^---horizontal--^   ^----vertical---^
       tl, tr, br, bl                 tl, tr, br, bl  */

    Each corner gets two radii (horizontal + vertical), making the corner an ellipse rather than a circle. When the values are deliberately asymmetric, the result reads as organic / hand-drawn — useful for hero illustrations, decorative shapes, and modern “blob” backgrounds. Our generator includes a “blob” mode that randomises asymmetric values for instant organic shapes.

    How to use the browser border radius generator

    1. Open the CSS border radius generator
    2. Pick a mode: Uniform (one slider for all four corners), Per-corner (4 sliders), or Blob (8 values, randomisable)
    3. Drag sliders to shape the preview
    4. Toggle preset (Card, Pill, Avatar, Tab-left, Tab-right, Speech bubble, Blob)
    5. Copy CSS or Tailwind utility output

    Tailwind CSS shortcuts

    rounded-none    /* 0 */
    rounded-sm      /* 2px */
    rounded         /* 4px */
    rounded-md      /* 6px */
    rounded-lg      /* 8px */
    rounded-xl      /* 12px */
    rounded-2xl     /* 16px */
    rounded-3xl     /* 24px */
    rounded-full    /* 9999px */
    
    /* Per-corner */
    rounded-t-lg                    /* top-left + top-right */
    rounded-tl-lg                   /* top-left only */
    rounded-tl-2xl rounded-br-2xl   /* mixed corners */

    Common mistakes

    • Same radius on small + large elements. 8 px reads tight on a small button but looks dated on a large card. Scale radius with element size — small (6 px), medium (10-12 px), large (14-16 px).
    • Forgetting that border-radius: 50% only gives a circle on square elements. On a rectangle, 50% produces an ellipse. For pills, use border-radius: 999px.
    • Inheriting from images on overflow. If a child image overflows a parent with rounded corners, set overflow: hidden on the parent or apply the same border-radius to the image directly.
    • Inconsistent radii across the design system. Pick 2-3 standard values and use them everywhere. Random radii read as unintentional.

    Frequently asked questions

    What’s the difference between border-radius and clip-path for rounded shapes?

    border-radius rounds the corners of the element’s box. clip-path can produce arbitrary shapes (polygons, circles, complex paths). For simple rounding, border-radius is faster (GPU-accelerated, fewer paint cycles). For non-rectangular shapes (heart, star, custom polygon), clip-path is the right tool. They can be combined — a rounded element clipped to a custom path.

    Can I animate border-radius?

    Yes — border-radius animates smoothly via CSS transitions and keyframes. Browsers handle this efficiently. Common use: card hover states that morph from rectangle to slightly-rounded as a “lifted” effect.

    Why do my rounded images have sharp corners?

    Two common causes: (1) the parent has rounded corners but doesn’t have overflow: hidden, so the image overflows; (2) you applied border-radius to the parent but not the image directly. Fix: either apply overflow: hidden + border-radius to the parent, or border-radius directly to the image.

    What’s a good radius for a button?

    6-10 px for standard buttons matches modern design systems (Stripe, Linear, Apple HIG). Pills (999 px or rounded-full) for marketing CTAs and tags. The same value across all your buttons in a design system; don’t vary.

    Will the generator output match the preview exactly?

    Yes — the preview and the generated CSS are computed from the same values. Drop the CSS into your stylesheet and you get pixel-identical results.

    Is my data sent anywhere?

    No. The generator runs entirely in your browser. Slider values, preview, and CSS output stay on your device.

    Related tools and guides

     

  • CSS Clip Path Generator: Visual Polygon Editor [2026]

    CSS Clip Path Generator: Visual Polygon Editor [2026]

    TL;DR: CSS clip-path defines a region that an element is rendered inside — anything outside that region is clipped (transparent). Shapes can be a polygon (polygon(0 0, 100% 0, 100% 50%)), circle (circle(50% at 50% 50%)), ellipse, or inset rectangle. Our free CSS clip-path generator ships 18 presets (hexagon, arrow, talk bubble, parallelogram, chevron, star), a draggable-vertex editor, and one-click copy of the production CSS.

    CSS clip-path is the modern way to give an element a non-rectangular outline without resorting to SVG masks or background images. A clipped <img> stays a real <img> — accessible, responsive, link-able, and crisp at every device pixel ratio — while looking like a hexagon, arrow, parallelogram, or talk bubble. It’s used for hero-section diagonals, avatar masks, sticky badge tags, and the angled section breaks designers love and developers used to hate.

    The reason developers used to hate it: writing polygon() coordinates by hand is tedious and the syntax is unforgiving. polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%) is a pentagon — but you wouldn’t guess that from the numbers. Our CSS clip-path generator solves that with a visual editor: drag the vertices on a live preview and the CSS updates in real time. This guide covers every shape function, the gotchas with overflow and box-sizing, and the browser support story in 2026.

    The 4 clip-path shape functions

    Function Syntax Best for
    polygon() polygon(x1 y1, x2 y2, ...) Custom shapes with corners (hexagon, arrow, talk bubble)
    circle() circle(50% at 50% 50%) Avatar masks, circular thumbnails
    ellipse() ellipse(50% 25% at 50% 50%) Stretched circles, oval avatars
    inset() inset(10px 20px 30px 40px round 8px) Rounded-rect with inset edges (asymmetric)
    path() path("M 0 0 L 100 50 ...") SVG-grade complex shapes (curves, arcs)
    shape() (CSS Shapes 2) shape(from 0 0, line to 100% 0, ...) 2026 syntax — readable polygon alternative

    Coordinate system and units

    Clip-path coordinates are measured from the top-left of the element. The X axis grows rightward; Y grows downward. Both axes accept percentages (relative to the element’s box) or absolute units (px, em, rem). Mixed units work: polygon(0 0, 100% 0, 100% calc(100% - 20px), 50% 100%, 0 calc(100% - 20px)) creates a banner with a 20px wave at the bottom regardless of card height.

    The default reference box is the border-box (the element’s outer edge). You can change this with clip-path: polygon(...) padding-box or other box keywords — useful when you want the clip to follow the padding zone instead of the border.

    How to design a clip-path with the visual editor

    1. Open the clip-path generator
    2. Pick a preset shape (hexagon, talk bubble, arrow, etc.) — or start from a rectangle
    3. Drag the vertices on the live preview to fine-tune the shape
    4. Add or remove vertices with the + / buttons
    5. Toggle the test image (your image or one of the demo photos) to see the clip in context
    6. Copy the generated CSS, including the clip-path declaration and a fallback for older browsers

    18 production-ready presets

    The generator ships these presets so you can grab a working shape in one click:

    • Polygons: Triangle, Trapezoid, Parallelogram, Rhombus, Pentagon, Hexagon, Heptagon, Octagon, Nonagon, Decagon, Star
    • Arrows: Right Arrow, Left Arrow, Chevron Right
    • UI shapes: Talk Bubble, Cross / Plus, Slash Cut, Frame

    Each preset is named in the dropdown — click and the editor loads the polygon coordinates. Customise from there.

    Browser support and the IE legacy

    clip-path with all shape functions is supported in every modern browser: Chrome 23+ (2012), Firefox 54+, Safari 7+, Edge 79+. The path() function landed slightly later (Chrome 88, Safari 13.1). The new shape() function from CSS Shapes 2 is Chrome 116+ and Safari 17.4+ — partial support in 2026, so generate polygon() as the canonical output and add shape() as a progressive enhancement only for sites with a modern audience.

    Internet Explorer never supported clip-path. Microsoft retired IE in June 2022; if your analytics show under 0.5% IE traffic (typical in 2026), use clip-path without a fallback. For the rare site that still serves IE traffic (some government and Asia-region B2B), provide a rectangular fallback with a CSS feature query.

    Common gotchas

    • Box shadows are clipped too. A box-shadow on a clipped element appears inside the clip path, not extending outward. Use filter: drop-shadow() on a wrapping element if you need the shadow to follow the clipped silhouette.
    • Hover events still respect the original rectangle. CSS clip-path only changes paint — the click target is still the original rectangle. To make hover follow the visible shape, use shape-outside on the element or a transparent SVG overlay.
    • Animating clip-path is fast. Modern browsers GPU-accelerate clip-path animations. Animating between two polygon() shapes only works when both have the same number of vertices.
    • Children that overflow the clip are still clipped. A child element positioned outside the clip path is invisible, even if it has position: absolute. To “break out” of the clip, the child must live outside the clipped element entirely.
    • SVG-style fill-rule: for self-intersecting polygons, the default rule is nonzero. Use polygon(evenodd, ...) for the alternate fill rule when you have a knot or figure-8 shape.
    • Mobile Safari has historical bugs. Clip-path on a transformed element used to flicker on iOS 12 and earlier — fixed in iOS 13 and now stable. If you support iOS 12, test before deploying complex animations.

    When NOT to use clip-path

    For complex shapes with curves and gradients (think: a logo, illustration, or character silhouette), use SVG with the actual paths inline — clip-path is for relatively simple geometric outlines on rectangular content. For animated reveal effects across many elements, CSS masking (mask-image) plus an SVG mask gives you finer control. For extracting a non-rectangular region from an image where the result is the new image, use a raster crop tool — clip-path doesn’t change the underlying file, just how the browser paints it.

    Frequently asked questions

    Can I animate clip-path?

    Yes — modern browsers GPU-accelerate clip-path animations. Animating between two polygon() shapes works when both have the same vertex count. Different shape types (polygon to circle) need a path-conversion approach via the new shape() function or a JavaScript animation library.

    Does clip-path work in all browsers in 2026?

    Yes for the four core functions (polygon, circle, ellipse, inset). The path() function works in Chrome 88+ and Safari 13.1+. The new shape() function is partial — Chrome 116+ and Safari 17.4+. Generate polygon() as canonical output and use shape() as progressive enhancement.

    How do I make a clipped image clickable on the visible region only?

    By default the click target is the rectangular bounding box. To restrict clicks to the visible shape, use shape-outside with the same path or layer a transparent SVG with the actual path on top of the image, taking the click via the SVG.

    What’s the difference between clip-path and mask-image?

    clip-path uses geometric shape functions and produces hard edges; mask-image uses an image (typically PNG or SVG) and supports soft edges, gradients, and complex artwork. For a hexagon avatar, use clip-path. For a logo silhouette mask, use mask-image.

    Why does my box-shadow disappear with clip-path?

    Because clip-path clips the entire painted output, including shadows. The fix: wrap the clipped element in a parent and apply filter: drop-shadow() to the parent. drop-shadow follows the clipped silhouette, unlike box-shadow which uses the rectangular box.

    Is my data uploaded?

    No. The generator runs in your browser. The shape coordinates and the demo image you upload to test live only in your tab — they’re never sent to our servers.

    Related tools and guides

     

  • CSS Formatter: Beautify CSS, SCSS, LESS in Browser [2026]

    CSS Formatter: Beautify CSS, SCSS, LESS in Browser [2026]

    TL;DR: A CSS formatter (or “CSS beautifier”) reformats minified, copied, or messy CSS into consistently-indented, readable rules. Use it on copied CSS from a CDN, AI-generated styles, or styles dumped from DevTools. Our free CSS formatter uses Prettier 3 in your browser with full support for modern CSS — custom properties, native nesting, container queries, @layer, OKLCH — plus SCSS, LESS, and PostCSS.

    Reading minified CSS is a productivity tax. Tailwind’s compiled stylesheet is one giant line; a copied snippet from CodePen often arrives as a single rule with no breaks; CSS dumped from DevTools’ “Copy all declarations” comes back without the selectors that gave each rule meaning. A formatter restores hierarchy: each rule on its own line, properties indented, @media blocks visible at a glance.

    Our CSS formatter runs Prettier 3 in your browser with the same parser used by VS Code’s “Format Document” command. It handles plain CSS, SCSS, LESS, PostCSS, and modern CSS features (CSS variables, native nesting, :has(), container queries, @layer, OKLCH, color-mix()). Outputs clean, idiomatic CSS that round-trips through any tool. This guide covers when to format vs minify, the SCSS-specific rules, and the gotchas with copied browser DevTools styles.

    Prettier CSS options that matter

    Option Default Notes
    printWidth 80 Affects wrapping of long selectors and value lists
    tabWidth 2 Standard for modern CSS; 4 for legacy stacks
    singleQuote false Strings in url() and content: values
    endOfLine “lf” “crlf” only for Windows-only repos
    Property sort off Optional — alphabetical, or by Idiomatic CSS groupings

    Prettier’s CSS formatter is deliberately small on options. Modern CSS toolchains add property sorting via separate plugins — stylelint-config-prettier + stylelint-order — rather than baking it into the formatter.

    SCSS, LESS, and PostCSS

    The same Prettier engine handles three preprocessor dialects:

    • SCSS: nested selectors, @mixin, @include, @if/@else, @function, dollar-prefixed variables. Indentation follows nesting depth.
    • LESS: mixins as classes, @variable syntax, guards. Slightly different rules than SCSS.
    • PostCSS: raw CSS plus plugin-specific syntax. Prettier formats whatever is valid CSS-AST — plugin syntax (e.g., @apply from Tailwind) passes through.

    Pick the parser explicitly when auto-detection fails. .scss file extension defaults to SCSS; .less defaults to LESS; .css defaults to plain CSS. Paste-mode without an extension defaults to plain CSS, which can produce odd output for SCSS code (mixin syntax becomes invalid CSS).

    How to format CSS in your browser

    1. Open the CSS formatter
    2. Paste your CSS or drop in a .css/.scss/.less file
    3. Pick the parser if auto-detect doesn’t catch it
    4. Adjust print width and indent style if needed
    5. Click Format — output appears with syntax highlighting
    6. Copy or download as .css

    Modern CSS that older formatters break

    Older CSS beautifiers (cssbeautify, online-beautify) corrupt several modern features:

    • Native nesting: .card { .title { color: red; } } — older formatters flatten or fail to parse. Prettier handles nesting correctly.
    • Container queries: @container (width > 400px) { … } — preserved with all syntax variants.
    • :has() selector: the parent selector is preserved without quote-mangling.
    • OKLCH and color-mix(): new colour formats pass through unchanged.
    • @layer: cascade layer ordering is preserved exactly — never reordered, since order has semantic meaning.
    • CSS custom properties: long fallback chains (var(--a, var(--b, red))) are preserved verbatim.

    Common gotchas

    • Tailwind utility class output is not formatted. Tailwind generates a flat list of single-rule classes; formatting won’t help. Format your custom CSS only — let Tailwind manage its own output.
    • DevTools “Copy all declarations” loses selectors. The clipboard gets color: red; padding: 8px; with no .btn { … } wrapper. Format won’t recover the selector — re-copy with the selector context.
    • Property order is preserved by default. CSS cascade-sensitive code relies on order for shorthand-then-override patterns (margin: 0; margin-top: 8px;). Don’t enable property sorting if you have that pattern.
    • SCSS @mixin formatting is opinionated. Prettier always inlines short mixin calls; long ones wrap. Your style guide may differ. Override locally with // prettier-ignore comments above specific blocks.
    • Don’t format minified CSS and re-deploy. Format your source files; let your build step minify the output. Formatted production CSS is 30% bigger and slower.
    • Older Prettier versions handle modern CSS poorly. Always use Prettier 3+ for native nesting, container queries, and the OKLCH colour space. Prettier 2.x will silently produce wrong output for these.

    When NOT to use a browser CSS formatter

    For a real codebase, install Prettier locally (npm i -D prettier), commit a .prettierrc, and let editors format on save. That eliminates style drift across collaborators. Use this browser tool for one-off snippets, copy-paste from CodePen / DevTools / AI assistants, third-party stylesheets you need to inspect, and quick previews of how Prettier would render styles in a project that doesn’t have it set up yet. For Stylelint integration, install stylelint-config-prettier alongside Prettier locally.

    Frequently asked questions

    Does this support SCSS, LESS, and PostCSS?

    Yes. Prettier 3 handles plain CSS, SCSS, LESS, and PostCSS. Auto-detection picks the parser from the file extension; you can override manually for paste-mode (file extension is unknown).

    Will the formatter sort my properties alphabetically?

    Not by default. Prettier preserves property order — important because some CSS relies on order for shorthand-then-override patterns. Property sorting is a separate Stylelint plugin (stylelint-order); install it locally if you want sorted output.

    Does it support modern CSS features like nesting and container queries?

    Yes. Prettier 3 handles native CSS nesting, container queries, :has(), @layer, OKLCH, color-mix(), and relative-colour syntax. Older formatters break these — always use Prettier 3+ for modern stylesheets.

    Can I unformat (minify) CSS with this tool?

    No — opposite operations. For minification, use the CSS Minifier. The typical pipeline: format while editing, minify before deploying.

    Is my CSS uploaded?

    No. Prettier runs in your browser via WebAssembly. Stylesheets never reach our servers — useful for proprietary or pre-release styles.

    Why does my SCSS look wrong after formatting?

    Most likely the parser was set to plain CSS instead of SCSS. SCSS-specific syntax (@mixin, @include, dollar variables) is invalid CSS. Switch the parser to SCSS and reformat.

    Related tools and guides