Guidance On M3 Web JavaScript Requirement? #5412
Replies: 8 comments 17 replies
-
Yes, this Material Web Components library requires JavaScript. It is not a CSS-only library. We use JavaScript to fully support the visuals of the Material Design spec and the latest ARIA accessibility patterns. It is not possible to fully support either with only HTML and CSS. MWC uses autonomous custom elements, not customized built-in elements (aka If your application requires supporting JavaScript-disabled browsers, then our components will not be a good fit. However, you can still use our Sass tokens to style built-in elements like |
Beta Was this translation helpful? Give feedback.
-
If M3 Web customized native elements such as
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
OpenUI will straighten all this out in time...
|
Beta Was this translation helpful? Give feedback.
-
Closing since this discussion is resolved. Our web components, like many other UI libraries, require JavaScript to run and we will not be changing that. If this is a blocker, we do not recommend using our components. Instead, you could try using our Sass tokens API to create CSS for a near-Material experience using built-in elements without the functionality or accessibility features that require JavaScript. |
Beta Was this translation helpful? Give feedback.
-
I do see the tokens and I am excited to get the CSS only M3 working. Here's precisely what I tried. From a terminal in the location of |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure your command switch Can you share specific command or instruction on how I can get M3 CSS for an outlined button? |
Beta Was this translation helpful? Give feedback.
-
Customized built in elements continue to work in browsers with JavaScript disabled; The HTML standard describes how elements "automatically inherit semantics and behavior" of their parent class, e.g.
<select>
,<input>
, and<progress>
.Does Material 3 Web employ customized built-in elements or are M3 Web components autonomous custom elements, i.e.
extends HTMLElement
?If M3 team chose the autonomous custom element approach, can you explain rationale or value in not choosing customized built in elements?
When I disable JavaScript, the M3 Demo elements such as
<md-checkbox>
are not working? Is it safe to say that Material Design for Web requires JavaScript?Beta Was this translation helpful? Give feedback.
All reactions