Giter VIP home page Giter VIP logo

Comments (9)

RobinMalfait avatar RobinMalfait commented on June 28, 2024 7

Hey! Thank you for your issue!
Much appreciated! 🙏

If you want to override the full typography plugin than you can put it directly in the theme.typography section:

https://play.tailwindcss.com/cIbKOcLoO9?file=config

module.exports = {
  theme: {
    typography: {
      DEFAULT: {
        css: {
          pre: {
            backgroundColor: 'hotpink',
          },
        },
      },
    },
  },
  variants: {},
  plugins: [require('@tailwindcss/typography')],
}

Notice that nothing "exists" except for the new styles on the pre tag.


If you want to keep most of it, but "remove" some of the parts, then you can put the code inside theme.extend.typography and mark some sections with null:

https://play.tailwindcss.com/2ZyvC8cj9g?file=config

module.exports = {
  theme: {
    extend: {
      typography: {
        DEFAULT: {
          css: {
            pre: null
          },
        },
      },
    },
  },
  variants: {},
  plugins: [require('@tailwindcss/typography')],
}

Notice that everything of the typography styles still exist, except for the pre related styles.


Hope this helps!

from tailwindcss-typography.

csenio avatar csenio commented on June 28, 2024 4

Same issue, for my use case I need to keep the reset on pre blocks as I'm using prismjs for highlights

from tailwindcss-typography.

jacobdalamb avatar jacobdalamb commented on June 28, 2024 4

why is this still an issue... it's normal css just put textDecoration: none;

It's not that easy. It is polluting your CSS for no reason with an extra statement that could be avoided.

We would prefer clean code, that contains as little overridden statements as possible 🙃

One: it's pretty easy. and Two: it's in your config so I don't know how it would be polluting your CSS

from tailwindcss-typography.

mattradford avatar mattradford commented on June 28, 2024 3

Same sort of issue for me: I'm using a descendant selector to target children of .prose, and need to allow some wide and full width components. This is where setting width to 65ch doesn't work, as larger text such as headings have a wider width. Using .max-w-none isn't helpful as then I need to override both .prose and .max-w-none.

So really I'd just like to set the max-width for prose myself. Thanks.

from tailwindcss-typography.

alex-jitbit avatar alex-jitbit commented on June 28, 2024 2

@RobinMalfait

If you want to keep most of it, but "remove" some of the parts, then you can put the code inside theme.extend.typography and mark some sections with null:

It would be awesome if you put this into the docs. It took me a while to find this issue.

from tailwindcss-typography.

StevenGFX avatar StevenGFX commented on June 28, 2024 1

Same sort of issue for me: I'm using a descendant selector to target children of .prose, and need to allow some wide and full width components. This is where setting width to 65ch doesn't work, as larger text such as headings have a wider width. Using .max-w-none isn't helpful as then I need to override both .prose and .max-w-none.

So really I'd just like to set the max-width for prose myself. Thanks.

@mattradford I set a max-width on the .prose class with the following:

module.exports = {
  typography: {
    default: {
      css: {
        maxWidth: '65ch',
      },
    },
  },
  plugins: [
    require('@tailwindcss/typography'),
  ],
}

from tailwindcss-typography.

mattradford avatar mattradford commented on June 28, 2024

Hey thanks @StevenGFX, very helpful 👍

from tailwindcss-typography.

jacobdalamb avatar jacobdalamb commented on June 28, 2024

why is this still an issue... it's normal css just put textDecoration: none;

from tailwindcss-typography.

axe312ger avatar axe312ger commented on June 28, 2024

why is this still an issue... it's normal css just put textDecoration: none;

Its not that easy. It is polluting your CSS for no reason with an extra statement that could be avoided.

We would prefer clean code, that contains as little overridden statements as possible 🙃

from tailwindcss-typography.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.