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

Feat: Added CSS class customization #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CarcajadaArtificial
Copy link

Hello!

I'm really interested in md rendering native to Deno. I think adding CSS classes to the rendered markdown elements would be a fantastic feature. This would allow users to include their own styling without the need to rewrite the whole Marked Render class from scratch. Additionally, I think this works great for Fresh users (or other frameworks) because it gives them a way to add twind classes.

Finally, I think that the requirement of markdown rendering extends further than sites that come from mostly markdown generation (like documentation sites). Frequently, in normal web app sites, I get the requirement of rendering a few static markdown blocks, for user instructions, pieces of documentation, or content that is more convenient to write with a markdown editor. Most of these would like to add their own styling to the rendered content.

I hope my previous arguments convince you of the potential of this feature. Even if you don't see it fit for this project, I would love to hear advice or recommendation. Thank you for reading and for this project.

@lino-levan
Copy link
Contributor

@hashrock please take a look

@hashrock
Copy link
Contributor

hashrock commented Aug 1, 2023

I'm not sure about this feature. I think it might be useful, But It also seems to be an uncommon feature for markdown renderers (please let me know if any renderers implement similar features). I think most of the cases are solved by writing raw html inside markdown and applying raw CSS externally.
Also I think this might be something that should be done post-processing the html like rehype-add-classes.

@lino-levan
Copy link
Contributor

My old website used react-markdown which had this feature. To be fair, that's a layer on top of unified (but so are we, or at least, we will be).

@Mrashes
Copy link
Contributor

Mrashes commented Jul 2, 2024

@lino-levan I like the idea of this but agree with @hashrock that anything that is needed from this is already do-able with html in md and raw css.

If we were to add this, could we do some more tests?

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

Successfully merging this pull request may close these issues.

4 participants