Add future flag to preserve custom, default ring color opacity (#8448)

* Add future flag to preserve ring color opacity

* Update changelog
This commit is contained in:
Jordan Pittman 2022-05-27 09:48:27 -04:00 • committed by GitHub
parent 029540893d
commit cab1fcecc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 258 additions and 9 deletions

View file

@ -1977,13 +1977,20 @@ export let corePlugins = {
)
},
ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme }) => {
let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
let ringColorDefault = withAlphaValue(
theme('ringColor')?.DEFAULT,
ringOpacityDefault,
`rgb(147 197 253 / ${ringOpacityDefault})`
)
ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme, config }) => {
let ringColorDefault = (() => {
if (flagEnabled(config(), 'respectDefaultRingColorOpacity')) {
return theme('ringColor.DEFAULT')
}
let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
return withAlphaValue(
theme('ringColor')?.DEFAULT,
ringOpacityDefault,
`rgb(147 197 253 / ${ringOpacityDefault})`
)
})()
addDefaults('ring-width', {
'--tw-ring-inset': ' ',

View file

@ -6,7 +6,7 @@ let defaults = {
}
let featureFlags = {
future: ['hoverOnlyWhenSupported'],
future: ['hoverOnlyWhenSupported', 'respectDefaultRingColorOpacity'],
experimental: ['optimizeUniversalDefaults', 'variantGrouping'],
}

View file

@ -9,6 +9,13 @@ export default function getAllConfigs(config) {
const features = {
// Add experimental configs here...
respectDefaultRingColorOpacity: {
theme: {
ringColor: {
DEFAULT: '#3b82f67f',
},
},
},
}
const experimentals = Object.keys(features)