Skip to content

SCSS @import directives nested inside @layer are not tracked #4838

Closed
@makkarpov

Description

@makkarpov

What version of Tailwind CSS are you using?

v2.2.4

What build tool (or framework if it abstracts the build tool) are you using?

Nuxt with @nuxtjs/tailwindcss

What version of Node.js are you using?

v14.16.1

What browser are you using?

N/A

What operating system are you using?

Linux

Reproduction repository

https://github.com/makkarpov/tailwind-dep-repro

Describe your issue

SCSS loses track of dependencies when @import statements are embedded within @layer ... { ... } directive. Change of imported file does not trigger recompilation of the style, and as a result nothing is changed in actual output.

If you have SCSS organized like this

main.scss:

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
  @import 'inner';
}

_inner.scss:

.test { @apply anything; }

then changes in _inner.scss won't be picked by HMR, requiring change in main.scss to trigger recompilation process. This greatly hinders development, requiring any nested change to be followed by change of root file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions