Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Use the background color from $mdTheme #153

Open
lyschoening opened this issue Oct 13, 2015 · 10 comments
Open

Use the background color from $mdTheme #153

lyschoening opened this issue Oct 13, 2015 · 10 comments

Comments

@lyschoening
Copy link

The md-data-table and md-data-table-toolbar components currently ignore the background color of the theme.

@brianfeister
Copy link

+1

3 similar comments
@zack24q
Copy link

zack24q commented Jan 29, 2016

+1

@lengers
Copy link

lengers commented Feb 18, 2016

+1

@trahloff
Copy link

+1

@trahloff
Copy link

Look at md-data-table/app/app.js. You will see these lines:

  .config(['$mdThemingProvider', function ($mdThemingProvider) {
    'use strict';

    $mdThemingProvider.theme('default')
      .primaryPalette('blue')
      .accentPalette('pink');
  }]);

You can adjust the used palette to your delight or erase those lines and your web app will use the theme that you provided at other parts of your code.

@Ziack
Copy link

Ziack commented Apr 29, 2016

+1

@Soren234
Copy link

Soren234 commented Aug 9, 2016

+1

Adding dark() to $mdThemingProvider is ignored.
*Edit
Sorry added the right codepen.
http://codepen.io/soren234/pen/GqwzJW?editors=1010

@wmichaelfeltman
Copy link

Um, no it's not and not in that codepen.

@1mike12
Copy link

1mike12 commented Oct 27, 2016

The reason there's a lot of conflict is that including the stylsheet from md-data-table has hardcoded css color values, but not including it means we don't get any of the layout from it. Here's a scss override for dark backgrounds, it's not perfect but it's better than it was before.

$mdTableBorderColor: rgba(175, 175, 175, .22);
$activeBackground : #323232;
//for floating edit
md-edit-dialog>.md-content md-input-container input {
  color: #000;
}
table.md-table td.md-cell.md-placeholder {
  color: #777;
}
table.md-table td.md-cell md-select > .md-select-value > span.md-select-icon {
  color: #FFF;
}

table.md-table th.md-column {
  color: #FFF;
}

table.md-table th.md-column.md-active, table.md-table th.md-column.md-active md-icon {
  color: #FFF;
}

table.md-table td.md-cell {
  color: #FFF;
}

table.md-table.md-row-select tbody.md-body > tr.md-row:not([disabled]) td.md-cell {
  color: #FFF;
}

table.md-table.md-row-select tbody.md-body>tr.md-row:not([disabled]):hover {
  background-color: $activeBackground !important;
}

.md-table-pagination {
  color: #FFF;
}

table.md-table.md-row-select tbody.md-body>tr.md-row.md-selected {
  background-color: $activeBackground;
}

.md-table-pagination {
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-justify-content: flex-end;
  -ms-flex-pack: end;
  justify-content: flex-end;
  -webkit-flex-wrap: wrap-reverse;
  -ms-flex-wrap: wrap-reverse;
  flex-wrap: wrap-reverse;
  box-sizing: border-box;
  padding: 0 24px;
  font-size: 12px;
  border-top: 1px $mdTableBorderColor solid;
}

table.md-table td.md-cell {
  font-size: 13px;
  border-top: 1px $mdTableBorderColor solid;
}

@vwillyams
Copy link

Created a PR which should resolve this (now that angular-material has added the $mdThemingProvider.registerStyles method): #607

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants