Skip to content

Commit

Permalink
Fix bug related to prose color helpers not working as expected (tailw…
Browse files Browse the repository at this point in the history
  • Loading branch information
simensen authored Dec 14, 2020
1 parent bc9592e commit 3d0276b
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 1 deletion.
94 changes: 94 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24693,3 +24693,97 @@ it('should be possible to override backticks for the inline `code` tag', async (
"
`)
})

it('should be possible to add colors without 600 and still get default and custom prose color helpers created', async () => {
expect(
await diffOnly(
{},
{
theme: {
extend: {
colors: {
'darkish-red': '#a85555',
'darkish-green': {
600: '#55a855',
},
},
},
},
}
)
).toMatchInlineSnapshot(`
"
+ .prose-darkish-green a {
+ color: #55a855;
+ }
+
+ .prose-darkish-green a code {
+ color: #55a855;
+ }
+
---
+ }
+
+ .sm\\\\:prose-darkish-green a {
+ color: #55a855;
+ }
+
+ .sm\\\\:prose-darkish-green a code {
+ color: #55a855;
---
+ }
+
+ .md\\\\:prose-darkish-green a {
+ color: #55a855;
+ }
+
+ .md\\\\:prose-darkish-green a code {
+ color: #55a855;
---
+ }
+
+ .lg\\\\:prose-darkish-green a {
+ color: #55a855;
---
+
+ .lg\\\\:prose-darkish-green a code {
+ color: #55a855;
+ }
---
+ }
+
+ .xl\\\\:prose-darkish-green a {
+ color: #55a855;
---
+
+ .xl\\\\:prose-darkish-green a code {
+ color: #55a855;
+ }
---
+ }
+
+ .\\\\32xl\\\\:prose-darkish-green a {
+ color: #55a855;
+ }
+
+ .\\\\32xl\\\\:prose-darkish-green a code {
+ color: #55a855;
"
`)
})
2 changes: 1 addition & 1 deletion src/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ module.exports = (theme) => ({
// Add color modifiers
...Object.entries(theme('colors')).reduce((reduced, [color, values]) => {
if (!isUsableColor(color, values)) {
return {}
return reduced
}

return {
Expand Down

0 comments on commit 3d0276b

Please sign in to comment.