Typography
Opt-in document typography: the .prose wrapper carries heading scale, list rhythm, link, quote, code and table styles.
INSTALL
1pnpm dlx @sayagodev/mo add typographyOr import the files from the package (no copy):
1import "@sayagodev/mo/css/prose.css";EXAMPLES
Taxing Laughter: The Joke Tax Chronicles
1<div class="prose">2 <h1>Taxing Laughter: The Joke Tax Chronicles</h1>3</div>4
The People of the Kingdom
1<div class="prose">2 <h2>The People of the Kingdom</h2>3</div>4
The Joke Tax
1<div class="prose">2 <h3>The Joke Tax</h3>3</div>4
People stopped telling jokes
1<div class="prose">2 <h4>People stopped telling jokes</h4>3</div>4
The king, seeing how much happier his subjects were, realized the error of his ways and repealed the joke tax.
1<div class="prose">2 <p>3 The king, seeing how much happier his subjects were, realized the error of4 his ways and repealed the joke tax.5 </p>6</div>7
"After all," he said, "everyone enjoys a good joke, so it's only fair that they should pay for the privilege."
1<div class="prose">2 <blockquote>3 "After all," he said, "everyone enjoys a good joke, so it's only fair that4 they should pay for the privilege."5 </blockquote>6</div>7
- 1st level of puns: 5 gold coins
- 2nd level of jokes: 10 gold coins
- 3rd level of one-liners : 20 gold coins
1<div class="prose">2 <ul>3 <li>1st level of puns: 5 gold coins</li>4 <li>2nd level of jokes: 10 gold coins</li>5 <li>3rd level of one-liners : 20 gold coins</li>6 </ul>7</div>8
A modal dialog that interrupts the user with important content and expects a response.
1<div class="prose">2 <p class="text-light">3 A modal dialog that interrupts the user with important content and expects4 a response.5 </p>6</div>7
Are you absolutely sure?
1<div class="prose">2 <p><strong>Are you absolutely sure?</strong></p>3</div>4
Email address
1<div class="prose">2 <p><small>Email address</small></p>3</div>4
Enter your email address.
1<div class="prose">2 <p class="text-light">Enter your email address.</p>3</div>4
@radix-ui/react-alert-dialog
1<div class="prose">2 <code>@radix-ui/react-alert-dialog</code>3</div>4
| King's Treasury | People's happiness |
|---|---|
| Empty | Overflowing |
| Modest | Satisfied |
| Full | Ecstatic |
1<div class="prose">2 <table>3 <thead>4 <tr>5 <th>King's Treasury</th>6 <th>People's happiness</th>7 </tr>8 </thead>9 <tbody>10 <tr>11 <td>Empty</td>12 <td>Overflowing</td>13 </tr>14 <tr>15 <td>Modest</td>16 <td>Satisfied</td>17 </tr>18 <tr>19 <td>Full</td>20 <td>Ecstatic</td>21 </tr>22 </tbody>23 </table>24</div>25
Taxing Laughter: The Joke Tax Chronicles
Once upon a time, in a far-off land, there was a very lazy king who spent all day lounging on his throne. One day, his advisors came to him with a problem: the kingdom was running out of money.
The King's Plan
The king thought long and hard, and finally came up with a brilliant plan: he would tax the jokes in the kingdom.
"After all," he said, "everyone enjoys a good joke, so it's only fair that they should pay for the privilege."
The Joke Tax
The king's subjects were not amused. They grumbled and complained, but the king was firm:
- 1st level of puns: 5 gold coins
- 2nd level of jokes: 10 gold coins
- 3rd level of one-liners : 20 gold coins
As a result, people stopped telling jokes, and the kingdom fell into a gloom. But there was one person who refused to let the king's foolishness get him down: a court jester named Jokester.
Jokester's Revolt
Jokester began sneaking into the castle in the middle of the night and leaving jokes all over the place: under the king's pillow, in his soup, even in the royal toilet. The king was furious, but he couldn't seem to stop Jokester.
And then, one day, the people of the kingdom discovered that the jokes left by Jokester were so funny that they couldn't help but laugh. And once they started laughing, they couldn't stop.
The People's Rebellion
The people of the kingdom, feeling uplifted by the laughter, started to tell jokes and puns again, and soon the entire kingdom was in on the joke.
| King's Treasury | People's happiness |
|---|---|
| Empty | Overflowing |
| Modest | Satisfied |
| Full | Ecstatic |
The king, seeing how much happier his subjects were, realized the error of his ways and repealed the joke tax. Jokester was declared a hero, and the kingdom lived happily ever after.
The moral of the story is: never underestimate the power of a good laugh and always be careful of bad ideas.
1<div class="prose">2 <h1>Taxing Laughter: The Joke Tax Chronicles</h1>3 <p class="text-light">4 Once upon a time, in a far-off land, there was a very lazy king who spent5 all day lounging on his throne. One day, his advisors came to him with a6 problem: the kingdom was running out of money.7 </p>8 <h2>The King's Plan</h2>9 <p>10 The king thought long and hard, and finally came up with11 <a href="#">a brilliant plan</a>: he would tax the jokes in the kingdom.12 </p>13 <blockquote>14 "After all," he said, "everyone enjoys a good joke, so it's only fair that15 they should pay for the privilege."16 </blockquote>17 <h3>The Joke Tax</h3>18 <p>19 The king's subjects were not amused. They grumbled and complained, but the20 king was firm:21 </p>22 <ul>23 <li>1st level of puns: 5 gold coins</li>24 <li>2nd level of jokes: 10 gold coins</li>25 <li>3rd level of one-liners : 20 gold coins</li>26 </ul>27 <p>28 As a result, people stopped telling jokes, and the kingdom fell into a29 gloom. But there was one person who refused to let the king's foolishness30 get him down: a court jester named Jokester.31 </p>32 <h3>Jokester's Revolt</h3>33 <p>34 Jokester began sneaking into the castle in the middle of the night and35 leaving jokes all over the place: under the king's pillow, in his soup,36 even in the royal toilet. The king was furious, but he couldn't seem to37 stop Jokester.38 </p>39 <p>40 And then, one day, the people of the kingdom discovered that the jokes left41 by Jokester were so funny that they couldn't help but laugh. And once they42 started laughing, they couldn't stop.43 </p>44 <h3>The People's Rebellion</h3>45 <p>46 The people of the kingdom, feeling uplifted by the laughter, started to47 tell jokes and puns again, and soon the entire kingdom was in on the joke.48 </p>49 <table>50 <thead>51 <tr>52 <th>King's Treasury</th>53 <th>People's happiness</th>54 </tr>55 </thead>56 <tbody>57 <tr>58 <td>Empty</td>59 <td>Overflowing</td>60 </tr>61 <tr>62 <td>Modest</td>63 <td>Satisfied</td>64 </tr>65 <tr>66 <td>Full</td>67 <td>Ecstatic</td>68 </tr>69 </tbody>70 </table>71 <p>72 The king, seeing how much happier his subjects were, realized the error of73 his ways and repealed the joke tax. Jokester was declared a hero, and the74 kingdom lived happily ever after.75 </p>76 <p>77 The moral of the story is: never underestimate the power of a good laugh78 and always be careful of bad ideas.79 </p>80</div>81
USAGE
1<div class="prose">2 <h1>Document title</h1>3 <p>Body copy with <a href="#">a link</a>, <code>inline code</code>4 and <strong>bold</strong>.</p>5 <blockquote>A quoted line.</blockquote>6 <ul><li>List item</li></ul>7</div>8 9<!-- outside .prose everything renders unstyled -->
API
FILES
src/css/prose.cssmo add typographyTHEMING · PLAYGROUND
This is the exact component from the examples above, wearing a completely different theme. Edit the tokens and --mo-* hooks in the editor — autocomplete knows them all — and the preview obeys in real time. Your CSS always wins.
--border--muted-foreground--primary--radius--warningPreview
Your CSS
Try it: type --mo- for the component hooks, or edit any value — the preview obeys in real time.