Skip to content

Commit e2e0183

Browse files
authoredSep 30, 2021
Reference colors from tailwindcss/colors instead of defaultTheme (#206)
* Reference colors from tailwindcss/colors instead of defaultTheme * Update tests
1 parent c287eb7 commit e2e0183

File tree

2 files changed

+57214
-25332
lines changed

2 files changed

+57214
-25332
lines changed
 

‎src/index.test.js

+57,192-25,310
Large diffs are not rendered by default.

‎src/styles.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const defaultTheme = require('tailwindcss/defaultTheme')
1+
const colors = require('tailwindcss/colors')
22
const { isUsableColor } = require('./utils')
33

44
const round = (num) =>
@@ -13,18 +13,18 @@ module.exports = (theme) => ({
1313
DEFAULT: {
1414
css: [
1515
{
16-
color: theme('colors.gray.700', defaultTheme.colors.gray[700]),
16+
color: theme('colors.gray.700', colors.gray[700]),
1717
maxWidth: '65ch',
1818
'[class~="lead"]': {
19-
color: theme('colors.gray.600', defaultTheme.colors.gray[600]),
19+
color: theme('colors.gray.600', colors.gray[600]),
2020
},
2121
a: {
22-
color: theme('colors.gray.900', defaultTheme.colors.gray[900]),
22+
color: theme('colors.gray.900', colors.gray[900]),
2323
textDecoration: 'underline',
2424
fontWeight: '500',
2525
},
2626
strong: {
27-
color: theme('colors.gray.900', defaultTheme.colors.gray[900]),
27+
color: theme('colors.gray.900', colors.gray[900]),
2828
fontWeight: '600',
2929
},
3030
'ol[type="A"]': {
@@ -61,27 +61,27 @@ module.exports = (theme) => ({
6161
content: 'counter(list-item, var(--list-counter-style, decimal)) "."',
6262
position: 'absolute',
6363
fontWeight: '400',
64-
color: theme('colors.gray.500', defaultTheme.colors.gray[500]),
64+
color: theme('colors.gray.500', colors.gray[500]),
6565
},
6666
'ul > li': {
6767
position: 'relative',
6868
},
6969
'ul > li::before': {
7070
content: '""',
7171
position: 'absolute',
72-
backgroundColor: theme('colors.gray.300', defaultTheme.colors.gray[300]),
72+
backgroundColor: theme('colors.gray.300', colors.gray[300]),
7373
borderRadius: '50%',
7474
},
7575
hr: {
76-
borderColor: theme('colors.gray.200', defaultTheme.colors.gray[200]),
76+
borderColor: theme('colors.gray.200', colors.gray[200]),
7777
borderTopWidth: 1,
7878
},
7979
blockquote: {
8080
fontWeight: '500',
8181
fontStyle: 'italic',
82-
color: theme('colors.gray.900', defaultTheme.colors.gray[900]),
82+
color: theme('colors.gray.900', colors.gray[900]),
8383
borderLeftWidth: '0.25rem',
84-
borderLeftColor: theme('colors.gray.200', defaultTheme.colors.gray[200]),
84+
borderLeftColor: theme('colors.gray.200', colors.gray[200]),
8585
quotes: '"\\201C""\\201D""\\2018""\\2019"',
8686
},
8787
'blockquote p:first-of-type::before': {
@@ -91,38 +91,38 @@ module.exports = (theme) => ({
9191
content: 'close-quote',
9292
},
9393
h1: {
94-
color: theme('colors.gray.900', defaultTheme.colors.gray[900]),
94+
color: theme('colors.gray.900', colors.gray[900]),
9595
fontWeight: '800',
9696
},
9797
'h1 strong': {
9898
fontWeight: '900',
9999
},
100100
h2: {
101-
color: theme('colors.gray.900', defaultTheme.colors.gray[900]),
101+
color: theme('colors.gray.900', colors.gray[900]),
102102
fontWeight: '700',
103103
},
104104
'h2 strong': {
105105
fontWeight: '800',
106106
},
107107
h3: {
108-
color: theme('colors.gray.900', defaultTheme.colors.gray[900]),
108+
color: theme('colors.gray.900', colors.gray[900]),
109109
fontWeight: '600',
110110
},
111111
'h3 strong': {
112112
fontWeight: '700',
113113
},
114114
h4: {
115-
color: theme('colors.gray.900', defaultTheme.colors.gray[900]),
115+
color: theme('colors.gray.900', colors.gray[900]),
116116
fontWeight: '600',
117117
},
118118
'h4 strong': {
119119
fontWeight: '700',
120120
},
121121
'figure figcaption': {
122-
color: theme('colors.gray.500', defaultTheme.colors.gray[500]),
122+
color: theme('colors.gray.500', colors.gray[500]),
123123
},
124124
code: {
125-
color: theme('colors.gray.900', defaultTheme.colors.gray[900]),
125+
color: theme('colors.gray.900', colors.gray[900]),
126126
fontWeight: '600',
127127
},
128128
'code::before': {
@@ -132,11 +132,11 @@ module.exports = (theme) => ({
132132
content: '"`"',
133133
},
134134
'a code': {
135-
color: theme('colors.gray.900', defaultTheme.colors.gray[900]),
135+
color: theme('colors.gray.900', colors.gray[900]),
136136
},
137137
pre: {
138-
color: theme('colors.gray.200', defaultTheme.colors.gray[200]),
139-
backgroundColor: theme('colors.gray.800', defaultTheme.colors.gray[800]),
138+
color: theme('colors.gray.200', colors.gray[200]),
139+
backgroundColor: theme('colors.gray.800', colors.gray[800]),
140140
overflowX: 'auto',
141141
},
142142
'pre code': {
@@ -164,17 +164,17 @@ module.exports = (theme) => ({
164164
marginBottom: em(32, 16),
165165
},
166166
thead: {
167-
color: theme('colors.gray.900', defaultTheme.colors.gray[900]),
167+
color: theme('colors.gray.900', colors.gray[900]),
168168
fontWeight: '600',
169169
borderBottomWidth: '1px',
170-
borderBottomColor: theme('colors.gray.300', defaultTheme.colors.gray[300]),
170+
borderBottomColor: theme('colors.gray.300', colors.gray[300]),
171171
},
172172
'thead th': {
173173
verticalAlign: 'bottom',
174174
},
175175
'tbody tr': {
176176
borderBottomWidth: '1px',
177-
borderBottomColor: theme('colors.gray.200', defaultTheme.colors.gray[200]),
177+
borderBottomColor: theme('colors.gray.200', colors.gray[200]),
178178
},
179179
'tbody tr:last-child': {
180180
borderBottomWidth: '0',

0 commit comments

Comments
 (0)
Please sign in to comment.