CSS Container Query Tester - Online @container Playground
Experiment with CSS container queries. Resize a container and see the styles change according to its size, not the viewport. Learn the new spec.
UD5 Toolkit
Interactive @container rule tester â drag to resize & see container queries in action
@container rule, you can create truly reusable, context-aware components that adapt to any layout slot. First define a containment context with container-type: inline-size on the parent, then write @container (min-width: 400px) { ... } to apply styles when the container meets the condition.container-type: inline-size creates a containment context that tracks the element's inline dimension (width in horizontal writing modes). This is the most common setting and sufficient for most use cases. Other values: size tracks both width and height, normal disables containment (default). Using inline-size is preferred for performance since it only monitors one axis.container-name assigns a name to your containment context, letting you target a specific container in nested layouts. Example: container-name: sidebar on the parent, then @container sidebar (min-width: 300px) { ... } targets only that container. Without a name, @container queries the nearest ancestor with a containment context. Named containers prevent ambiguity in complex nested structures.@supports (container-type: inline-size) to provide fallback styles or polyfill with JavaScript.@container rules with different breakpoints â just like media queries. For example, you might have rules for max-width: 350px, min-width: 350px and max-width: 600px, and min-width: 600px to create three distinct layout tiers. The most specific matching rule applies, following standard CSS cascade principles.container-type: inline-size has minimal overhead. However, container-type: size (tracking both axes) requires more computation. Best practices: only apply containment to elements that need it, prefer inline-size over size when possible, and avoid deeply nested container queries (grandparent + parent + child all having containment) unless necessary.cqw (1% of container width), cqh (1% of container height), cqmin, and cqmax. These work like viewport units (vw, vh) but are relative to the container, not the viewport. For example, font-size: 5cqw makes text scale with the container's width â incredibly useful for fluid component typography.Experiment with CSS container queries. Resize a container and see the styles change according to its size, not the viewport. Learn the new spec.
Dynamically blend two colors using the CSS colorâmix() function in different color spaces. Copy the exact CSS snippet. No JS required.
Build the same layout with both Grid and Flexbox side by side. See the code differences and visual results.
Preview any website inside emulated device viewports (iPhone, iPad, various resolutions). No screenshot, live interaction in an iframe. Local tool.
A replica of the famous Flexbox Froggy game: solve alignment puzzles by writing CSS. Progress saved locally. Fun frontend learning.
Enter a URL and drag a slider to change the viewport width smoothly. See exactly where your layout breaks. No iframe limits.
Add grid items beyond defined tracks and see how implicit rows/columns expand. Set sizes interactively. Master the grid.
Grid of all 148 named CSS colors. Hover to see detail, click to copy the name or hex. Essential frontend reference.
Paste a list of hex colors and generate CSS custom properties for them. Create your design token file instantly.
Design a light and dark theme by picking colors for backgrounds, text, and links. Get the CSS for both themes. Local.
Fetch a website's CSS and extract :root custom properties (ââcolor) to reveal its design token palette. For learning and inspiration.
Enter a component name and generate a complete RTL test file with render, screen, and common assertions. Fast testing setup.
Style an `<input type='range'>` with custom track and thumb. Crossâbrowser CSS. Preview and copy the code.
Set a custom accent color for checkboxes, radios, range, and progress. See the browserâs rendering. Copy the CSS.
Enter a palette of colors and see a grid showing whether each foreground/background pair passes AA or AAA contrast. Must for designers.
Pick a color in the DisplayâP3 space and get the CSS color() function. See the difference from sRGB. For modern design.
Create a pure HTML/CSS accordion using <details> elements. Add custom styling and get the clean code. No JavaScript required.
Paste a stylesheet and extract every unique color (hex, rgb, hsl) into a palette. Swatches displayed. Copy as JSON.
Match gap size around doors/windows to the correct type of weather stripping (foam, V-strip, door sweep). Save energy.
Type a CSS color name like 'tomato' or 'mediumseagreen' and instantly get its hex code and preview. Complete named colors list.
Pick a base color and generate a full palette of 10 shades (50 to 900) like Tailwind CSS. Copy as hex or hsl.
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.
Test the upcoming contrastâcolor() CSS function. Get white or black automatically for a given background. See it live.
Use the lightâdark() CSS function to change colors based on color scheme. Build a simple dark mode toggle with one property.
Scramble letters of any word or sentence to create anagrams. Great for brain teasers and vocabulary games. Simple, fun, and client-side.
Use <input type='color'> and see its change events and value in hex. Understand the native color picker. Quick demo.
Paste body text and test different font/background combos. See an actual passage rendered, not just a ratio. True feel for legibility.
Unscramble jumbled letters to form words. Timed challenge mode with hints. Compares against built-in dictionary. Improve vocabulary while having fun.
See the Pantone Colors of the Year and popular palettes from past years. Get hex codes. Design inspiration.
Browse every Tailwind default color palette side by side. Click any shade to copy the hex or class. For rapid design.