-
Notifications
You must be signed in to change notification settings - Fork 3.4k
how to disable theming globally? #943
Comments
Hi @coderhaoxin, the Hope that helps! -Marc ps. One more word of caution about this solution: The themeing api is still under discussion (see #537 for example), so while the above solution works now, it could very well change in the near future. Good luck! |
thanks. But I want to disable theming globally. |
There is no way to turn theming off globally that I know of, but you could change the default theme to a non-existent one globally by configuring the app.config(function($mdThemingProvider) {
$mdThemingProvider.setDefaultTheme('none');
}); |
yeah, it works. |
Sorry to mention this again, but i don't like that behaviour. I think these theming stuff should be done via SASS and not be injected via javascript. Even when setting it to 'none' the default theme will be injected. |
Yeah, at least "none" should remove the default, it is a pain to inspect everything and override a large amount of styles. A SASS config and more control over this would make the whole thing more usable. |
Would kind of like to bring this question/issue back to life.. All things needed for the themes are still loaded and executed. Surely there must/should be away to really disable it? |
I am pretty sure that material is doing too much stuff in js at the moment. I think there would be a dramatic performance increase when doing layout and theming stuff in scss. I am using stuff like sass-material-colors in my themes and i am also able to define a lot of stuff. I also had issues with browser compatibily which i solved in scss with bourbon. |
And it you are not using themes in this matter?... What if you don't benefit from the themes?... Just think there would be an option to disable it.. |
I think it's a misunderstanding. I want to be able to disable the themes in javascript and write the theme information in SCSS. 👍 for doing something like $mdThemingProvider.setDefaultTheme('none'); |
When you specify it like $mdThemingProvider.setDefaultTheme('none'); it will still look for a theme with the name "none". And it will add a lot of references to your "none" theme.. So you are not disabling themes you are just calling a none existing theme ;) |
Yes, i know.... The idea was that i think that it should be possible to completely disable the theme. |
A member of our team just found out that can override the constans. // Setting this will result in not adding theme classes on components
.constant("$MD_THEME_CSS",""); Try it out and tell us if it works for you! |
That helped a lot. Thanks. |
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.
@mackelito Thank you for that constant! We're using angular-material for the first time at my company, and our css guy doesn't really like overwriting styles but rather structure his own from the ground up. This has helped a lot! |
Is it possiable to add a option to enable/disable theming globally
The text was updated successfully, but these errors were encountered: