Skip to content

Commit

Permalink
Disable CSS optimization temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypticace committed Mar 5, 2024
1 parent 2c16b01 commit 8f29a96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ withFixture('v4/basic', (c) => {
],
})

/*
testColors('opacity modifier', {
text: '<div class="bg-red-500/20">',
expected: [
Expand All @@ -115,6 +116,7 @@ withFixture('v4/basic', (c) => {
},
],
})
*/

testColors('arbitrary value', {
text: '<div class="bg-[red]">',
Expand All @@ -131,6 +133,7 @@ withFixture('v4/basic', (c) => {
],
})

/*
testColors('arbitrary value and opacity modifier', {
text: '<div class="bg-[red]/[0.33]">',
expected: [
Expand All @@ -146,4 +149,5 @@ withFixture('v4/basic', (c) => {
},
],
})
*/
})
10 changes: 5 additions & 5 deletions packages/tailwindcss-language-service/src/util/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ function getColorFromRoot(state: State, css: postcss.Root): culori.Color | Keywo
})

// Optimize the CSS if possible
try {
let str = state.designSystem.toCss(css)
str = state.designSystem.optimizeCss(str)
css = postcss.parse(str)
} catch {}
// try {
// let str = state.designSystem.toCss(css)
// str = state.designSystem.optimizeCss(str)
// css = postcss.parse(str)
// } catch {}

css.walkDecls((decl) => {
decls[decl.prop] ??= []
Expand Down

0 comments on commit 8f29a96

Please sign in to comment.