Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
RobinMalfait committed Oct 29, 2021
commit a0b4ce5857761f69617675da3aa3f21da7d051a5
38 changes: 16 additions & 22 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,32 +72,26 @@ module.exports = plugin.withOptions(
return function ({ addVariant, addComponents, theme, prefix }) {
let modifiers = theme('typography')

// class="prose-headings-green-500 prose-body:text-red-500 prose-body:uppercase"
// addVariant(
// 'prose-headings',
// '& :is(h1, h2, h3, h4, thead):not(:where([class~="not-prose"] *))'
// )

let options = { className, prefix }

for (let [name, selector] of [
['bold', ':is(strong)'],
['bullets', ':is(ul > li::before)'],
['captions', ':is(figure figcaption)'],
['code', ':is(code)'],
['headings', ':is(h1, h2, h3, h4, th)'],
['h1', ':is(h1)'],
['h2', ':is(h2)'],
['h3', ':is(h3)'],
['h4', ':is(h4)'],
['th', ':is(th)'],
['lead', ':is([class~="lead"])'],
['links', ':is(a)'],
['pre', ':is(pre)'],
['quotes', ':is(blockquote)'],
['img', ':is(img)'],
['bold', 'strong'],
['bullets', 'ul > li::before'],
['captions', 'figure figcaption'],
['code', 'code'],
['headings', 'h1, h2, h3, h4, th'],
['h1', 'h1'],
['h2', 'h2'],
['h3', 'h3'],
['h4', 'h4'],
['th', 'th'],
['lead', '[class~="lead"]'],
['links', 'a'],
['pre', 'pre'],
['quotes', 'blockquote'],
['img', 'img'],
]) {
addVariant(`${className}-${name}`, `& ${inWhere(selector, options)}`)
addVariant(`${className}-${name}`, `& :is(${inWhere(selector, options)})`)
}

// Variants:
Expand Down