简体   繁体   中英

Override 65ch max-width in Tailwind CSS Typography

I am using a Jekyll template with Tailwind and Typography, and I am interested in overriding the default max-width 65ch limit on each line.

The default setting was max-w-prose , and I have tried setting max-w-none to the parent element, along with prose , but it doesn't seem to work (although it messes with the alignment). I have also tried setting the max-w-none with prose in every element (wary of unwanted overrides to 65ch) but this also isn't cutting it.

I am thinking this could be done via the tailwind.config.js file, like:

  theme: {
    extend: {
      typography: {
        DEFAULT: {
          css: {
            'prose': {
              'max-width': '100ch'
            },
            'max-w-prose': {
              'max-width': '100ch'
            },
        ...

but I can't figure it out. Any tips are super welcome!

This is default .prose CSS properties so typography config should be like this

module.exports = {
  theme: {
    extend: {
      typography: {
        DEFAULT: {
          css: {
            maxWidth: '100ch', // add required value here
          }
        }
      }
    },
  },
  plugins: [
    require('@tailwindcss/typography'),
  ],
}

DEMO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM