tailwindlabs / tailwindcss-custom-forms

A better base for styling form elements with Tailwind CSS.
https://tailwindcss-custom-forms.netlify.app/
MIT License
1.55k stars 72 forks source link

Form styles getting purged in production #45

Closed ajitbohra closed 5 years ago

ajitbohra commented 5 years ago

Versions:

Misc:

Details: Form styles are applied to inputs via @apply to WordPress generated fields. Form styles works perfect in dev but gets removed in prod.

adamwathan commented 5 years ago

Sounds like a purge configuration problem. Happy to help if you post your config, closing this though because this library doesn't do any purging and the problem can't be fixed by changing code in this repo.

ajitbohra commented 5 years ago

@adamwathan Using laravel-mix-purgecss with following config

if ( mix.inProduction() ) {
    mix.purgeCss( {
        folders: [ 'includes', 'src' ],
    } );
}

Applying form styles:

.components-text-control__input {
    @apply form-input;
}

.components-textarea-control__input {
    @apply form-textarea;
}