Skip to content

Commit d2608f7

Browse files
committed
#341 - set the colors of the various material controls to the active theme color. This includes buttons, checkboxes, radios, slide toggles, pagination controls, and the underbar color of active inputs
1 parent e4bed8a commit d2608f7

File tree

1 file changed

+144
-0
lines changed

1 file changed

+144
-0
lines changed

angular/src/shared/core.less

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,147 @@
1+
@red: #F24B50;
2+
@pink: #E20074;
3+
@purple: #9C27B0;
4+
@deep-purple: #673AB7;
5+
@indigo: #3F51B5;
6+
@blue: #2196F3;
7+
@light-blue: #03A9F4;
8+
@cyan: #00BCD4;
9+
@teal: #009688;
10+
@indigo: #3F51B5;
11+
@green: #4CAF50;
12+
@light-green: #8BC34A;
13+
@lime: #CDDC39;
14+
@yellow: #FFEB3B;
15+
@amber: #FFC107;
16+
@orange: #FF9800;
17+
@deep-orange: #FF5722;
18+
@brown: #795548;
19+
@grey: #9E9E9E;
20+
@blue-grey: #607D8B;
21+
@black: #000;
22+
23+
.make-theme(@color) {
24+
.sidebar .menu .list .ml-menu li.active a.toggled:not(.menu-toggle):before {
25+
color: @color;
26+
}
27+
.mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb {
28+
background-color: @color;
29+
}
30+
.mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar {
31+
background-color: fade(@color, 50%);
32+
}
33+
.mat-fab.mat-primary, .mat-mini-fab.mat-primary, .mat-raised-button.mat-primary {
34+
background-color: @color;
35+
}
36+
.mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle {
37+
border-color: @color;
38+
}
39+
.mat-radio-button.mat-accent .mat-radio-inner-circle {
40+
background-color: @color;
41+
}
42+
.mat-checkbox-checked.mat-accent .mat-checkbox-background, .mat-checkbox-indeterminate.mat-accent .mat-checkbox-background {
43+
background-color: @color;
44+
}
45+
.card .action .material-icons {
46+
color: @color !important;
47+
}
48+
/* add theme-links to a parent element to indicate that all children anchors should use the current theme's color */
49+
.theme-links a {
50+
color: @color !important;
51+
}
52+
.theme-active-link .active a {
53+
color: @color !important;
54+
}
55+
.theme-active-link a:hover {
56+
color: @color !important;
57+
}
58+
.theme-active-link a:focus {
59+
color: @color !important;
60+
}
61+
.ngx-pagination .current {
62+
background-color: @color;
63+
}
64+
.btn-primary, .btn-primary:hover, .btn-primary:active, .btn-primary:focus {
65+
background-color: @color !important;
66+
}
67+
a.dropdown-toggle {
68+
color: @color !important;
69+
}
70+
.mat-tab-group.mat-primary .mat-ink-bar, .mat-tab-nav-bar.mat-primary .mat-ink-bar {
71+
background-color: @color;
72+
}
73+
.mat-fab.mat-primary, .mat-flat-button.mat-primary, .mat-mini-fab.mat-primary, .mat-raised-button.mat-primary {
74+
background-color: @color;
75+
}
76+
.mat-form-field-invalid .mat-input-element, .mat-warn .mat-input-element {
77+
caret-color: @color;
78+
}
79+
}
80+
81+
.theme-red {
82+
.make-theme(@red)
83+
}
84+
.theme-pink {
85+
.make-theme(@pink)
86+
}
87+
.theme-purple {
88+
.make-theme(@purple)
89+
}
90+
.theme-deep-purple {
91+
.make-theme(@deep-purple)
92+
}
93+
.theme-indigo {
94+
.make-theme(@indigo)
95+
}
96+
.theme-blue {
97+
.make-theme(@blue)
98+
}
99+
.theme-light-blue {
100+
.make-theme(@light-blue)
101+
}
102+
.theme-cyan {
103+
.make-theme(@cyan)
104+
}
105+
.theme-teal {
106+
.make-theme(@teal)
107+
}
108+
.theme-indigo {
109+
.make-theme(@indigo)
110+
}
111+
.theme-green {
112+
.make-theme(@green)
113+
}
114+
.theme-light-green {
115+
.make-theme(@light-green)
116+
}
117+
.theme-lime {
118+
.make-theme(@lime)
119+
}
120+
.theme-yellow {
121+
.make-theme(@yellow)
122+
}
123+
.theme-amber {
124+
.make-theme(@amber)
125+
}
126+
.theme-orange {
127+
.make-theme(@orange)
128+
}
129+
.theme-deep-orange {
130+
.make-theme(@deep-orange)
131+
}
132+
.theme-brown {
133+
.make-theme(@brown)
134+
}
135+
.theme-grey {
136+
.make-theme(@grey)
137+
}
138+
.theme-blue-grey {
139+
.make-theme(@blue-grey)
140+
}
141+
.theme-black {
142+
.make-theme(@black)
143+
}
144+
1145
/* General */
2146

3147
.clickable-item {

0 commit comments

Comments
 (0)