Skip to content

Commit

Permalink
Use simple variable handling for RGB colors only
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderby committed May 13, 2024
1 parent e21e36f commit bb7f9a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/inject/dynamic-theme/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class VariablesStore {

getModifierForVarDependant(property: string, sourceValue: string): CSSValueModifier | null {
const isConstructedColor = sourceValue.match(/^\s*(rgb|hsl)a?\(/);
const isSimpleConstructedColor = sourceValue.match(/^(rgb|hsl)a?\(var\(--[\-_A-Za-z0-9]+\)(\s*,?\/?\s*0?\.\d+)?\)$/);
const isSimpleConstructedColor = sourceValue.match(/^rgba?\(var\(--[\-_A-Za-z0-9]+\)(\s*,?\/?\s*0?\.\d+)?\)$/);
if (isConstructedColor && !isSimpleConstructedColor) {
const isBg = property.startsWith('background');
const isText = isTextColorProperty(property);
Expand Down

0 comments on commit bb7f9a5

Please sign in to comment.