Skip to content

Commit

Permalink
Fix chart painter
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Dec 5, 2024
1 parent 0b3694c commit 1b2730a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions stores/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ export let support = map<SupportValue>({
p3: false
})

if (CSS.supports('color', 'color(display-p3 1 1 1)')) {
let media = window.matchMedia('(color-gamut:p3)')
support.set({ oklch: true, p3: media.matches })
media.addEventListener('change', () => {
support.setKey('p3', media.matches)
})
if (typeof window !== 'undefined') {
if (CSS.supports('color', 'color(display-p3 1 1 1)')) {
let media = window.matchMedia('(color-gamut:p3)')
support.set({ oklch: true, p3: media.matches })
media.addEventListener('change', () => {
support.setKey('p3', media.matches)
})
}
}

0 comments on commit 1b2730a

Please sign in to comment.