Skip to content

Commit 1874110

Browse files
Folydthecrypticace
andauthored
Fix prose elements legacy mode. Fixes #258 (#259)
* Fix prose elements `legacy` mode. Fixes #258 * Add test * Fix legacy mode custom element selectors Co-authored-by: Jordan Pittman <[email protected]>
1 parent c346878 commit 1874110

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ module.exports = plugin.withOptions(
117117
['video'],
118118
['hr'],
119119
]) {
120-
addVariant(`${className}-${name}`, `& :is(${inWhere(selector, options)})`)
120+
addVariant(`${className}-${name}`, target === 'legacy' ? `& ${selector}` : `& :is(${inWhere(selector, options)})`)
121121
}
122122

123123
addComponents(

Diff for: src/index.test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ test('modifiers', async () => {
335335
test('legacy target', async () => {
336336
let config = {
337337
plugins: [typographyPlugin({ target: 'legacy' })],
338-
content: [{ raw: html`<div class="prose"></div>` }],
338+
content: [{ raw: html`<div class="prose prose-h1:text-center"></div>` }],
339339
theme: {
340340
typography: {
341341
DEFAULT: {
@@ -423,6 +423,9 @@ test('legacy target', async () => {
423423
.prose code::after {
424424
content: '&#96;';
425425
}
426+
.prose-h1\:text-center h1 {
427+
text-align: center;
428+
}
426429
`
427430
)
428431
})

0 commit comments

Comments
 (0)