Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nyarikikaruma@gmail.com's avatar

Preventing a component from accepting global styles in vue Js 3 or Nuxt js

I have a component which I want to prevent from accepting global styles. I have tried using scoped on the component but it does not work.

I tried using scoped style, and I was expecting that apart from preventing my component styles to be globally accessible, it will also prevent my component from accessing global variable. But this seems not to be working.

0 likes
2 replies
frutality's avatar
Level 1

That is not possible AFAIK. Scoped styles are "one way": they make your styles local to prevent one component to affect others.

And global styles, well, stays global.

Please or to participate in this conversation.