From 14d2bb21ab99c08ee0b4d85e5571332610b772b9 Mon Sep 17 00:00:00 2001 From: James Cleveland Date: Sat, 7 Dec 2024 12:13:15 +0000 Subject: [PATCH 1/2] Update styles.js to add a reset color theme If colours are already defined external to the prose component, it is good to have an option to use those instead of needing a greyscale theme. --- src/styles.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/styles.js b/src/styles.js index a4d6967..a64ceec 100644 --- a/src/styles.js +++ b/src/styles.js @@ -1250,6 +1250,49 @@ let defaultModifiers = { }, }, + // Inherit color theme + + inherit: { + css: { + '--tw-prose-body': "inherit", + '--tw-prose-headings': "inherit", + '--tw-prose-lead': "inherit", + '--tw-prose-links': "inherit", + '--tw-prose-bold': "inherit", + '--tw-prose-counters': "inherit", + '--tw-prose-bullets': "inherit", + '--tw-prose-hr': "inherit", + '--tw-prose-quotes': "inherit", + '--tw-prose-quote-borders': "inherit", + '--tw-prose-captions': "inherit", + '--tw-prose-kbd': "inherit", + '--tw-prose-kbd-shadows': "inherit", + '--tw-prose-code': "inherit", + '--tw-prose-pre-code': "inherit", + '--tw-prose-pre-bg': "inherit", + '--tw-prose-th-borders': "inherit", + '--tw-prose-td-borders': "inherit", + '--tw-prose-invert-body': "inherit", + '--tw-prose-invert-headings': "inherit", + '--tw-prose-invert-lead': "inherit", + '--tw-prose-invert-links': "inherit", + '--tw-prose-invert-bold': "inherit", + '--tw-prose-invert-counters': "inherit", + '--tw-prose-invert-bullets': "inherit", + '--tw-prose-invert-hr': "inherit", + '--tw-prose-invert-quotes': "inherit", + '--tw-prose-invert-quote-borders': "inherit", + '--tw-prose-invert-captions': "inherit", + '--tw-prose-invert-kbd': "inherit", + '--tw-prose-invert-kbd-shadows': "inherit", + '--tw-prose-invert-code': "inherit", + '--tw-prose-invert-pre-code': "inherit", + '--tw-prose-invert-pre-bg': "inherit", + '--tw-prose-invert-th-borders': "inherit", + '--tw-prose-invert-td-borders': "inherit", + }, + }, + // Link-only themes (for backward compatibility) red: { From 6de8bfcfaedd18074ae110151837979c2c3b55fb Mon Sep 17 00:00:00 2001 From: James Cleveland Date: Sat, 7 Dec 2024 12:15:24 +0000 Subject: [PATCH 2/2] Update README.md Add inherit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a4d73c5..7897f43 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ Here are the classes that are generated using a totally default Tailwind CSS v2. | `prose-zinc` | Zinc | | `prose-neutral` | Neutral | | `prose-stone` | Stone | +| `prose-inherit` | Inherit | Modifier classes are designed to be used with the [multi-class modifier pattern](http://nicolasgallagher.com/about-html-semantics-front-end-architecture/#component-modifiers) and must be used in conjunction with the base `prose` class.