Skip to content

Using !important with @apply causes error when compiling sass files #467

@joe-reed

Description

@joe-reed

When using laravel-mix to compile .scss or .sass, the following code does not compile:

// main.scss
@tailwind preflight;
@tailwind components;

.example-component {
  @apply .text-black !important;
}

@tailwind utilities;

Gives the error:

Invalid CSS after "...ply .text-black": expected "}", was "!important;"

I have created a repository with full instructions on how to reproduce:
https://github.com/kiteframe/tailwind-important-sass

The issue does not occur when using a .less file and mix.less().

Thank you for all your hard work with Tailwind!

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