daniel-nagy / md-data-table

Material Design Data Table for Angular Material
MIT License
1.9k stars 520 forks source link

Using $mdThemingProvider to register styles #607

Open vwillyams opened 7 years ago

vwillyams commented 7 years ago

Removes hardcoded styling and allows users to define their own angular-material styling using $mdThemingProvider like they do for the rest of angular-material components.

(Note that I also dropped some coloring from md-toolbar because it was jarring and inconsistent with the rest of angular-material styling, otherwise all styles should be virtually identical using the angular-material default theme)

vwillyams commented 7 years ago

I noticed that this previously didn't resolve https://github.com/daniel-nagy/md-data-table/issues/422 so I went back and resolved all the issues there, along with a few bonus fixes and a new button added to the template for testing

vwillyams commented 7 years ago

FYI: example functionality in https://codepen.io/vwillyams/pen/KvdYjZ (using very ugly theme as the alternate, to show off how it works)

pkcat commented 7 years ago

Works in pages but font color not changing in a md-dialog after switching to dark theme

vwillyams commented 7 years ago

@pkcat please provide a replication, I was unable to replicate this - see https://codepen.io/vwillyams/pen/Nvjyrz for a quickly hacked together example of this working

pkcat commented 7 years ago

@vwillyams seems the cause is that I'm using angular material version 1.1.4, I have theme saved in $rootScope (eg. $rootScope.theme = 'alternate') and put md-theme="{{$root.theme}}" inside md-dialog tag then the theme is applied to all components in the dialog except font color..

vwillyams commented 7 years ago

@pkcat this scenario is now fixed (was bypassing the normal theme inheritance)

pkcat commented 7 years ago

@vwillyams thanks it works perfectly now

alexwohlbruck commented 7 years ago

Merge?

valepu commented 6 years ago

Any chance on this to be merged?