Is there a way to disable Tailwind's Preflight on a specific div or component? For example a WYSIWYG editor, or wanting to migrate gradually to Tailwind.
Is there a way to disable Tailwind's Preflight on a specific div or component? For example a WYSIWYG editor, or wanting to migrate gradually to Tailwind.
Search about 'unreset tailwind'.
https://www.swyx.io/tailwind-unreset/
download file unreset.scss from https://raw.githubusercontent.com/ixkaito/unreset-css/master/_unreset.scss
copy it over to your tailwind.scss and namespace it under an unreset class.
.unreset { // paste unreset.scss here! }
div className="unreset" dangerouslySetInnerHTML={{ __html: post.contents }}
As far as i know it will always load the ui if can find similar classes. Some solution can be
I believe the optimal method, if you're using it for basic markdown is to use the the @tailwind/typography package which will allow tags such as <h6> <b> etc...
npm i @tailwindcss/typographyrequire("@tailwindcss/typography") to your plugins in tailwind.config.jsprose prose-lg<div className="prose prose-lg" dangerouslySetInnerHTML={{ __html: markdownDesc }} />
Found this method in a article here: https://tjaddison.com/blog/2020/08/updating-to-tailwind-typography-to-style-markdown-posts/
Another option is:
.element-selector {
all: revert;
}
all can set all properties of the element to the initial, inherit or revert value.
More info here: https://developer.mozilla.org/en-US/docs/Web/CSS/all