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.
Pick two images or colors and apply all 16 CSS mix‑blend‑mode values live. See and copy the right CSS for your design.
Type text and instantly see it rendered with text‑transform: uppercase, lowercase, capitalize, and full‑width. Copy CSS.
Design beautiful buttons with gradients, shadows, and hover/active effects. No JavaScript required. Copy the CSS.
Pick a COLRv1 color font and change its palette with font‑palette. Create custom palettes with @font‑palette‑values.
Build a custom CSS reset by toggling which elements to normalize. Copy the resulting stylesheet. Lean and clean.
Drag points to create a custom clip‑path shape. See the CSS value update live. For creating non‑rectangular elements.
Paste your SCSS or Sass code and compile it to standard CSS. Basic sass.js engine runs in your browser. No server.
Design a custom focus indicator with outline, offset, and box‑shadow. Preview on interactive elements. Copy the CSS.
Build a complete font‑stack for your website. Choose a primary font and get the best fallback options for different OS. Copy the CSS.
Browse a collection of common UI components (cards, modals, navbars) built with pure CSS. Preview and copy the HTML/CSS. Fast prototyping.
Paste CSS with vendor prefixes and get a clean version with only the standard property. Modernize your stylesheets.
Set perspective and rotate children in 3D space. See the effect of perspective‑origin. Copy the CSS. Learn 3D transforms.
Compile LESS code to plain CSS in your browser. Check for syntax errors and get clean output. For legacy projects.
Compile SCSS code to CSS directly in the browser using the official Sass.js library. Supports variables, mixins, nesting. No server upload required.
Design a modern button with gradients, shadows, and hover effects. Copy the clean CSS code.
Design a custom focus indicator with outline, offset, and box‑shadow. Preview on interactive elements. Copy the CSS.
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.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Pick an emoji and get the exact CSS content property value with escaped Unicode. For inserting emojis via CSS.
Design a fully styled scrollbar with colors, width, radius, and hover effects. Supports both ::-webkit‑scrollbar and Firefox scrollbar‑width.
Visually apply CSS transform functions like rotate, scale, skew, and translate. Obtain the exact CSS code for your elements. No coding needed.
Enter a URL and see a nested list of all headings (h1‑h6). Check your document structure for SEO and accessibility. Pure fetch.
Browse the fonts installed on your system and type a custom phrase to see how it looks. Uses Local Font Access API where available.
Toggle scroll‑behavior: smooth and click anchor links to see the scrolling animation. Implement modern UX.
Offline‑first search of the CanIUse database. Type a CSS property, HTML element, or API and see global support percentages. Fast.