Add support for negative css custom properties
This commit is contained in:
parent
7877ffab8a
commit
c3075d97fe
1 changed files with 4 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue