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

Add inherit theme for if theming is undesired. #368

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
43 changes: 43 additions & 0 deletions src/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down