Skip to content

Commit 511afcb

Browse files
authored
Add modifiers for description list elements (#357)
Hello! 👋🏼 _I tried finding some contribution guidelines but couldn't; Hopefully this is allowed even though it does not address an active issue._ The description list elements introduced in #316 did not include a way to target these using `prose-dl:` so I have taken the liberty of adding them in.
1 parent 042a531 commit 511afcb

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ Here's a complete list of available element modifiers:
181181
| `prose-ol:{utility}` | `ol` |
182182
| `prose-ul:{utility}` | `ul` |
183183
| `prose-li:{utility}` | `li` |
184+
| `prose-dl:{utility}` | `dl` |
185+
| `prose-dt:{utility}` | `dt` |
186+
| `prose-dd:{utiddty}` | `dd` |
184187
| `prose-table:{utility}` | `table` |
185188
| `prose-thead:{utility}` | `thead` |
186189
| `prose-tr:{utility}` | `tr` |

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ module.exports = plugin.withOptions(
9090
['ol'],
9191
['ul'],
9292
['li'],
93+
['dl'],
94+
['dt'],
95+
['dd'],
9396
['table'],
9497
['thead'],
9598
['tr'],

src/index.test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,9 @@ test('element variants', async () => {
701701
prose-ol:pl-6
702702
prose-ul:pl-8
703703
prose-li:my-4
704+
prose-dl:pl-6
705+
prose-dt:pl-8
706+
prose-dd:my-4
704707
prose-table:my-8
705708
prose-thead:border-red-300
706709
prose-tr:border-red-200
@@ -833,6 +836,16 @@ test('element variants', async () => {
833836
margin-top: 1rem;
834837
margin-bottom: 1rem;
835838
}
839+
.prose-dl\:pl-6 :is(:where(dl):not(:where([class~="not-prose"], [class~="not-prose"] *))) {
840+
padding-left: 1.5rem;
841+
}
842+
.prose-dt\:pl-8 :is(:where(dt):not(:where([class~="not-prose"], [class~="not-prose"] *))) {
843+
padding-left: 2rem;
844+
}
845+
.prose-dd\:my-4 :is(:where(dd):not(:where([class~="not-prose"], [class~="not-prose"] *))) {
846+
margin-top: 1rem;
847+
margin-bottom: 1rem;
848+
}
836849
.prose-table\:my-8
837850
:is(:where(table):not(:where([class~='not-prose'], [class~='not-prose'] *))) {
838851
margin-top: 2rem;

0 commit comments

Comments
 (0)