From e505e5c4ec931f009205c7d632cc0a30612952a1 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 10 Aug 2022 10:26:46 -0400 Subject: [PATCH 1/2] Correct ring color list when using `respectDefaultRingColorOpacity` --- src/util/getAllConfigs.js | 5 +++-- tests/basic-usage.test.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/util/getAllConfigs.js b/src/util/getAllConfigs.js index f8364540e5b2..70e20ca5a306 100644 --- a/src/util/getAllConfigs.js +++ b/src/util/getAllConfigs.js @@ -11,9 +11,10 @@ export default function getAllConfigs(config) { // Add experimental configs here... respectDefaultRingColorOpacity: { theme: { - ringColor: { + ringColor: ({ theme }) => ({ DEFAULT: '#3b82f67f', - }, + ...theme('colors'), + }), }, }, } diff --git a/tests/basic-usage.test.js b/tests/basic-usage.test.js index e72596615c84..d310fc0e3a28 100644 --- a/tests/basic-usage.test.js +++ b/tests/basic-usage.test.js @@ -661,3 +661,31 @@ it('A bare ring-opacity utility is supported when using respectDefaultRingColorO `) }) }) + +it('Ring color utilities are generated when using respectDefaultRingColorOpacity', () => { + let config = { + future: { respectDefaultRingColorOpacity: true }, + content: [{ raw: html`
` }], + corePlugins: { preflight: false }, + } + + let input = css` + @tailwind utilities; + ` + + return run(input, config).then((result) => { + expect(result.css).toMatchFormattedCss(css` + .ring { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) + var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) + var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); + } + .ring-blue-500 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity)); + } + `) + }) +}) From 064ab4ceacbf995abb5c945e8dd874bc79139d36 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 10 Aug 2022 10:29:43 -0400 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e40bf5beac2..b2b7695b4457 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Use absolute paths when resolving changed files for resilience against working directory changes ([#9032](https://github.com/tailwindlabs/tailwindcss/pull/9032)) +- Fix ring color utility generation when using `respectDefaultRingColorOpacity` ([#9070](https://github.com/tailwindlabs/tailwindcss/pull/9070)) ## [3.1.8] - 2022-08-05