-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Disabling Theming? #7959
Comments
Try this... // Setting this will result in not adding theme classes on components
angular(myApp, [ ngMaterial, myAppModules ]).constant("$MD_THEME_CSS","");
|
Thanks! |
Would absolutely love for this to be officially supported by Angular Material. We're finding that the Angular Material stylings have bit us a few times as thing shift around. |
Support config-time disabling of Theming which in turn prevents dynamic theme css generation and stylesheet injections. ```js angular .module('myApp',['ngMaterial']) .config(['$mdThemingProvider', function($mdThemingProvider ){ $mdThemingProvider.disableTheming(); }]); ``` Refs angular#943. Closes angular#7959.
Folks I have a few questions as I'm struggling with this.
PS: we're trying to use angular material, but we have a very custom look and feel and hoping the path isn't overriding every css they force apply. Thank you! |
@yazzibrahim some people want to have the components but have them styled their own way. Do know you're on the AngularJS material project and not Angular (which you may refer to Angular 2) if you want to use the material compatible with Angular please take a look at angular/material2 |
@yazzibrahim There is also a huge performance benefit to precompile the theme and then disable theming.
Although now in 1.0.9 it seems disableTheming is no longer a function, stumbled on this thread while looking for a solution. Edit: Ah, now it looks like you need to use "app.constant("$MD_THEME_CSS","")" to disable theming. Quite the workaround for a very useful feature. Not sure why the team decided to remove disableTheming(). |
After reading through #980, this looks to be the solution to my problem. I agree that it feels like a hacky workaround really. |
After testing, |
Indeed |
I do not have an interest in using the theming provided by Angular Material via $mdThemingProvider. I'd rather control the styles of the page through CSS, which is where it should be. I have tried creating a custom palette to define my color scheme, but I notice that onHover for certain elements, Angular Material decides that it wants to create it's own colors.
I saw this issue: #943 and noticed that the solution was to set the default theme to none. Therefore, you'd be referencing a non-existent theme. That solution throws console logs and reverts to the default Angular Material theme regardless. And in the same issue, it is noted that you may override the constant for the default theme via a constant in the config block.
Any idea how I may just disable $mdThemingProvider all together and perform styling in the CSS without getting overwritten by the style tags that $mdThemingProvider throws on the HTML?
I am using Angular-Material 1.0.6
The text was updated successfully, but these errors were encountered: