This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useState, useEffect, useRef} from "react" | |
export default function () { | |
const {current} = useRef(matchMedia("(prefers-color-scheme: dark)")); | |
const [match, setMatches] = useState(current.matches); | |
useEffect(() => { | |
const updateMatch = () => { | |
setMatch(current.matches); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@function svg-gradient($type, $transform, $colors...) { | |
$stops: ""; | |
@each $color, $offset in $colors { | |
$stops: $stops + "<stop offset='#{$offset}' stop-color='#{$color}' />"; | |
} | |
@return url( | |
"data:image/svg+xml;utf8,\ | |
<svg xmlns='http://www.w3.org/2000/svg'> \ | |
<#{$type}Gradient id='grad' style='gradient-transform: #{$transform};'> \ | |
#{$stops} \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Emitter<E extends Record<string, new (...args: any[]) => Event>> extends EventTarget { | |
constructor(public events: E) { | |
super(); | |
} | |
on<T extends keyof E>(event: T, listener: (e: InstanceType<E[T]>) => void) { | |
this.addEventListener(event as string, listener as (e: Event) => void); | |
return this; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
html { | |
font-family: sans-serif; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
html { | |
font-family: sans-serif; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
html { | |
font-family: sans-serif; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
html { | |
font-family: sans-serif; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
box-sizing: border-box; | |
} | |
html { | |
font-family: sans-serif; | |
} |