github-markdown-tailwindcss
Replicate GitHub Flavored Markdown with Tailwind CSS components
๐ฉ
Usage
To use, include the provided style sheet (markdown.css
) and add the markdown
class to any element that you wish to render as Github Flavored Markdown (GFM).
Example
<h1>Headerh1>
<h1 class="markdown">Headerh1>
Working with Hugo
You can use this style sheet to style your generated Hugo content. To do so, wrap your content with an element that contains the markdown
class.
Example
<div class="markdown"> {{ .Content }} div>
๐๏ธ
Nesting
For those of you who wish to have the class rules nested I have provided a simple python script (nest.py
) to generate a style sheet with nesting (markdown-nested.css
). The nesting script just applies a very simple reformatting.
Using the Nest Script
python nest.py
๐ฌ
Contribution
- Report issues
- Open pull requests with improvements
- Spread the word
๐
References
The idea to use the @apply
directive to create rules for a Markdown class was concieved by @adamwathan (the creator of Tailwind CSS). He first publicized this idea in a comment on an issue in the Tailwind CSS discussion repository.
I would like to know why markdown-nested.css is not working
Im using a hugo theme
that utilize tailwind css
I manage to use the markdown.css
but when i try to use the generated markdown-nested.css file from a python command
I dont see any changes like the one when using the markdown.css u provide...
Am I missing something on my postcss.config.js?
this is my post.config.js