(theme: Theme)
| 222 | } |
| 223 | |
| 224 | function getModifiedScrollbarStyle(theme: Theme) { |
| 225 | let colorTrack: string; |
| 226 | let colorThumb: string; |
| 227 | if (theme.scrollbarColor === 'auto') { |
| 228 | colorTrack = modifyBackgroundColor({r: 241, g: 241, b: 241}, theme); |
| 229 | colorThumb = modifyBackgroundColor({r: 176, g: 176, b: 176}, theme); |
| 230 | } else { |
| 231 | const rgb = parseColorWithCache(theme.scrollbarColor)!; |
| 232 | const hsl = rgbToHSL(rgb); |
| 233 | const darken = (darker: number) => ({...hsl, l: clamp(hsl.l - darker, 0, 1)}); |
| 234 | colorTrack = hslToString(darken(0.4)); |
| 235 | colorThumb = hslToString(hsl); |
| 236 | } |
| 237 | return [ |
| 238 | `* {`, |
| 239 | ` scrollbar-color: ${colorThumb} ${colorTrack};`, |
| 240 | `}`, |
| 241 | ].join('\n'); |
| 242 | } |
| 243 | |
| 244 | export function getModifiedFallbackStyle(theme: Theme, {strict}: {strict: boolean}): string { |
| 245 | const factory = fallbackFactory || defaultFallbackFactory; |
no test coverage detected