Skip to content

Tailwindcss-Typography with classes #2510

Answered by JNavith
Nick-Mazuk asked this question in Help
Discussion options

You must be logged in to vote

In this example, you've already enabled the experimental applyComplexClasses feature, so making .prose h1 take on .h1's styles is about this much work:

module.exports = {
  theme: {
    typography: {
      default: { // you omitted this
        css: {
          h1: {
            '@apply h1': '',
            // https://github.com/tailwindlabs/tailwindcss-typography/blob/master/src/styles.js#L69-L70
            color: false, // remove the default text color
            fontWeight: false, // remove the default font weight
          },
          // ...
        },
      },
    },
  },
  // ...
};

Hope this helps.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Nick-Mazuk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants