add directive to completely disable automatic text color creation
This commit is contained in:
parent
a9efbd2553
commit
85d55c55e7
@ -8,7 +8,8 @@ export default {
|
|||||||
directives: {
|
directives: {
|
||||||
textColor: '--text',
|
textColor: '--text',
|
||||||
textOpacity: 0.5,
|
textOpacity: 0.5,
|
||||||
textOpacityMode: 'mixrgb'
|
textOpacityMode: 'mixrgb',
|
||||||
|
textAuto: 'no-auto'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -392,10 +392,13 @@ export const init = (extraRuleset, palette) => {
|
|||||||
const lowerLevelSelector = selector.split(/ /g).slice(0, -1).join(' ')
|
const lowerLevelSelector = selector.split(/ /g).slice(0, -1).join(' ')
|
||||||
const lowerLevelBackground = cache[lowerLevelSelector].background
|
const lowerLevelBackground = cache[lowerLevelSelector].background
|
||||||
|
|
||||||
const textColor = getTextColor(
|
|
||||||
convert(lowerLevelBackground).rgb,
|
|
||||||
// TODO properly provide "parent" text color?
|
// TODO properly provide "parent" text color?
|
||||||
convert(findColor(inheritedTextColor, null, lowerLevelBackground)).rgb,
|
const intendedTextColor = convert(findColor(inheritedTextColor, null, lowerLevelBackground)).rgb
|
||||||
|
const textColor = newTextRule.directives.textAuto === 'no-auto'
|
||||||
|
? intendedTextColor
|
||||||
|
: getTextColor(
|
||||||
|
convert(lowerLevelBackground).rgb,
|
||||||
|
intendedTextColor,
|
||||||
newTextRule.directives.textAuto === 'preserve'
|
newTextRule.directives.textAuto === 'preserve'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user