Skip to content

Commit 3d0276b

Browse files
authored
Fix bug related to prose color helpers not working as expected (#107)
1 parent bc9592e commit 3d0276b

File tree

2 files changed

+95
-1
lines changed

2 files changed

+95
-1
lines changed

src/index.test.js

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24693,3 +24693,97 @@ it('should be possible to override backticks for the inline `code` tag', async (
2469324693
"
2469424694
`)
2469524695
})
24696+
24697+
it('should be possible to add colors without 600 and still get default and custom prose color helpers created', async () => {
24698+
expect(
24699+
await diffOnly(
24700+
{},
24701+
{
24702+
theme: {
24703+
extend: {
24704+
colors: {
24705+
'darkish-red': '#a85555',
24706+
'darkish-green': {
24707+
600: '#55a855',
24708+
},
24709+
},
24710+
},
24711+
},
24712+
}
24713+
)
24714+
).toMatchInlineSnapshot(`
24715+
"
24716+
24717+
+ .prose-darkish-green a {
24718+
+ color: #55a855;
24719+
+ }
24720+
+
24721+
+ .prose-darkish-green a code {
24722+
+ color: #55a855;
24723+
+ }
24724+
+
24725+
24726+
---
24727+
24728+
+ }
24729+
+
24730+
+ .sm\\\\:prose-darkish-green a {
24731+
+ color: #55a855;
24732+
+ }
24733+
+
24734+
+ .sm\\\\:prose-darkish-green a code {
24735+
+ color: #55a855;
24736+
24737+
---
24738+
24739+
+ }
24740+
+
24741+
+ .md\\\\:prose-darkish-green a {
24742+
+ color: #55a855;
24743+
+ }
24744+
+
24745+
+ .md\\\\:prose-darkish-green a code {
24746+
+ color: #55a855;
24747+
24748+
---
24749+
24750+
+ }
24751+
+
24752+
+ .lg\\\\:prose-darkish-green a {
24753+
+ color: #55a855;
24754+
24755+
---
24756+
24757+
+
24758+
+ .lg\\\\:prose-darkish-green a code {
24759+
+ color: #55a855;
24760+
+ }
24761+
24762+
---
24763+
24764+
+ }
24765+
+
24766+
+ .xl\\\\:prose-darkish-green a {
24767+
+ color: #55a855;
24768+
24769+
---
24770+
24771+
+
24772+
+ .xl\\\\:prose-darkish-green a code {
24773+
+ color: #55a855;
24774+
+ }
24775+
24776+
---
24777+
24778+
+ }
24779+
+
24780+
+ .\\\\32xl\\\\:prose-darkish-green a {
24781+
+ color: #55a855;
24782+
+ }
24783+
+
24784+
+ .\\\\32xl\\\\:prose-darkish-green a code {
24785+
+ color: #55a855;
24786+
24787+
"
24788+
`)
24789+
})

src/styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ module.exports = (theme) => ({
10751075
// Add color modifiers
10761076
...Object.entries(theme('colors')).reduce((reduced, [color, values]) => {
10771077
if (!isUsableColor(color, values)) {
1078-
return {}
1078+
return reduced
10791079
}
10801080

10811081
return {

0 commit comments

Comments
 (0)