Skip to content

Commit 857e2d3

Browse files
authored
Merge pull request #1627 from tailwindcss/alpha-colors
Add opacity modifiers for color utilities
2 parents 30e0cb1 + f94e2c3 commit 857e2d3

25 files changed

+24761
-521
lines changed

__tests__/fixtures/tailwind-output-important.css

+12,240
Large diffs are not rendered by default.

__tests__/fixtures/tailwind-output.css

+12,240
Large diffs are not rendered by default.

__tests__/flattenColorPalette.test.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import flattenColorPalette from '../src/util/flattenColorPalette'
2+
3+
test('it flattens nested color objects', () => {
4+
expect(
5+
flattenColorPalette({
6+
purple: 'purple',
7+
white: {
8+
25: 'rgba(255,255,255,.25)',
9+
50: 'rgba(255,255,255,.5)',
10+
75: 'rgba(255,255,255,.75)',
11+
default: '#fff',
12+
},
13+
red: {
14+
1: 'rgb(33,0,0)',
15+
2: 'rgb(67,0,0)',
16+
3: 'rgb(100,0,0)',
17+
},
18+
green: {
19+
1: 'rgb(0,33,0)',
20+
2: 'rgb(0,67,0)',
21+
3: 'rgb(0,100,0)',
22+
},
23+
blue: {
24+
1: 'rgb(0,0,33)',
25+
2: 'rgb(0,0,67)',
26+
3: 'rgb(0,0,100)',
27+
},
28+
})
29+
).toEqual({
30+
purple: 'purple',
31+
'white-25': 'rgba(255,255,255,.25)',
32+
'white-50': 'rgba(255,255,255,.5)',
33+
'white-75': 'rgba(255,255,255,.75)',
34+
white: '#fff',
35+
'red-1': 'rgb(33,0,0)',
36+
'red-2': 'rgb(67,0,0)',
37+
'red-3': 'rgb(100,0,0)',
38+
'green-1': 'rgb(0,33,0)',
39+
'green-2': 'rgb(0,67,0)',
40+
'green-3': 'rgb(0,100,0)',
41+
'blue-1': 'rgb(0,0,33)',
42+
'blue-2': 'rgb(0,0,67)',
43+
'blue-3': 'rgb(0,0,100)',
44+
})
45+
})

__tests__/plugins/backgroundColor.test.js

-83
This file was deleted.

__tests__/plugins/borderColor.test.js

-83
This file was deleted.

__tests__/plugins/divideColor.test.js

-89
This file was deleted.

__tests__/plugins/fill.test.js

-83
This file was deleted.

0 commit comments

Comments
 (0)