(value: string)
| 727 | } |
| 728 | |
| 729 | export function getScrollbarColorModifier(value: string): string | CSSValueModifier | null { |
| 730 | const colorsMatch = value.match(/^\s*([a-z]+(\(.*\))?)\s+([a-z]+(\(.*\))?)\s*$/); |
| 731 | if (!colorsMatch) { |
| 732 | return value; |
| 733 | } |
| 734 | |
| 735 | const thumb = parseColorWithCache(colorsMatch[1]); |
| 736 | const track = parseColorWithCache(colorsMatch[3]); |
| 737 | if (!thumb || !track) { |
| 738 | logWarn("Couldn't parse color", ...([thumb, track].filter((c) => !c))); |
| 739 | return null; |
| 740 | } |
| 741 | |
| 742 | return (theme) => `${modifyForegroundColor(thumb, theme)} ${modifyBackgroundColor(track, theme)}`; |
| 743 | } |
| 744 | |
| 745 | export function getColorSchemeModifier(): CSSValueModifier { |
| 746 | return (theme: Theme) => theme.mode === 0 ? 'dark light' : 'dark'; |
no test coverage detected