Skip to content

bug: any soft or outline variants cannot be used in a @apply statement #122

Description

@kimu

What version of FlyonUI are you using?

v2.4.1

Which browsers are you seeing the problem on?

All browsers

Reproduction URL

N/A

Describe your issue

In a css file or <style> section, using any -soft, -outline variant make Vite throw an error when using @apply.

Any of these two approaches,

@layer base {
    p {
        @apply alert alert-info;
    }
}
.custom-class {
    @apply alert alert-info;
}

works fine.

When a -soft or -outline variant is used

@layer base {
    p {
        @apply alert alert-soft alert-info;
    }
}

.custom-class {
    @apply alert alert-soft alert-info;
}

the error "Cannot apply unknown utility class alert-soft" is thrown.

This happens with classes like badge-soft, alert-soft, alert-outline, etc.

I have a tested a few other utilities but I cannot find any other one that fails.

When the same utility classes are used directly in a HTML element, there are no issues.

<div class="alert alert-soft alert-info">some text</div>

works just fine.

P.S: I cannot provide a link, as all you would see is the error. I cannot even build the app because of this error.
The only way to show it to you would be deploying the development environment somewhere, which it's not possible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions