You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm currently migrating to nuxt-image and I found a small problem with scoped CSS. Not a big one, I just removed scoped and "scoped" it with a class (see here). It would be nice if I still could use scoped. I'm not even sure if that's something nuxt-image can fix. Might be linked to #288.
You can usually fix this in your Nuxt components <styles> directly using the deep selector.
Nuxt/Vue 2 Scss:
::v-deepimg {
/* styles here */
}
Nuxt/Vue 2 Postcss or regular css:
>>> img {
/* styles here */
}
Vue 3:
::v-deep(img) {
styles
}
I very rarely use sass so hopefully that works like:
::v-deep img/* styles */
I'm not sure exactly how scoped css is parsed, but I've run into this need in Nuxt many times. I think the concept is that the scoped css belongs only to your component, and the internal DOM that is created by <nuxt-img> in this case is another component. To style it scoped from your parent you need the deep selector.
Hi,
I'm currently migrating to nuxt-image and I found a small problem with scoped CSS. Not a big one, I just removed
scoped
and "scoped" it with a class (see here). It would be nice if I still could usescoped
. I'm not even sure if that's something nuxt-image can fix. Might be linked to #288.Steps to reproduce
Expected result
<source>
&<img>
are styled when<style lang="sass" scoped>
is used.Actual result
<source>
&<img>
are not styled when<style lang="sass" scoped>
is used.Thanks a lot for this nice package <3
The text was updated successfully, but these errors were encountered: