mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Add support for negative css custom properties
This commit is contained in:
parent
7877ffab8a
commit
c3075d97fe
@ -3,6 +3,7 @@ import isFunction from 'lodash/isFunction'
|
||||
import defaults from 'lodash/defaults'
|
||||
import map from 'lodash/map'
|
||||
import toPath from 'lodash/toPath'
|
||||
import startsWith from 'lodash/startsWith'
|
||||
|
||||
const configUtils = {
|
||||
negative(scale) {
|
||||
@ -11,7 +12,9 @@ const configUtils = {
|
||||
.reduce(
|
||||
(negativeScale, key) => ({
|
||||
...negativeScale,
|
||||
[`-${key}`]: `-${scale[key]}`,
|
||||
[`-${key}`]: startsWith(scale[key], 'var(')
|
||||
? `calc(${scale[key]} * -1)`
|
||||
: `-${scale[key]}`,
|
||||
}),
|
||||
{}
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user