TailwindCSS `@apply` cannot be used with `.table-collapse`

Posted 4 months ago by mostafalaravel

Hello ,

I try to make a css class based on tailwindCSS.

here my CSS part :

...
    .participation-table{
        @apply .w-auto .text-left .table-collapse;
    }
</style>

I try to use it on my template :

template>
    <div class="overflow-x-scroll">
        <table class="participation-table">
            <thead>
            <tr>
...

This is the error :


(239:5) `@apply` cannot be used with `.table-collapse` because `.table-collapse` either cannot be found, or its actual definition includes a pseudo-selector like :hover, :active, etc. If you're sure that `.table-collapse` exists, make sure that any `@import` statements are being properly processed *before* Tailwind CSS sees your CSS, as `@apply` can only be used for classes in the same CSS tree.

Please sign in or create an account to participate in this conversation.