Skip to content

Commit 08cd05f

Browse files
committed
Disable color swatches for mask utilities
This is a performance optimization right now because an additional 5k utilities makes things take a really long time
1 parent b8660bd commit 08cd05f

File tree

1 file changed

+4
-0
lines changed
  • packages/tailwindcss-language-service/src/util

1 file changed

+4
-0
lines changed

packages/tailwindcss-language-service/src/util/color.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,13 @@ function getColorFromRoot(state: State, css: postcss.Root): culori.Color | Keywo
191191
let isNegative = /^-/
192192
let isNumericUtility =
193193
/^-?((min-|max-)?[wh]|z|start|order|opacity|rounded|row|col|size|basis|end|duration|ease|font|top|left|bottom|right|inset|leading|cursor|(space|scale|skew|rotate)-[xyz]|gap(-[xy])?|(scroll-)?[pm][trblxyse]?)-/
194+
let isMaskUtility = /^-?mask-/
194195

195196
function isLikelyColorless(className: string) {
196197
if (isNegative.test(className)) return true
198+
// TODO: This is **not** correct but is intentional because there are 5k mask utilities and a LOT of them are colors
199+
// This causes a massive slowdown when building the design system
200+
if (isMaskUtility.test(className)) return true
197201
if (isNumericUtility.test(className)) return true
198202
return false
199203
}

0 commit comments

Comments
 (0)