CSS Modules Class Name Generator - Online Scoped Styles
Write global CSS and auto‑generate unique, scoped class names with source maps. Understand CSS Modules naming.
UD5 Toolkit
@scope 规则。该特性在 Chrome 118+、Edge 118+ 中可用。如预览中样式未按预期隔离,请切换至支持的浏览器查看完整效果。
@scope,预览效果将完整展示作用域隔离。
@scope (selector) { /* 规则 */ },其中selector定义了作用域的根元素。在作用域内部,:scope 伪类指向作用域根元素本身。这是原生CSS中实现真正样式封装的重要一步。
@scope (start) to (end) 语法定义了一个作用域区间。样式从匹配 start 选择器的元素开始生效,到匹配 end 选择器的元素(及其后代)之前结束。这在限定文章内容区域(例如从正文开始到评论区之前)时非常有用。区间内的同级元素及其后代都会受到作用域影响,而 end 选择器匹配的元素及其后代则被排除在外。
@layer components { @scope (.card) { ... } } 可以创建一个低优先级、仅作用于卡片内部的样式层。
:scope 伪类始终指向作用域根元素(即 @scope 选择器匹配的元素)。例如 @scope (.card) { :scope { border: 2px solid blue; } } 会为每个 .card 元素本身添加蓝色边框,而不会影响页面中其他元素。这与 JavaScript 的 querySelectorAll 中的 :scope 行为一致。
Write global CSS and auto‑generate unique, scoped class names with source maps. Understand CSS Modules naming.
Write CSS like `oklch(from red l c h)` to modify colors. Preview the output and copy. Modern color manipulation.
Set up Stylelint rules for your project by selecting extensions (SCSS, order, etc.). Output a valid .stylelintrc.
Write CSS like `oklch(from red l c h)` to modify colors dynamically. Preview the output and copy the code.
Design a layout where nested grids share track sizes with their parent via subgrid. Copy the complete CSS.
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.
Limit browser gestures on an element: pan‑x, pinch‑zoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Create complex linear gradients with any number of color stops, exact angles, and length units. Live preview and CSS code.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Generate a random HTML/CSS card with different box model properties. Inspect and guess the size. For learners.
Design a button or card that glows on hover. Adjust shadow color, spread, and transition. Copy the CSS. Rich UI.
Create a realistic letterpress (debossed) text effect using CSS text‑shadow and background. Adjust depth and light direction. Copy code.
Experiment with CSS container queries. Resize a container and see the styles change according to its size, not the viewport. Learn the new spec.
Paste your CSS and sort the properties of each rule alphabetically or by concentric groups. Keep your stylesheets consistent without a build step.
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.
Upload two images and apply CSS blend modes (multiply, screen, overlay, etc.). See the result and copy the filter CSS. Pure frontend.
Add print styles like removing backgrounds, adding page breaks, setting margins. See print preview instantly.
Create a pure CSS countdown timer with a flipping number effect. Adjust duration and style. No JavaScript needed for display.
Paste HTML/CSS snippets or enter properties to test how z‑index and stacking contexts interact. Real‑time example.
Create a glowing or rotating border animation around an element. Copy the CSS keyframes. Pure CSS magic.
Create a custom HTML/CSS progress bar with percentage, colors, and animation. Copy the code. Modern UI element.
Design a realistic neon sign text with multiple layers of glow. Copy the CSS and HTML. Perfect for headers.
A replica of the famous Flexbox Froggy game: solve alignment puzzles by writing CSS. Progress saved locally. Fun frontend learning.
Fetch a website's CSS and extract :root custom properties (‑‑color) to reveal its design token palette. For learning and inspiration.
Recreate the target CSS linear gradient by adjusting stops and colors. A unique game for front‑end developers to master gradients.
Browse and search all Font Awesome 6 icons with preview, class name, and unicode. Copy the HTML snippet. Perfect for web developers.
Create text with a gradient fill using CSS background-clip. Configure colors and direction. Copy the code. Works in modern browsers.
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.