Skip to content

Commit fb05c11

Browse files
committed
Improve list-demo in dark-theme
1 parent a3b9f8d commit fb05c11

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

src/demo-app/list/list-demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ <h1>md-list demo</h1>
33

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

6-
<div class="demo">
6+
<div class="list-demo">
77
<div>
88
<h2>Normal lists</h2>
99

src/demo-app/list/list-demo.scss

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
.demo {
1+
.list-demo {
32
display: flex;
43
flex-flow: row wrap;
54

@@ -9,20 +8,32 @@
98
margin: 20px 20px 0 0;
109

1110
}
11+
1212
h2 {
1313
margin-top: 20px;
1414
}
15+
}
16+
17+
/* Theme for the list-item demo elements. */
18+
@mixin demo-list-item-theme($dark: false) {
19+
$base-color: if($dark, rgba(255, 255, 255, 1), rgba(0, 0, 0, 1));
1520

16-
.mat-icon {
17-
color: rgba(0, 0, 0, 0.12);
21+
.list-demo .mat-icon {
22+
color: rgba($base-color, 0.12);
1823
}
1924

20-
.mat-list-icon {
25+
.list-demo .mat-list-icon {
2126
color: white;
22-
background: rgba(0, 0, 0, 0.3);
27+
background: rgba($base-color, 0.3);
28+
}
29+
30+
.list-demo .demo-secondary-text {
31+
color: rgba($base-color, 0.54);
2332
}
2433
}
2534

26-
.demo-secondary-text {
27-
color: rgba(0, 0, 0, 0.54);
35+
@include demo-list-item-theme(false);
36+
37+
.demo-dark-theme {
38+
@include demo-list-item-theme(true)
2839
}

src/demo-app/list/list-demo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import {Component} from '@angular/core';
1+
import {Component, ViewEncapsulation} from '@angular/core';
22

33

44
@Component({
55
moduleId: module.id,
66
selector: 'list-demo',
77
templateUrl: 'list-demo.html',
88
styleUrls: ['list-demo.css'],
9+
encapsulation: ViewEncapsulation.None
910
})
1011
export class ListDemo {
1112
items: string[] = [

0 commit comments

Comments
 (0)