Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Scoped CSS lets you [...]

Scoped CSS doesn't seem to be a feature of CSS. The "scoped" attribute shown in his example apparently existed in some browsers a decade ago and has since been removed.

I guess maybe it's a Vue template feature that happens to reuse the same syntax?



It's in Vue, and surface ui. There's also a pending @scope keyword coming to CSS in the near future.

I'd expect most component frameworks to have some equivalent version of this. In svelte, it's the default; all style tags written inside a component are scoped to said component.

You can largely achieve scoping manually if you have to, via nesting, which recently landed in CSS.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: