Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tailwindcss/typography integration #242

Open
acanturk1 opened this issue Oct 15, 2023 · 1 comment
Open

tailwindcss/typography integration #242

acanturk1 opened this issue Oct 15, 2023 · 1 comment

Comments

@acanturk1
Copy link

I could not integrate Tailwind CSS with MarkdownPreview.

I am trying to provide a style from TailwindCSS for each heading. It works fine when add the html manually or another markdown editor, but when it is provided via MarkdownPreview, I realised MarkdownPreview style overrides what I am trying to achieve.

Is there any way of handling styles from CSS frameworks?


        <article className="prose prose-h2:text-xl prose-h2:font-medium prose-h2:text-gray-900">
          <MarkdownPreview
            source={`## h2`}
            wrapperElement={{
              "data-color-mode": "light",
              className: "prose prose-h2:text-xl prose-h2:font-medium prose-h2:text-gray-900"
            }}
            rehypeRewrite={(node, index, parent) => {
              if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
                parent.children = parent.children.slice(1)
              }
            }} />
        </article>
@jaywcjlove
Copy link
Member

@acanturk1 If I add :where to the style selection, it might solve the problem.

I don't know if this idea is feasible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants