Skip to content

Commit a9a9284

Browse files
committed
feat: add media types
1 parent aad45e6 commit a9a9284

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/types/media.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export type MediaFeature = MediaFeatureNormal | MediaFeaturePrefix
2+
3+
export type MediaFeatureNormal =
4+
// level 3
5+
| 'width' | 'height' | 'device-width' | 'device-height' | 'orientation'
6+
| 'aspect-ratio' | 'device-aspect-ratio' | 'color' | 'color-index'
7+
| 'monochrome' | 'resolution' | 'scan' | 'grid'
8+
// level 4
9+
| 'update' | 'overflow-block' | 'overflow-inline' | 'color-gamut'
10+
| 'pointer' | 'hover' | 'any-pointer' | 'any-hover'
11+
12+
export type MediaFeaturePrefix =
13+
| 'max-width' | 'max-height' | 'max-device-width'
14+
| 'max-device-height' | 'max-aspect-ratio' | 'max-device-aspect-ratio'
15+
| 'max-color-index' | 'max-monochrome' | 'max-resolution' | 'max-color'
16+
| 'min-width' | 'min-height' | 'min-device-width' | 'min-device-height'
17+
| 'min-aspect-ratio' | 'min-device-aspect-ratio' | 'min-color'
18+
| 'min-color-index' | 'min-monochrome' | 'min-resolution'
19+
20+
export type MediaFeatureLevel5 =
21+
| 'horizontal-viewport-segments' | 'vertical-viewport-segments'
22+
| 'display-mode' | 'environment-blending' | 'dynamic-range'
23+
| 'inverted-colors' | 'nav-controls'
24+
| 'video-color-gamut' | 'video-dynamic-range' | 'scripting'
25+
| 'prefers-reduced-motion' | 'prefers-reduced-transparency'
26+
| 'prefers-contrast' | 'forced-colors' | 'prefers-color-scheme'
27+
| 'prefers-reduced-data'
28+
29+
export type MediaType = 'all' | 'screen' | 'print'

0 commit comments

Comments
 (0)