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.
Pick two images or colors and apply all 16 CSS mix‑blend‑mode values live. See and copy the right CSS for your design.
Write CSS like `oklch(from red l c h)` to modify colors. Preview the output and copy. Modern color manipulation.
Pick a COLRv1 color font and change its palette with font‑palette. Create custom palettes with @font‑palette‑values.
Write CSS like `oklch(from red l c h)` to modify colors dynamically. Preview the output and copy the code.
Type text and instantly see it rendered with text‑transform: uppercase, lowercase, capitalize, and full‑width. Copy CSS.
Set up Stylelint rules for your project by selecting extensions (SCSS, order, etc.). Output a valid .stylelintrc.
Design beautiful buttons with gradients, shadows, and hover/active effects. No JavaScript required. Copy the CSS.
Drag points to create a custom clip‑path shape. See the CSS value update live. For creating non‑rectangular elements.
Set perspective and rotate children in 3D space. See the effect of perspective‑origin. Copy the CSS. Learn 3D transforms.
Browse a collection of common UI components (cards, modals, navbars) built with pure CSS. Preview and copy the HTML/CSS. Fast prototyping.
Style the <progress> and <meter> elements with cross‑browser CSS. Adjust colors and sizes. Copy the final styles.
Visually create beautiful linear and radial gradients. Get the CSS code instantly. Copy the code or export as image. Perfect for web designers.
Visually apply CSS transform functions like rotate, scale, skew, and translate. Obtain the exact CSS code for your elements. No coding needed.
Write modern CSS color functions like oklch(), lab(), hwb() and see the rendered color with fallback. Copy compatible code.
Choose from a dozen pure CSS loading spinners. Customize color, size, and speed. Copy the HTML & CSS. No JavaScript needed.
Paste your SCSS or Sass code and compile it to standard CSS. Basic sass.js engine runs in your browser. No server.
Build CSS Grid layouts by defining columns, rows, and gaps visually. Get the complete grid CSS code. An essential web design tool running in the browser.
Compile SCSS code to CSS directly in the browser using the official Sass.js library. Supports variables, mixins, nesting. No server upload required.
Add multiple CSS filters (grayscale, blur, hue‑rotate) to an image. See the combined effect. Copy the CSS filter value.
Toggle between normal, nowrap, pre, pre‑wrap, and pre‑line to understand how whitespace is handled. Live text example.
Create circular and elliptical clip paths visually. Adjust radius and position. Copy the CSS. For avatars and masks.
Toggle common print styles: remove backgrounds, hide elements, set page margins, and add page breaks. Get the complete @media print block.
Create gradient‑filled text with the background‑clip property. Choose linear or radial gradients. Get the CSS. Modern typography.
Minify JavaScript and CSS code to reduce file size for production. Remove whitespace and comments instantly. Run locally, your code stays private.
Add rows and columns, merge cells, and set gaps visually. Get the grid‑template CSS and HTML. Fast layout prototyping.
Set column‑count, gap, and rule, and see a multi‑column text layout. Copy the minimal CSS. For magazine designs.
Create a multi‑column text layout with adjustable column count, gap, and rule. Copy the CSS. Elegant reading experience.
Pick an emoji and get the exact CSS content property value with escaped Unicode. For inserting emojis via CSS.
Compile LESS code to plain CSS in your browser. Check for syntax errors and get clean output. For legacy projects.