marko-js / tags

Not quite core components.
MIT License
22 stars 11 forks source link

fix: don't run match-media if it doesn't exist #74

Closed mlrawlings closed 4 months ago

mlrawlings commented 4 months ago

Scope

match-media

Description

Adds an additional guard to check if window.matchMedia exists

Motivation and Context

Prior version used process.browser. The window check will return true in environments that have window but aren't the browser (JSDOM, probably Deno)

Screenshots (if appropriate):

Checklist: