-
Notifications
You must be signed in to change notification settings - Fork 0
Add background-material explainer #1
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,82 @@ | ||||
| # background-material Explainer | ||||
|
|
||||
| ## Problem | ||||
|
|
||||
| Installed web apps cannot use OS-native translucent/material window frames, and HTML elements cannot request native material backplates. | ||||
|
|
||||
| ## Goals | ||||
|
|
||||
| - Allow installed web apps to opt into material-backed window frames. | ||||
| - Provide a CSS property for material-backed page and element surfaces. | ||||
| - Use abstract material names, not OS-specific names. | ||||
| - Preserve fallback behavior on platforms that do not support real materials. | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we simply ignore the material property. Similar to old browsers that don't understand material-background. |
||||
|
|
||||
| ## Non-goals | ||||
|
|
||||
| - Defining spatial layout. | ||||
| - Exposing sampled environment data to script. | ||||
| - Styling browser chrome. | ||||
| - Standardizing vendor material names. | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we do want to leave this open similar generic font names. |
||||
|
|
||||
| ## Proposal | ||||
|
|
||||
| Manifest: | ||||
|
|
||||
| ```json | ||||
| { | ||||
| "display": "standalone", | ||||
| "background_material": "regular" | ||||
| } | ||||
| ```` | ||||
|
|
||||
| CSS: | ||||
|
|
||||
| ```css | ||||
| :root { | ||||
| background-color: transparent; | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the background-color doesn't have to be transparent for the material to work.
Suggested change
|
||||
| background-material: regular; | ||||
| } | ||||
|
|
||||
| .panel { | ||||
| background-material: regular; | ||||
| border-radius: 12px; | ||||
| } | ||||
| ``` | ||||
|
|
||||
| Initial values: | ||||
|
|
||||
| ```css | ||||
| none | transparent | thin | regular | thick | ||||
| ``` | ||||
|
|
||||
| ## Why manifest + CSS? | ||||
|
|
||||
| The manifest opt-in gates top-level window transparency because it affects OS-level app chrome and has spoofing risk. | ||||
|
|
||||
| CSS controls the actual visual treatment after the app has opted in. | ||||
|
|
||||
| ## Relationship to backdrop-filter | ||||
|
|
||||
| [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter) samples DOM content behind an element. | ||||
|
|
||||
| `background-material` samples the OS/environment surface behind the web surface where the UA supports that composition. | ||||
|
|
||||
| For normal opaque browser tabs, authors should generally use [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter). | ||||
|
|
||||
| ## Prior work | ||||
|
|
||||
| * [Microsoft Edge Materials in Web Applications explainer](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Materials/explainer.md) | ||||
| * [WebSpatial `background-material` API](https://webspatial.dev/docs/api/react-sdk/css-api/background-material) | ||||
| * [CSS Spatial Layout Module Level 1 explainer](https://webkit.github.io/explainers/css-spatial/Overview.html) | ||||
| * [Web App Manifest](https://www.w3.org/TR/appmanifest/) | ||||
| * [WICG](https://wicg.io/) | ||||
|
|
||||
| ## Open questions | ||||
|
|
||||
| * Final value vocabulary. | ||||
| * Whether per-element rendering is required or optional. | ||||
| * Fallback behavior when real materials are unavailable. | ||||
| * Interaction with [`prefers-reduced-transparency`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-transparency). | ||||
| * Contrast/accessibility guidance. | ||||
| * Feature detection using [`@supports`](https://developer.mozilla.org/en-US/docs/Web/CSS/@supports) and/or a media feature. | ||||
|
|
||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's be open to both. There's going to be lot of arguments on this.