You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, all of the internal components used by the DocLayout will completely override the className property. For example, ul will always have "list-disc pl-5 my-4 leading-7". I think it should respect any className it gets from props, and attempt to merge them.
The motivation for this is that I wrote a custom rehype plugin that adds custom classes to MDX elements, but these are stripped away by the components.
What does the proposed API look like?
The simplest solution would be to concatenate the props.
The built-in TailwindCSS has caused some issues like style pollution since there are no prefix in built-in tailwind css classnames, we may change to use css modules or adding prefix for built-in tailwind classnames which has not been decided yet.
Therefore, I think option 1 or 3 is better, and below shows we mix the use of tailwindcss and css modules 😂
What problem does this feature solve?
Currently, all of the internal components used by the
DocLayout
will completely override theclassName
property. For example, ul will always have "list-disc pl-5 my-4 leading-7". I think it should respect anyclassName
it gets from props, and attempt to merge them.The motivation for this is that I wrote a custom rehype plugin that adds custom classes to MDX elements, but these are stripped away by the components.
What does the proposed API look like?
However, this may add an extra space if there were no classes provided.
cn
utility for merging TailwindCSS classes.This would require additional packages to be installed, but they are small and might be useful in other places.
cn
to prevent additional dependencies.If any of these solutions seem acceptable, I can open a corresponding PR.
The text was updated successfully, but these errors were encountered: