Skip to content

Add Media queries #1673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f6e2785
Add prefers- media queries
jamesnw Aug 23, 2024
f58d9a3
Update spec
jamesnw Aug 23, 2024
872e3da
Add Interaction media queries
jamesnw Aug 27, 2024
690f2ce
Merge branch 'prefer-queries' of https://github.com/oddbird/web-featu…
jamesnw Aug 27, 2024
6a48ca7
Rename new media query features
jamesnw Aug 27, 2024
e139452
Add media-queries group
jamesnw Aug 27, 2024
78c1c6a
Add resolution media query
jamesnw Aug 27, 2024
ce9ff25
Add media queries base
jamesnw Aug 27, 2024
ec9906e
Add more media features, change query to feature where applicable
jamesnw Aug 27, 2024
368d22e
Add color-gamut
jamesnw Aug 27, 2024
0249768
Add groups
jamesnw Aug 27, 2024
71694ee
Merge branch 'main' into media-queries
jamesnw Aug 28, 2024
b5a9d5a
Merge branch 'main' of github.com:web-platform-dx/web-features into m…
jamesnw Sep 3, 2024
a2b00f4
Address review
jamesnw Sep 3, 2024
263fcb4
Merge branch 'main' of github.com:web-platform-dx/web-features into m…
jamesnw Sep 12, 2024
f7c3c5c
Merge branch 'main' of github.com:web-platform-dx/web-features into m…
jamesnw Sep 16, 2024
ba1662e
Rename media features and files
jamesnw Sep 16, 2024
bfdd479
Remove dsstore
jamesnw Sep 16, 2024
0c150de
Remove color gamut values
jamesnw Sep 16, 2024
ff4f9d5
Merge branch 'main' into media-queries
jamesnw Sep 17, 2024
8e8aba6
Add more media queries
jamesnw Sep 17, 2024
280587b
Address review
jamesnw Sep 18, 2024
7453fff
Remove resolution media query
jamesnw Sep 18, 2024
586f86d
Review
jamesnw Sep 18, 2024
0414415
Merge branch 'main' of github.com:web-platform-dx/web-features into m…
jamesnw Sep 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions features/media-queries-color-gamut.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: color-gamut media feature
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applies to other files too: we don't explain here the difference between media query, media type, and media feature. I don't know that we need to do this, we're not a documentation website like MDN. But here, for example, the ID is media-queries-color-gamut while the name is color-gamut media feature.

Perhaps we should only use the term media-feature for media feature things, and then add a short mention in the main media-queries feature like "Media queries are composed of an optional media type such as screen or print, and one or more mandatory media features, such as prefers-reduced-animations".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I struggled on the naming for this. I think media feature is perhaps more spec language than developer language, but I think your addition to media-queries makes sense.

For the id, I'm realizing that I was essentially adding the group to the file name, with the side benefit of being able to see them together in the file list. Would you recommend media-feature-color-gamut, color-gamut-media-feature, or just color-gamut?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a good clarification to the media-queries feature, and still I would consider naming the individual features e.g. color-gamut media query as a more common way for developers to talk about these features.

I don't have a strong sense on IDs, but looking at what's there, I think we're past the point of naming things in a way that is nicely sorted. Folders by group would be more helpful on that front.

description: The `color-gamut` media feature sets styles based on the colors a device can display. Values are `srgb` if the device can display at least sRGB, `p3` if the device can display at least Display P3, and `rec2020` if the device can display at least REC. 2020.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if color-gamut is a field that evolves quickly, but if it is, we might want to drop the "Values are ..." sentence, to avoid having to maintain this to always be complete.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on conversations with spec authors and implementors, this should be a rather stable list. There are privacy issues with going more granular, and it's unlikely that gamuts larger than rec2020 will be needed soon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the color() function now supports a number of additional spaces with distinct gamuts, I do wonder if there will be a push for consistency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll remove the values.

spec: https://drafts.csswg.org/mediaqueries-5/#color-gamut
group: media-queries
compat_features:
- css.at-rules.media.color-gamut
16 changes: 16 additions & 0 deletions features/media-queries-color-gamut.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated from: media-queries-color-gamut.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: low
baseline_low_date: 2023-02-14
support:
chrome: "58"
chrome_android: "58"
edge: "79"
firefox: "110"
firefox_android: "110"
safari: "10"
safari_ios: "10"
compat_features:
- css.at-rules.media.color-gamut
7 changes: 7 additions & 0 deletions features/media-queries-display-mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: display-mode media feature
description: The `display-mode` CSS media feature sets styles based on whether the web page is in `fullscreen`, `standalone`, `minimal-ui,` `browser`, or `picture-in-picture` mode.
spec: https://drafts.csswg.org/mediaqueries-5/#display-modes
group: media-queries
compat_features:
- css.at-rules.media.display-mode
- css.at-rules.media.display-mode.picture-in-picture
25 changes: 25 additions & 0 deletions features/media-queries-display-mode.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated from: media-queries-display-mode.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: false
support:
chrome: "123"
edge: "123"
compat_features:
# baseline: false
# support:
# chrome: "42"
# chrome_android: "42"
# edge: "79"
# firefox: "47"
# safari: "13"
# safari_ios: "12.2"
- css.at-rules.media.display-mode

# ⬇️ Same status as overall feature ⬇️
# baseline: false
# support:
# chrome: "123"
# edge: "123"
- css.at-rules.media.display-mode.picture-in-picture
6 changes: 6 additions & 0 deletions features/media-queries-dynamic-range.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: dynamic-range media feature
description: The `dynamic-range` CSS media feature sets styles based on whether a device can display at least `standard` range colors or at least `high` range colors. Non-visual devices will match neither.
spec: https://drafts.csswg.org/mediaqueries-5/#dynamic-range
group: media-queries
compat_features:
- css.at-rules.media.dynamic-range
16 changes: 16 additions & 0 deletions features/media-queries-dynamic-range.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated from: media-queries-dynamic-range.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: low
baseline_low_date: 2022-05-03
support:
chrome: "98"
chrome_android: "98"
edge: "98"
firefox: "100"
firefox_android: "100"
safari: "13.1"
safari_ios: "13.4"
compat_features:
- css.at-rules.media.dynamic-range
12 changes: 12 additions & 0 deletions features/media-queries-interaction.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Interaction media features
description: "The `pointer`, `any-pointer`, `hover`, and `any-hover` CSS media features set styles based on the presence of pointing devices and their ability to hover over elements. For example, a smartphone device would match the `(hover: none) and (pointer: coarse)` media feature."
spec: https://drafts.csswg.org/mediaqueries-5/#mf-interaction
caniuse: css-media-interaction
group: media-queries
status:
compute_from: css.at-rules.media.any-pointer
compat_features:
- css.at-rules.media.hover
- css.at-rules.media.any-hover
- css.at-rules.media.any-pointer
- css.at-rules.media.pointer
68 changes: 68 additions & 0 deletions features/media-queries-interaction.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Generated from: media-queries-interaction.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: high
baseline_low_date: 2018-12-11
baseline_high_date: 2021-06-11
support:
chrome: "41"
chrome_android: "41"
edge: "12"
firefox: "64"
firefox_android: "64"
safari: "9"
safari_ios: "9"
compat_features:
# baseline: high
# baseline_low_date: 2018-12-11
# baseline_high_date: 2021-06-11
# support:
# chrome: "38"
# chrome_android: "50"
# edge: "12"
# firefox: "64"
# firefox_android: "64"
# safari: "9"
# safari_ios: "9"
- css.at-rules.media.hover

# ⬇️ Same status as overall feature ⬇️
# baseline: high
# baseline_low_date: 2018-12-11
# baseline_high_date: 2021-06-11
# support:
# chrome: "41"
# chrome_android: "41"
# edge: "12"
# firefox: "64"
# firefox_android: "64"
# safari: "9"
# safari_ios: "9"
- css.at-rules.media.any-pointer

# baseline: high
# baseline_low_date: 2018-12-11
# baseline_high_date: 2021-06-11
# support:
# chrome: "41"
# chrome_android: "41"
# edge: "16"
# firefox: "64"
# firefox_android: "64"
# safari: "9"
# safari_ios: "9"
- css.at-rules.media.any-hover

# baseline: high
# baseline_low_date: 2018-12-11
# baseline_high_date: 2021-06-11
# support:
# chrome: "41"
# chrome_android: "50"
# edge: "12"
# firefox: "64"
# firefox_android: "64"
# safari: "9"
# safari_ios: "9"
- css.at-rules.media.pointer
6 changes: 6 additions & 0 deletions features/media-queries-inverted-colors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: inverted-colors media feature
description: The `inverted-colors` CSS media feature sets styles based on whether the user has inverted all colors, such as with mobile accessibility settings.
spec: https://drafts.csswg.org/mediaqueries-5/#inverted
group: media-queries
compat_features:
- css.at-rules.media.inverted-colors
10 changes: 10 additions & 0 deletions features/media-queries-inverted-colors.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Generated from: media-queries-inverted-colors.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: false
support:
safari: "9.1"
safari_ios: "10"
compat_features:
- css.at-rules.media.inverted-colors
9 changes: 9 additions & 0 deletions features/media-queries-overflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Overflow media features
description: The `overflow-block` and `overflow-inline` CSS media features set styles based on the way a device displays content that's larger than the viewport or page area. For example, a laptop lets users scroll to reveal content, while a printer displays overflowing content on additional pages.
spec:
- https://drafts.csswg.org/mediaqueries-5/#mf-overflow-block
- https://drafts.csswg.org/mediaqueries-5/#mf-overflow-inline
group: media-queries
compat_features:
- css.at-rules.media.overflow-block
- css.at-rules.media.overflow-inline
17 changes: 17 additions & 0 deletions features/media-queries-overflow.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated from: media-queries-overflow.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: low
baseline_low_date: 2023-09-18
support:
chrome: "113"
chrome_android: "113"
edge: "113"
firefox: "66"
firefox_android: "66"
safari: "17"
safari_ios: "17"
compat_features:
- css.at-rules.media.overflow-block
- css.at-rules.media.overflow-inline
6 changes: 6 additions & 0 deletions features/media-queries-prefers-contrast.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: prefers-contrast media feature
description: The `prefers-contrast` CSS media feature sets styles based on whether the user prefers more or less contrast.
spec: https://drafts.csswg.org/mediaqueries-5/#prefers-contrast
group: media-queries
compat_features:
- css.at-rules.media.prefers-contrast
16 changes: 16 additions & 0 deletions features/media-queries-prefers-contrast.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated from: media-queries-prefers-contrast.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: low
baseline_low_date: 2022-05-31
support:
chrome: "96"
chrome_android: "96"
edge: "96"
firefox: "101"
firefox_android: "101"
safari: "14.1"
safari_ios: "14.5"
compat_features:
- css.at-rules.media.prefers-contrast
6 changes: 6 additions & 0 deletions features/media-queries-prefers-reduced-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: prefers-reduced-data media feature
description: The `prefers-reduced-data` CSS media feature detects whether the user has a preference for using less internet traffic. For example, you can use this media feature to avoid loading large font files and use a system font instead.
spec: https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-data
group: media-queries
compat_features:
- css.at-rules.media.prefers-reduced-data
8 changes: 8 additions & 0 deletions features/media-queries-prefers-reduced-data.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Generated from: media-queries-prefers-reduced-data.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: false
support: {}
compat_features:
- css.at-rules.media.prefers-reduced-data
12 changes: 12 additions & 0 deletions features/media-queries-prefers-reduced-motion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: prefers-reduced-motion media feature
description: The `prefers-reduced-motion` CSS media feature sets styles based on whether the user prefers to minimize the amount of non-essential animations on the device.
spec:
- https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion
- https://wicg.github.io/user-preference-media-features-headers/#sec-ch-prefers-reduced-motion
caniuse: prefers-reduced-motion
group: media-queries
status:
compute_from: css.at-rules.media.prefers-reduced-motion
compat_features:
- css.at-rules.media.prefers-reduced-motion
- http.headers.Sec-CH-Prefers-Reduced-Motion
36 changes: 36 additions & 0 deletions features/media-queries-prefers-reduced-motion.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated from: media-queries-prefers-reduced-motion.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: high
baseline_low_date: 2020-01-15
baseline_high_date: 2022-07-15
support:
chrome: "74"
chrome_android: "74"
edge: "79"
firefox: "63"
firefox_android: "64"
safari: "10.1"
safari_ios: "10.3"
compat_features:
# ⬇️ Same status as overall feature ⬇️
# baseline: high
# baseline_low_date: 2020-01-15
# baseline_high_date: 2022-07-15
# support:
# chrome: "74"
# chrome_android: "74"
# edge: "79"
# firefox: "63"
# firefox_android: "64"
# safari: "10.1"
# safari_ios: "10.3"
- css.at-rules.media.prefers-reduced-motion

# baseline: false
# support:
# chrome: "108"
# chrome_android: "108"
# edge: "108"
- http.headers.Sec-CH-Prefers-Reduced-Motion
9 changes: 9 additions & 0 deletions features/media-queries-prefers-reduced-transparency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: prefers-reduced-transparency media feature
description: The `prefers-reduced-transparency` CSS media feature sets styles based on whether the user prefers to reduce the amount of transparent effects on their device, for example to improve contrast and readability.
spec:
- https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-transparency
- https://wicg.github.io/user-preference-media-features-headers/#sec-ch-prefers-reduced-transparency
group: media-queries
compat_features:
- css.at-rules.media.prefers-reduced-transparency
- http.headers.Sec-CH-Prefers-Reduced-Transparency
24 changes: 24 additions & 0 deletions features/media-queries-prefers-reduced-transparency.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated from: media-queries-prefers-reduced-transparency.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: false
support:
chrome: "119"
chrome_android: "119"
edge: "119"
compat_features:
# baseline: false
# support:
# chrome: "118"
# chrome_android: "118"
# edge: "118"
- css.at-rules.media.prefers-reduced-transparency

# ⬇️ Same status as overall feature ⬇️
# baseline: false
# support:
# chrome: "119"
# chrome_android: "119"
# edge: "119"
- http.headers.Sec-CH-Prefers-Reduced-Transparency
11 changes: 11 additions & 0 deletions features/media-queries-resolution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: resolution media feature
description: The `resolution` CSS media feature sets styles based on the pixel density, or how many pixels a device uses to display a single CSS pixel.
spec: https://drafts.csswg.org/mediaqueries-5/#resolution
caniuse: css-media-resolution
compat_features:
- css.at-rules.media.resolution
- css.types.resolution
- css.types.resolution.dpcm
- css.types.resolution.dpi
- css.types.resolution.dppx
- css.types.resolution.x
Loading