Color Swatch to CSS - Online Palette to Variables
Paste a list of hex colors and generate CSS custom properties for them. Create your design token file instantly.
UD5 Toolkit
Instantly extract, list, and export all :root CSS custom properties from any stylesheet
:root variables)?
-- prefix (e.g., --main-color: #333). When declared inside the :root pseudo-class, they become globally available throughout the entire stylesheet. They allow for dynamic, reusable values that can be updated in real-time via JavaScript, making them essential for modern web design, theming, and responsive layouts.
:root for defining CSS variables?
:root pseudo-class targets the highest-level element in the DOM (the <html> element). Defining your custom properties there ensures maximum inheritance scope — every descendant element can access them. This is the standard convention for design tokens, theme colors, font stacks, and spacing scales. It also keeps your variable definitions centralized and easy to maintain.
:root blocks. You can either paste raw CSS directly into the text area or fetch CSS from a publicly accessible URL. Note that for URL fetching, CORS (Cross-Origin Resource Sharing) policies may block some requests. If that happens, simply copy the CSS source manually and paste it into the tool.
$var or LESS @var), CSS custom properties are live in the browser. They can be accessed and modified at runtime using JavaScript (element.style.setProperty()), respond to media queries, and cascade through the DOM. Preprocessor variables are compiled away and become static values. CSS variables bring dynamic capability directly into the browser's rendering engine.
:root blocks?
:root blocks define the same variable (e.g., in different @media queries or theme variants like :root[data-theme="dark"]), CSS cascade rules apply — the last declaration wins. This tool collects all unique variable names and displays the final resolved value from the last parsed :root block. If you need to analyze all theme variants, consider parsing each block separately.
:root block), download them as a .css file, or export them as JSON for programmatic use. The JSON format is especially useful for design system tooling, documentation generators, or integrating with JavaScript frameworks that consume design tokens.
#fff, #1a2b3c), RGB/RGBA, HSL/HSLA, HWB, LAB, LCH, OKLAB, OKLCH, and color-mix() formats. It also recognizes over 140 named CSS colors (like tomato, teal, gold). A small color swatch appears next to each detected color value, giving you instant visual feedback.
Paste a list of hex colors and generate CSS custom properties for them. Create your design token file instantly.
Fetch a website's CSS and extract :root custom properties (‑‑color) to reveal its design token palette. For learning and inspiration.
Customize Bootstrap 5 variables visually. See the live preview. Download the generated SCSS or CSS file.
Grid of all 148 named CSS colors. Hover to see detail, click to copy the name or hex. Essential frontend reference.
Design a light and dark theme by picking colors for backgrounds, text, and links. Get the CSS for both themes. Local.
Paste a stylesheet and extract every unique color (hex, rgb, hsl) into a palette. Swatches displayed. Copy as JSON.
Enter a CSS selector and see its specificity broken down into A,B,C columns with a visual weight comparison. Learn specificity.
A complete, searchable list of all 140+ named HTML/CSS colors with their hex codes and color previews. Click to copy code. Essential web reference.
Type a CSS color name like 'tomato' or 'mediumseagreen' and instantly get its hex code and preview. Complete named colors list.
Write modern CSS color functions like oklch(), lab(), hwb() and see the rendered color with fallback. Copy compatible code.
Style the <progress> and <meter> elements with cross‑browser CSS. Adjust colors and sizes. Copy the final styles.
Experiment with CSS container queries. Resize a container and see the styles change according to its size, not the viewport. Learn the new spec.
Style an `<input type='range'>` with custom track and thumb. Cross‑browser CSS. Preview and copy the code.
Mix and save colors using a color picker. Drag to reorder. Export as CSS variables or hex list.
Pick a color in the Display‑P3 space and get the CSS color() function. See the difference from sRGB. For modern design.
Design custom radio buttons and checkboxes using pure CSS. Choose sizes, colors, and animation. Copy the code.
Find the official name of any hex color from the extended color dictionary. Search by name to get the hex code. Handy for CSS and design language.
Interactively create colors in HWB space and get the CSS hwb() function. Simplifies tint/shade workflows. Live preview.
Dynamically blend two colors using the CSS color‑mix() function in different color spaces. Copy the exact CSS snippet. No JS required.
Set a custom accent color for checkboxes, radios, range, and progress. See the browser’s rendering. Copy the CSS.
Pick a source color and generate a complete M3 tonal palette with light/dark schemes. Export as CSS custom properties.
See the Pantone Colors of the Year and popular palettes from past years. Get hex codes. Design inspiration.
Start with a base color and generate an extended palette where every shade contrasts properly with white and black. Export tokens.
Match gap size around doors/windows to the correct type of weather stripping (foam, V-strip, door sweep). Save energy.
Use the light‑dark() CSS function to change colors based on color scheme. Build a simple dark mode toggle with one property.
Add grid items beyond defined tracks and see how implicit rows/columns expand. Set sizes interactively. Master the grid.
Generate a range of tints and shades from a single hex color. Ideal for data visualization, UI design systems, and Tailwind custom palette creation. Local tool.
Pick a base color and generate a full palette of 10 shades (50 to 900) like Tailwind CSS. Copy as hex or hsl.
Pick colors using the HWB (Hue‑Whiteness‑Blackness) model. Get the CSS hwb() function code. Simpler than HSL for some.
Enter color in any CSS format and see all other representations. Live preview. Swatch history.