Feature request.
ViewEncapsulation.Native (shadow DOM) is supported.
Not supported as of beta2.
https://plnkr.co/edit/cYf5hUx1GLXrMLSCg4ci?p=preview
Change the ViewEncapsulation between Native and Emulated.
Native (Shadow DOM) doesn't work with material beta2.
Support shadow DOM.
"@angular/common": "4.0.0-rc.1",
"@angular/compiler": "4.0.0-rc.1",
"@angular/core": "4.0.0-rc.1",
"@angular/flex-layout": "2.0.0-rc.1",
"@angular/forms": "4.0.0-rc.1",
"@angular/http": "4.0.0-rc.1",
"@angular/material": "2.0.0-beta.2",
Chrome on Win10.
Nope.
This would be fantastic and well placed in the web component future.
Can this be bumped up in priority? We have widgets that are being used by third parties and we are running into css bleeding into the components on certain sites. And we are having to deal with them individually. Would be fantastic and save us a lot of headaches if ViewEncapsulation.Native will be supported soon.
Since this was lacking an official comment:
We don't currently support ViewEncapsulation.Native because our theming requires global styles. Once we are able to use css custom properties (i.e. not support IE11), then we will make the switch.
should add to https://github.com/angular/material2/issues/7374
Code splitting does not work at all for Angular Material's CSS due to this issue, and the initial HTML response of an universal app become so huge when one include Angular Material into the app.
Isn't it possible using some other strategy for theming?
For example, sass-loader accepts variables passed from webpack.config.
@kimamula see https://material.angular.io/guide/theming#theming-only-certain-components
You can manually create a CSS file that includes only the styles you need for an SSR page.
@jelbourn Thanks.
Is it possible to apply theme to lazily loaded Angular Material components without including their CSS into the initial page response?
You'd have to load the theme file at the same time as the component or else you'd see a flash of unstyled content
Thanks, it seems working.
But if Angular Material stops depending on global CSS, I don't have to manage the code splitting myself.
I am sorry that this may be a little bit off topic, though.
Also ViewEncapsulation.ShadowDom (v1 spec) kills Angular Material. Even if the Material css is global. It would be really nice to see some clear documentation about this.
I agree that this should be documented in the Getting Started Guide or another commonly read location.
Note that there is already an open issue tracking the need to document this for ViewEncapsulation.ShadowDom.
Most helpful comment
Also ViewEncapsulation.ShadowDom (v1 spec) kills Angular Material. Even if the Material css is global. It would be really nice to see some clear documentation about this.