Lorem ipsum dolor sit amet consectetur adipisicing elit. Eius omnis, commodi pariatur illo quo iusto, eum eos minus quidem quas numquam perferendis temporibus neque dolore tenetur repellat consequatur aut accusantium.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ea fuga voluptate cum! Magnam corporis, consectetur eligendi nemo, really are eius suscipit culpa omnis temporibus, reiciendis maxime magni hic earum autem soluta harum.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Soluta, recusandae voluptates. Modi maxime quo necessitatibus
h1 necessitatibus
fuga dolores alias, in ea.
It adds a new prose
class that you can slap
on any block of vanilla HTML content and turn it into a
beautiful, well-formatted document:
For more information about how to use the plugin and the features it includes,read the documentation.
What follows from here is just a bunch of absolute nonsense I've written to dogfood the plugin itself. It includes every sensible typographic element I could think of, like bold text, unordered lists, ordered lists, code blocks, block quotes, and even italics.
It's important to cover all of these use cases for a few reasons:
Now we're going to try out another header style.
So that's a header for you — with any luck if we've done our job correctly that will look pretty reasonable.
Something a wise person once told me about typography is:
Typography is pretty important if you don't want your stuff to look like trash. Make it good then it won't be bad.
It's probably important that images look okay here by default as well:
Now I'm going to show you an example of an unordered list to make sure that looks good, too:
And that's the end of this section.
Sometimes you have headings directly underneath each other. In those cases you often have to undo the top margin on the second heading because it usually looks better for the headings to be closer together than a paragraph followed by a heading should be.
When a heading comes after a paragraph, we need a bit more space, like I already mentioned above. Now let's see what a more complex list would look like.
I often do this thing where list items have headings.
For some reason I think this looks cool which is unfortunate because it's pretty annoying to get the styles right.
Since this is a list, I need at least two items.
I explained what I'm doing already in the previous list item, but a list wouldn't be a list if it only had one item, and we really want this to look realistic.
It's not a bad idea to add a third item either.
I think it probably would've been fine to just use two items but three is definitely not worse, and since I seem to be having no trouble making up arbitrary things to type
After this sort of list I usually have a closing statement or paragraph, because it kinda looks weird jumping right to a heading.
I think most people are going to use highlight.js or Prism or something if they want to style their code blocks but it wouldn't hurt to make them look okay out of the box, even with no syntax highlighting.
Hopefully that looks good enough to you.
Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it we have to carry the burden of at least making it work.
The most annoying thing about lists in Markdown is that
<li>
elements aren't given a child
<p>
tag unless there are multiple
paragraphs in the list item. That means I have to worry
about styling that annoying situation too.
For example, here's another nested list.
But this time with a second paragraph.
<p>
tags
But in this second top-level list item, they will.
This is especially annoying because of the spacing on this paragraph.
As you can see here, because I've added a second
line, this list item now has a
<p>
tag.
This is the second line I'm talking about by the way.
Finally here's another list item so it's more like a list.
A closing list item, but with no nested list, because why not?
And finally a sentence to close off this section.
I almost forgot to mention links, like this link to the Tailwind CSS website. We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier.
We even included table styles, check it out:
Wrestler | Origin | Finisher |
---|---|---|
Bret "The Hitman" Hart | Calgary, AB | Sharpshooter |
Stone Cold Steve Austin | Austin, TX | Stone Cold Stunner |
Randy Savage | Sarasota, FL | Elbow Drop |
Vader | Boulder, CO | Vader Bomb |
Razor Ramon | Chuluota, FL | Razor's Edge |
code
in headingsEven though it's probably a bad idea, and historically I've had a hard time making it look good. This "wrap the code blocks in backticks" trick works pretty well though really.