@layer Priority Tester - Online Cascade Layer Order
Define multiple @layer blocks and see which styles win. Understand layer order and revertâlayer. Modern CSS architecture.
UD5 Toolkit
Visually explore how CSS cascade layers, specificity, and !important interact in real-time.
No rules yet.
Click "Add Rule" or choose a preset above.
Add rules to see the cascade stack.
!important raises a declaration to a higher priority tier. Within the author origin, !important declarations beat all normal declarations regardless of specificity or layer. Crucially, !important reverses the layer order: in normal styles, later layers win; in !important styles, earlier layers win. Unlayered !important styles have the highest priority of all author styles. This reversal often surprises developers.@layer lets you define explicit cascade layers, giving you control over which styles take precedence regardless of specificity. This is especially useful in large projects where you want to ensure your base styles are overridden by component styles, which are overridden by utility styles. Layers make specificity management much easier and reduce the need for !important hacks.#demo-box = (1,0,0), .demo-box = (0,1,0), div.demo-box = (0,1,1). Higher values win when layers and importance are equal. Inline styles beat all selectors, but can be overridden by !important.!important is meant to signal "this is critically important and should not be easily overridden." Reversing the layer order for !important means that foundational/base layers get the strongest !important protection, preventing later layers from accidentally overriding critical declarations with their own !important rules. It encourages putting essential !important overrides in earlier (more foundational) layers.@layer) have higher priority than all layered normal styles, regardless of specificity. This means unlayered styles will always override layered normal styles. For !important, unlayered !important styles have the absolute highest priority of all author-origin styles. This is why many developers place third-party CSS in layers to ensure their own unlayered styles can easily override them.@layer is supported in all modern browsers: Chrome 99+, Firefox 97+, Safari 15.4+, and Edge 99+. It's safe to use in production for most projects today. For older browsers, layered styles degrade gracefullyâthey simply behave like unlayered styles, and the cascade falls back to specificity and source order.Define multiple @layer blocks and see which styles win. Understand layer order and revertâlayer. Modern CSS architecture.
Nest elements in 3D space with preserveâ3d vs flat. Rotate the parent and see children behave differently.
Apply smooth color gradients to text with a live preview. Generates crossâbrowser CSS including the webkitâbackgroundâclip property.
Enter a URL and apply a custom CSS grid overlay to check alignment. A quick frontend design tool for verifying column placement and baseline grids.
Choose where page breaks should occur for printing. Get the breakâbefore, breakâafter, and breakâinside CSS.
Control imageâorientation: from-image vs none. See how the browser interprets EXIF rotation. Fix portrait photos.
Create a pure CSS scroll progress indicator using animationâtimeline: scroll(). No JavaScript. Copy the complete code.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Scroll a container and see how sticky elements behave. Adjust top, bottom, and scroll margins. Copy the code.
New CSS textâspacing property for fine control over punctuation spacing. See the effect live. For advanced typography.
Load any variable font from Google Fonts or local file and play with weight, width, slant, and custom axes. Download CSS.
Browse the fonts installed on your system and type a custom phrase to see how it looks. Uses Local Font Access API where available.
Apply userâselect: none, text, all and see how it affects selection. Copy the CSS snippet for your UI elements.
Limit browser gestures on an element: panâx, pinchâzoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Toggle scrollbarâgutter: stable to reserve space for the scrollbar and avoid content jumps. Visual demo with two columns.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS textâdecoration.
Build a 3D rotating cube using pure CSS. Set dimensions, colors, and animation speed. Copy the HTML and CSS.
Design a button or card that glows on hover. Adjust shadow color, spread, and transition. Copy the CSS. Rich UI.
Type a CSS color name like 'tomato' or 'mediumseagreen' and instantly get its hex code and preview. Complete named colors list.
Create a realistic letterpress (debossed) text effect using CSS textâshadow and background. Adjust depth and light direction. Copy code.
Generate a subtle noise/grain texture as a CSS background pattern. Adjust opacity and size. For that film look.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
Create a pure CSS countdown timer with a flipping number effect. Adjust duration and style. No JavaScript needed for display.
Create a rainbow gradient text animation using pure CSS. Customize speed and colors. Copy the code for your website.
Upload a small image and generate the CSS code for a custom cursor. Test it live on the page. Tiny but useful.
A replica of the famous Flexbox Froggy game: solve alignment puzzles by writing CSS. Progress saved locally. Fun frontend learning.
Browse and search all Font Awesome 6 icons with preview, class name, and unicode. Copy the HTML snippet. Perfect for web developers.
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.
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.
Design layered box shadows interactively and get the CSS code in real time. Adjust offset, blur, spread, and color. Essential tool for UI designers.