Skip to content

How to output specific classnames #865

Answered by cossssmin
boskakke asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there, you can do it with a couple changes to config files.

  1. .container is a class generated by Tailwind CSS, so you need to first disable it in tailwind.config.js:

    module.exports = {
      // ...
      corePlugins: {
        // ...
        container: false,
      },
    }
  2. Next, you need to whitelist the .container class in removeUnusedCSS in your config.production.js, so that it isn't purged when you build for production:

    module.exports = {
      // ...
      removeUnusedCSS: {
        whitelist: ['.container'],
      },
    }

Now you can simply write <table class="container"> and it will be preserved in the compiled HTML.

Works in both v4.3.1 and the latest beta of Maizzle.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@boskakke
Comment options

@cossssmin
Comment options

Answer selected by boskakke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants