Skip to content

Commit 809fefa

Browse files
committed
Add description list (<dl>, <dt>, <dd>) styles
1 parent 79f3f69 commit 809fefa

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

Diff for: demo/components/MarkdownSample.mdx

+23
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,29 @@ The most annoying thing about lists in Markdown is that `<li>` elements aren't g
161161

162162
And finally a sentence to close off this section.
163163

164+
## We didn't forget about description lists
165+
166+
Well, that's not exactly true, we first released this plugin back in 2020 and it took three years before we added description lists. But they're here now, so let's just be happy about that&hellip;okay? They can be great for things like FAQs.
167+
168+
<dl>
169+
<dt>Why do you never see elephants hiding in trees?</dt>
170+
<dd>
171+
Because they're so good at it. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quas
172+
cupiditate laboriosam fugiat.
173+
</dd>
174+
<dt>What do you call someone with no body and no nose?</dt>
175+
<dd>
176+
Nobody knows. Lorem ipsum dolor sit amet consectetur adipisicing elit. Culpa, voluptas ipsa quia
177+
excepturi, quibusdam natus exercitationem sapiente tempore labore voluptatem.
178+
</dd>
179+
<dt>Why can't you hear a pterodactyl go to the bathroom?</dt>
180+
<dd>
181+
Because the pee is silent. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam, quas
182+
voluptatibus ex culpa ipsum, aspernatur blanditiis fugiat ullam magnam suscipit deserunt illum
183+
natus facilis atque vero consequatur! Quisquam, debitis error.
184+
</dd>
185+
</dl>
186+
164187
## There are other elements we need to style
165188

166189
I almost forgot to mention links, like [this link to the Tailwind CSS website](https://tailwindcss.com). We almost made them blue but that's so yesterday, so we went with dark gray, feels edgier.

Diff for: src/styles.js

+59
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,17 @@ let defaultModifiers = {
144144
marginTop: em(8, 14),
145145
marginBottom: em(8, 14),
146146
},
147+
dl: {
148+
marginTop: em(16, 14),
149+
marginBottom: em(16, 14),
150+
},
151+
dt: {
152+
marginTop: em(16, 14),
153+
},
154+
dd: {
155+
marginTop: em(4, 14),
156+
paddingLeft: em(22, 14),
157+
},
147158
hr: {
148159
marginTop: em(40, 14),
149160
marginBottom: em(40, 14),
@@ -338,6 +349,17 @@ let defaultModifiers = {
338349
marginTop: em(12, 16),
339350
marginBottom: em(12, 16),
340351
},
352+
dl: {
353+
marginTop: em(20, 16),
354+
marginBottom: em(20, 16),
355+
},
356+
dt: {
357+
marginTop: em(20, 16),
358+
},
359+
dd: {
360+
marginTop: em(8, 16),
361+
paddingLeft: em(26, 16),
362+
},
341363
hr: {
342364
marginTop: em(48, 16),
343365
marginBottom: em(48, 16),
@@ -532,6 +554,17 @@ let defaultModifiers = {
532554
marginTop: em(16, 18),
533555
marginBottom: em(16, 18),
534556
},
557+
dl: {
558+
marginTop: em(24, 18),
559+
marginBottom: em(24, 18),
560+
},
561+
dt: {
562+
marginTop: em(24, 18),
563+
},
564+
dd: {
565+
marginTop: em(12, 18),
566+
paddingLeft: em(28, 18),
567+
},
535568
hr: {
536569
marginTop: em(56, 18),
537570
marginBottom: em(56, 18),
@@ -726,6 +759,17 @@ let defaultModifiers = {
726759
marginTop: em(16, 20),
727760
marginBottom: em(16, 20),
728761
},
762+
dl: {
763+
marginTop: em(24, 20),
764+
marginBottom: em(24, 20),
765+
},
766+
dt: {
767+
marginTop: em(24, 20),
768+
},
769+
dd: {
770+
marginTop: em(12, 20),
771+
paddingLeft: em(32, 20),
772+
},
729773
hr: {
730774
marginTop: em(56, 20),
731775
marginBottom: em(56, 20),
@@ -920,6 +964,17 @@ let defaultModifiers = {
920964
marginTop: em(16, 24),
921965
marginBottom: em(16, 24),
922966
},
967+
dl: {
968+
marginTop: em(32, 24),
969+
marginBottom: em(32, 24),
970+
},
971+
dt: {
972+
marginTop: em(32, 24),
973+
},
974+
dd: {
975+
marginTop: em(12, 24),
976+
paddingLeft: em(38, 24),
977+
},
923978
hr: {
924979
marginTop: em(72, 24),
925980
marginBottom: em(72, 24),
@@ -1409,6 +1464,10 @@ module.exports = {
14091464
'ul > li::marker': {
14101465
color: 'var(--tw-prose-bullets)',
14111466
},
1467+
dt: {
1468+
color: 'var(--tw-prose-headings)',
1469+
fontWeight: '600',
1470+
},
14121471
hr: {
14131472
borderColor: 'var(--tw-prose-hr)',
14141473
borderTopWidth: 1,

0 commit comments

Comments
 (0)