Skip to content

SFCs with scoped CSS don't style img/source in <nuxt-picture> #320

Description

@LukaHarambasic

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.

Steps to reproduce

<nuxt-picture
      class="image"
      :src="post.image"
      :alt="post.alt"
      sizes="xs:200px md:500px lg:1024"
/>
<style lang="sass" scoped>
  .image
    margin: 0 0 2rem 0
    width: 100%
    display: block
    source, img
      border-radius: $border-radius
      width: 100%
      min-height: 16rem
</style>

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions