Skip to content

Commit

Permalink
Remove typography styles from not-prose elements in addition to the…
Browse files Browse the repository at this point in the history
…ir children (#301)

* Ignore not-prose also on the element itself

* Update tests

* Update changelog

---------

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
  • Loading branch information
jonnitto and reinink authored Aug 30, 2023
1 parent ee884f3 commit 1cdc770
Show file tree
Hide file tree
Showing 3 changed files with 209 additions and 119 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Fix space between `<figcaption>` and `<pre>` ([#313](https://github.com/tailwindlabs/tailwindcss-typography/pull/313))
- Remove typography styles from `not-prose` elements in addition to their children ([#301](https://github.com/tailwindlabs/tailwindcss-typography/pull/301))

## [0.5.9] - 2023-01-10

Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ function inWhere(selector, { className, modifier, prefix }) {
let [trailingPseudo, rebuiltSelector] = commonTrailingPseudos(selector)

if (trailingPseudo) {
return `:where(${selectorPrefix}${rebuiltSelector}):not(:where([class~="${prefixedNot}"] *))${trailingPseudo}`
return `:where(${selectorPrefix}${rebuiltSelector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))${trailingPseudo}`
}

return `:where(${selectorPrefix}${selector}):not(:where([class~="${prefixedNot}"] *))`
return `:where(${selectorPrefix}${selector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))`
}

function isObject(value) {
Expand Down
Loading

1 comment on commit 1cdc770

@vercel
Copy link

@vercel vercel bot commented on 1cdc770 Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.