Skip to content

Commit

Permalink
Improve list-demo in dark-theme
Browse files Browse the repository at this point in the history
  • Loading branch information
devversion committed Feb 14, 2017
1 parent a3b9f8d commit fb05c11
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/demo-app/list/list-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ <h1>md-list demo</h1>

<button md-raised-button (click)="thirdLine=!thirdLine" class="demo-button">Show third line</button>

<div class="demo">
<div class="list-demo">
<div>
<h2>Normal lists</h2>

Expand Down
27 changes: 19 additions & 8 deletions src/demo-app/list/list-demo.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

.demo {
.list-demo {
display: flex;
flex-flow: row wrap;

Expand All @@ -9,20 +8,32 @@
margin: 20px 20px 0 0;

}

h2 {
margin-top: 20px;
}
}

/* Theme for the list-item demo elements. */
@mixin demo-list-item-theme($dark: false) {
$base-color: if($dark, rgba(255, 255, 255, 1), rgba(0, 0, 0, 1));

.mat-icon {
color: rgba(0, 0, 0, 0.12);
.list-demo .mat-icon {
color: rgba($base-color, 0.12);
}

.mat-list-icon {
.list-demo .mat-list-icon {
color: white;
background: rgba(0, 0, 0, 0.3);
background: rgba($base-color, 0.3);
}

.list-demo .demo-secondary-text {
color: rgba($base-color, 0.54);
}
}

.demo-secondary-text {
color: rgba(0, 0, 0, 0.54);
@include demo-list-item-theme(false);

.demo-dark-theme {
@include demo-list-item-theme(true)
}
3 changes: 2 additions & 1 deletion src/demo-app/list/list-demo.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {Component} from '@angular/core';
import {Component, ViewEncapsulation} from '@angular/core';


@Component({
moduleId: module.id,
selector: 'list-demo',
templateUrl: 'list-demo.html',
styleUrls: ['list-demo.css'],
encapsulation: ViewEncapsulation.None
})
export class ListDemo {
items: string[] = [
Expand Down

0 comments on commit fb05c11

Please sign in to comment.