Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure p styles are inserted before .lead styles #294

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1294,3 +1294,31 @@ it('ignores common non-trailing pseudo-elements in selectors', () => {
`)
})
})

test('lead styles are inserted after paragraph styles', async () => {
let config = {
content: [{ raw: html`<div class="prose"></div>` }],
}

return run(config).then((result) => {
expect(result.css).toIncludeCss(
css`
.prose {
color: var(--tw-prose-body);
max-width: 65ch;
}
.prose :where(p):not(:where([class~='not-prose'] *)) {
margin-top: 1.25em;
margin-bottom: 1.25em;
}
.prose :where([class~='lead']):not(:where([class~='not-prose'] *)) {
color: var(--tw-prose-lead);
font-size: 1.25em;
line-height: 1.6;
margin-top: 1.2em;
margin-bottom: 1.2em;
}
`
)
})
})
2 changes: 2 additions & 0 deletions src/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,8 @@ module.exports = {
{
color: 'var(--tw-prose-body)',
maxWidth: '65ch',
// TODO: Figure out how to not need this, it's a merging issue
p: {},
'[class~="lead"]': {
color: 'var(--tw-prose-lead)',
},
Expand Down