Skip to content

Commit 27bce5c

Browse files
committed
Add mix-blend-mode utilities
1 parent 21a96af commit 27bce5c

12 files changed

+1573
-0
lines changed

__tests__/fixtures/tailwind-output-flagged.css

+384
Large diffs are not rendered by default.

__tests__/fixtures/tailwind-output-important.css

+384
Large diffs are not rendered by default.

__tests__/fixtures/tailwind-output-no-color-opacity.css

+384
Large diffs are not rendered by default.

__tests__/fixtures/tailwind-output.css

+384
Large diffs are not rendered by default.

jit/corePlugins/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ module.exports = {
282282
placeholderOpacity: require('./placeholderOpacity'),
283283

284284
opacity: require('./opacity'),
285+
mixBlendMode: require('./mixBlendMode'),
285286
boxShadow: require('./boxShadow'),
286287
outline: require('./outline'),
287288
ringWidth: require('./ringWidth'),

jit/corePlugins/mixBlendMode.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('../../lib/plugins/mixBlendMode').default()

jit/tests/basic-usage.test.css

+6
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,12 @@
576576
.opacity-90 {
577577
opacity: 0.9;
578578
}
579+
.mix-multiply {
580+
mix-blend-mode: multiply;
581+
}
582+
.mix-saturation {
583+
mix-blend-mode: saturation;
584+
}
579585
.shadow-md {
580586
--tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
581587
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000),

jit/tests/basic-usage.test.html

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
<div class="object-cover"></div>
8989
<div class="object-bottom"></div>
9090
<div class="opacity-90"></div>
91+
<div class="mix-multiply mix-saturation"></div>
9192
<div class="order-last order-2"></div>
9293
<div class="outline-none outline-black"></div>
9394
<div class="overflow-hidden"></div>

src/corePluginList.js

+1
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,5 @@ export const corePluginList = [
120120
'transitionDuration',
121121
'transitionDelay',
122122
'animation',
123+
'mixBlendMode',
123124
]

src/plugins/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export { default as maxHeight } from './maxHeight'
7070
export { default as maxWidth } from './maxWidth'
7171
export { default as minHeight } from './minHeight'
7272
export { default as minWidth } from './minWidth'
73+
export { default as mixBlendMode } from './mixBlendMode'
7374
export { default as objectFit } from './objectFit'
7475
export { default as objectPosition } from './objectPosition'
7576
export { default as opacity } from './opacity'

src/plugins/mixBlendMode.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export default function () {
2+
return function ({ addUtilities, variants }) {
3+
addUtilities(
4+
{
5+
'.mix-normal': { 'mix-blend-mode': 'normal' },
6+
'.mix-multiply': { 'mix-blend-mode': 'multiply' },
7+
'.mix-screen': { 'mix-blend-mode': 'screen' },
8+
'.mix-overlay': { 'mix-blend-mode': 'overlay' },
9+
'.mix-darken': { 'mix-blend-mode': 'darken' },
10+
'.mix-lighten': { 'mix-blend-mode': 'lighten' },
11+
'.mix-color-dodge': { 'mix-blend-mode': 'color-dodge' },
12+
'.mix-color-burn': { 'mix-blend-mode': 'color-burn' },
13+
'.mix-hard-light': { 'mix-blend-mode': 'hard-light' },
14+
'.mix-soft-light': { 'mix-blend-mode': 'soft-light' },
15+
'.mix-difference': { 'mix-blend-mode': 'difference' },
16+
'.mix-exclusion': { 'mix-blend-mode': 'exclusion' },
17+
'.mix-hue': { 'mix-blend-mode': 'hue' },
18+
'.mix-saturation': { 'mix-blend-mode': 'saturation' },
19+
'.mix-color': { 'mix-blend-mode': 'color' },
20+
'.mix-luminosity': { 'mix-blend-mode': 'luminosity' },
21+
},
22+
variants('mixBlendMode')
23+
)
24+
}
25+
}

stubs/defaultConfig.stub.js

+1
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ module.exports = {
805805
maxWidth: ['responsive'],
806806
minHeight: ['responsive'],
807807
minWidth: ['responsive'],
808+
mixBlendMode: ['responsive'],
808809
objectFit: ['responsive'],
809810
objectPosition: ['responsive'],
810811
opacity: ['responsive', 'group-hover', 'focus-within', 'hover', 'focus'],

0 commit comments

Comments
 (0)