Skip to content

Commit cd4effd

Browse files
committed
Fix regex comments
1 parent 163a451 commit cd4effd

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/inject/dynamic-theme/variables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ function isTextColorProperty(property: string) {
683683
return property === 'color' || property === 'caret-color' || property === '-webkit-text-fill-color';
684684
}
685685

686-
// [number], [number], [number]
686+
// [number] [number] [number]
687687
const rawRGBSpaceRegex = /^(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})$/;
688688
// [number], [number], [number]
689689
const rawRGBCommaRegex = /^(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})$/;

src/utils/color.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export function parse($color: string): RGBA | null {
180180
}
181181

182182
if (c.startsWith('light-dark(') && c.endsWith(')')) {
183+
// light-dark([color()], [color()])
183184
const match = c.match(/^light-dark\(\s*([a-z]+(\(.*\))?),\s*([a-z]+(\(.*\))?)\s*\)$/);
184185
if (match) {
185186
const schemeColor = isSystemDarkModeEnabled() ? match[3] : match[1];

0 commit comments

Comments
 (0)