3 ms·
Is scoped CSS different from CSS in Js? Sorry for the noob question.
by InGodsName 8y ago
Is scoped CSS different from CSS in Js?
Sorry for the noob question.
- tracker1 8y agoYes, all CSS operates via selectors... scoping generally means applying a className to a component, and then generating all CSS for children relative to that. The issue at play is when you start nesting, or using components together, and child naming blows up. .myComponent is fine... but when you have: .myComponent button { ... } .myComponent .x and then you have conflicting rules, and your css gets overridden in unexpected ways. with JSS, the tooling can generate unique component selectors, and since it's all generated at a component level, you have less risk of applying conflicts.