From 01b75961bbd25e229dfe92081226031a59117a92 Mon Sep 17 00:00:00 2001 From: Folyd Date: Tue, 22 Mar 2022 11:37:12 +0800 Subject: [PATCH 1/3] Fix prose elements `legacy` mode. Fixes #258 --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index a4f79b4..20d7849 100644 --- a/src/index.js +++ b/src/index.js @@ -117,7 +117,7 @@ module.exports = plugin.withOptions( ['video'], ['hr'], ]) { - addVariant(`${className}-${name}`, `& :is(${inWhere(selector, options)})`) + addVariant(`${className}-${name}`, target === 'legacy' ? '' : `& :is(${inWhere(selector, options)})`) } addComponents( From 21e104d9c9f35dc8ddfde705863180cf92a4075b Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 25 Mar 2022 13:43:19 -0400 Subject: [PATCH 2/3] Add test --- src/index.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.test.js b/src/index.test.js index 7f624f1..0d72fe1 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -335,7 +335,7 @@ test('modifiers', async () => { test('legacy target', async () => { let config = { plugins: [typographyPlugin({ target: 'legacy' })], - content: [{ raw: html`
` }], + content: [{ raw: html`
` }], theme: { typography: { DEFAULT: { @@ -423,6 +423,9 @@ test('legacy target', async () => { .prose code::after { content: '`'; } + .prose-h1\:text-center h1 { + text-align: center; + } ` ) }) From b3a74a71249ea1187ea6f6edab04a57c56fc7cc8 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 25 Mar 2022 13:43:28 -0400 Subject: [PATCH 3/3] Fix legacy mode custom element selectors --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 20d7849..a021223 100644 --- a/src/index.js +++ b/src/index.js @@ -117,7 +117,7 @@ module.exports = plugin.withOptions( ['video'], ['hr'], ]) { - addVariant(`${className}-${name}`, target === 'legacy' ? '' : `& :is(${inWhere(selector, options)})`) + addVariant(`${className}-${name}`, target === 'legacy' ? `& ${selector}` : `& :is(${inWhere(selector, options)})`) } addComponents(