From 3dc77efb80e5f576d29cf67ed10ef4148e9ec44f Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 25 Mar 2022 14:24:56 -0400 Subject: [PATCH 1/2] Allow lead to override element styles --- src/index.js | 2 +- src/index.test.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index a021223..c30b522 100644 --- a/src/index.js +++ b/src/index.js @@ -91,7 +91,6 @@ module.exports = plugin.withOptions( for (let [name, selector = name] of [ ['headings', 'h1, h2, h3, h4, th'], - ['lead', '[class~="lead"]'], ['h1'], ['h2'], ['h3'], @@ -116,6 +115,7 @@ module.exports = plugin.withOptions( ['img'], ['video'], ['hr'], + ['lead', '[class~="lead"]'], ]) { addVariant(`${className}-${name}`, target === 'legacy' ? `& ${selector}` : `& :is(${inWhere(selector, options)})`) } diff --git a/src/index.test.js b/src/index.test.js index 0d72fe1..5c2ce9f 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -609,9 +609,6 @@ test('element variants', async () => { :is(:where(h1, h2, h3, h4, th):not(:where([class~='not-prose'] *))) { text-decoration-line: underline; } - .prose-lead\:italic :is(:where([class~='lead']):not(:where([class~='not-prose'] *))) { - font-style: italic; - } .prose-h1\:text-3xl :is(:where(h1):not(:where([class~='not-prose'] *))) { font-size: 1.875rem; line-height: 2.25rem; @@ -694,6 +691,9 @@ test('element variants', async () => { .prose-hr\:border-t-2 :is(:where(hr):not(:where([class~='not-prose'] *))) { border-top-width: 2px; } + .prose-lead\:italic :is(:where([class~="lead"]):not(:where([class~="not-prose"] *))) { + font-style: italic; + } ` ) }) @@ -781,9 +781,6 @@ test('element variants with custom class name', async () => { :is(:where(h1, h2, h3, h4, th):not(:where([class~='not-markdown'] *))) { text-decoration-line: underline; } - .markdown-lead\:italic :is(:where([class~='lead']):not(:where([class~='not-markdown'] *))) { - font-style: italic; - } .markdown-h1\:text-3xl :is(:where(h1):not(:where([class~='not-markdown'] *))) { font-size: 1.875rem; line-height: 2.25rem; @@ -868,6 +865,9 @@ test('element variants with custom class name', async () => { .markdown-hr\:border-t-2 :is(:where(hr):not(:where([class~='not-markdown'] *))) { border-top-width: 2px; } + .markdown-lead\:italic :is(:where([class~="lead"]):not(:where([class~="not-markdown"] *))) { + font-style: italic; + } ` ) }) From 92f791648ba82f1d2e8ed92a1e4b3e7148a7d2ca Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 25 Mar 2022 14:34:51 -0400 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fabdc8..0bbe3ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add styles for `tfoot` elements ([#243](https://github.com/tailwindlabs/tailwindcss-typography/pull/243)) +## Fixed + +- Fix prose elements `legacy` mode ([#259](https://github.com/tailwindlabs/tailwindcss-typography/pull/259)) +- Allow `lead` class to override element styles ([#260](https://github.com/tailwindlabs/tailwindcss-typography/pull/260)) + ## [0.5.2] - 2022-02-14 ### Fixed