diff --git a/CHANGELOG.md b/CHANGELOG.md index 42654a0..2e0c64d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Add `prose-picture` modifier ([#367](https://github.com/tailwindlabs/tailwindcss-typography/pull/367)) + ### Fixed - Include unit in `hr` border-width value ([#379](https://github.com/tailwindlabs/tailwindcss-typography/pull/379) diff --git a/README.md b/README.md index 954948c..43163d8 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,7 @@ Here's a complete list of available element modifiers: | `prose-th:{utility}` | `th` | | `prose-td:{utility}` | `td` | | `prose-img:{utility}` | `img` | +| `prose-picture:{utility}` | `picture` | | `prose-video:{utility}` | `video` | | `prose-hr:{utility}` | `hr` | @@ -345,9 +346,9 @@ See our internal [style definitions](https://github.com/tailwindlabs/tailwindcss If you need to use a class name other than `prose` for any reason, you can do so using the `className` option when registering the plugin: ```css -@import "tailwindcss"; +@import 'tailwindcss'; @plugin "@tailwindcss/typography" { - className: wysiwyg; + classname: wysiwyg; } ``` diff --git a/src/index.js b/src/index.js index d231d01..937756b 100644 --- a/src/index.js +++ b/src/index.js @@ -96,6 +96,7 @@ module.exports = plugin.withOptions( ['th'], ['td'], ['img'], + ['picture'], ['video'], ['hr'], ['lead', '[class~="lead"]'], @@ -132,4 +133,3 @@ module.exports = plugin.withOptions( } } ) - diff --git a/src/index.test.js b/src/index.test.js index 8db6c6c..6713ba5 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -707,6 +707,7 @@ test('element variants', async () => { prose-th:text-left prose-td:align-center prose-img:rounded-lg + prose-picture:my-8 prose-video:my-12 prose-hr:border-t-2 " @@ -855,6 +856,11 @@ test('element variants', async () => { :is(:where(img):not(:where([class~='not-prose'], [class~='not-prose'] *))) { border-radius: 0.5rem; } + .prose-picture\:my-8 + :is(:where(picture):not(:where([class~='not-prose'], [class~='not-prose'] *))) { + margin-top: 2rem; + margin-bottom: 2rem; + } .prose-video\:my-12 :is(:where(video):not(:where([class~='not-prose'], [class~='not-prose'] *))) { margin-top: 3rem;