diff --git a/CHANGELOG.md b/CHANGELOG.md index eddb2cb..b492b63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nothing yet! +## [0.5.9] - 2024-09-05 + +### Fixed + +- Fallback to static chevron color if theme is using variables ([#167](https://github.com/tailwindlabs/tailwindcss-forms/pull/167)) + ## [0.5.8] - 2024-08-28 ### Fixed @@ -154,7 +160,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Initial release! -[unreleased]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.8...HEAD +[unreleased]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.9...HEAD +[0.5.9]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.8...v0.5.9 [0.5.8]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.7...v0.5.8 [0.5.7]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.6...v0.5.7 [0.5.6]: https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.5...v0.5.6 diff --git a/package.json b/package.json index 410cd7e..92f0eb7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tailwindcss/forms", - "version": "0.5.8", + "version": "0.5.9", "main": "src/index.js", "types": "src/index.d.ts", "license": "MIT", diff --git a/src/index.js b/src/index.js index dd2953f..b86a224 100644 --- a/src/index.js +++ b/src/index.js @@ -11,6 +11,16 @@ function resolveColor(color, opacityVariableName) { const forms = plugin.withOptions(function (options = { strategy: undefined }) { return function ({ addBase, addComponents, theme }) { + function resolveChevronColor(color, fallback) { + let resolved = theme(color) + + if (!resolved || resolved.includes('var(')) { + return fallback + } + + return resolved.replace('', '1') + } + const strategy = options.strategy === undefined ? ['base', 'class'] : [options.strategy] const rules = [ @@ -153,9 +163,9 @@ const forms = plugin.withOptions(function (options = { strategy: undefined }) { class: ['.form-select'], styles: { 'background-image': `url("${svgToDataUri( - `` )}")`, 'background-position': `right ${spacing[2]} center`,