Skip to content

Tailwind dynamic class not working #4491

Discussion options

You must be logged in to vote

Sounds like the dynamic classes may be getting purged by something like PurgeCSS. In your tailwind.config.js, do you have a purge section similar to this?

module.exports = {
    // ...

    purge: {
        content: [    
            './resources/**/*.antlers.html',
            './resources/**/*.blade.php',
            './content/**/*.md'
        ],
    }
}

If so, you should be able to exclude specific the bg- classes like so (tested with Cool Writings Starter Kit setup):

module.exports = {
    // ...

    purge: {
        content: [    
            './resources/**/*.antlers.html',
            './resources/**/*.blade.php',
            './content/**/*.md'
        ],
        options: {

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Sennik
Comment options

@duncanmcclean
Comment options

@Jerga99
Comment options

@jasonvarga
Comment options

Answer selected by Sennik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants