🍋
Menu
CSS

CSS Scope

CSS @scope Rule

A rule that limits style application to a specific DOM subtree, preventing styles from leaking in or out.

التفاصيل التقنية

CSS css scope is part of the CSS specification maintained by the W3C CSS Working Group. Browser rendering engines (Blink, WebKit, Gecko) implement the specification through their layout and paint pipeline stages. Understanding the rendering pipeline — Style → Layout → Paint → Composite — is key to writing performant CSS. Properties that trigger layout recalculation (width, height, margin) are more expensive than those that only trigger compositing (transform, opacity).

مثال

```css
/* Example: CSS Scope */
.element {
  /* Apply css scope to this element */
  display: block;
  margin: 0 auto;
}
```

صيغ ذات صلة

أدوات ذات صلة

مصطلحات ذات صلة