Skip to content

Commit 83f3a83

Browse files
Allow lead class to override element styles (#260)
* Allow lead to override element styles * Update changelog
1 parent 1874110 commit 83f3a83

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Add styles for `tfoot` elements ([#243](https://github.com/tailwindlabs/tailwindcss-typography/pull/243))
1313

14+
## Fixed
15+
16+
- Fix prose elements `legacy` mode ([#259](https://github.com/tailwindlabs/tailwindcss-typography/pull/259))
17+
- Allow `lead` class to override element styles ([#260](https://github.com/tailwindlabs/tailwindcss-typography/pull/260))
18+
1419
## [0.5.2] - 2022-02-14
1520

1621
### Fixed

Diff for: src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ module.exports = plugin.withOptions(
9191

9292
for (let [name, selector = name] of [
9393
['headings', 'h1, h2, h3, h4, th'],
94-
['lead', '[class~="lead"]'],
9594
['h1'],
9695
['h2'],
9796
['h3'],
@@ -116,6 +115,7 @@ module.exports = plugin.withOptions(
116115
['img'],
117116
['video'],
118117
['hr'],
118+
['lead', '[class~="lead"]'],
119119
]) {
120120
addVariant(`${className}-${name}`, target === 'legacy' ? `& ${selector}` : `& :is(${inWhere(selector, options)})`)
121121
}

Diff for: src/index.test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,6 @@ test('element variants', async () => {
609609
:is(:where(h1, h2, h3, h4, th):not(:where([class~='not-prose'] *))) {
610610
text-decoration-line: underline;
611611
}
612-
.prose-lead\:italic :is(:where([class~='lead']):not(:where([class~='not-prose'] *))) {
613-
font-style: italic;
614-
}
615612
.prose-h1\:text-3xl :is(:where(h1):not(:where([class~='not-prose'] *))) {
616613
font-size: 1.875rem;
617614
line-height: 2.25rem;
@@ -694,6 +691,9 @@ test('element variants', async () => {
694691
.prose-hr\:border-t-2 :is(:where(hr):not(:where([class~='not-prose'] *))) {
695692
border-top-width: 2px;
696693
}
694+
.prose-lead\:italic :is(:where([class~="lead"]):not(:where([class~="not-prose"] *))) {
695+
font-style: italic;
696+
}
697697
`
698698
)
699699
})
@@ -781,9 +781,6 @@ test('element variants with custom class name', async () => {
781781
:is(:where(h1, h2, h3, h4, th):not(:where([class~='not-markdown'] *))) {
782782
text-decoration-line: underline;
783783
}
784-
.markdown-lead\:italic :is(:where([class~='lead']):not(:where([class~='not-markdown'] *))) {
785-
font-style: italic;
786-
}
787784
.markdown-h1\:text-3xl :is(:where(h1):not(:where([class~='not-markdown'] *))) {
788785
font-size: 1.875rem;
789786
line-height: 2.25rem;
@@ -868,6 +865,9 @@ test('element variants with custom class name', async () => {
868865
.markdown-hr\:border-t-2 :is(:where(hr):not(:where([class~='not-markdown'] *))) {
869866
border-top-width: 2px;
870867
}
868+
.markdown-lead\:italic :is(:where([class~="lead"]):not(:where([class~="not-markdown"] *))) {
869+
font-style: italic;
870+
}
871871
`
872872
)
873873
})

0 commit comments

Comments
 (0)