Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit dee5055

Browse files
author
Matty Goo
authored
feat(button): removed dark theme from buttons (#2038)
1 parent 402e17a commit dee5055

File tree

5 files changed

+3
-58
lines changed

5 files changed

+3
-58
lines changed

demos/button.html

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@
3030
padding-bottom: 100px;
3131
}
3232

33-
.demo-wrapper.mdc-theme--dark{
34-
background-color: #333;
35-
}
36-
37-
.demo-wrapper.mdc-theme--dark fieldset legend, .demo-wrapper.mdc-theme--dark h1 {
38-
color: #f0f0f0;
39-
}
40-
4133
fieldset {
4234
padding: 24px;
4335
padding-top: 0;
@@ -102,19 +94,6 @@
10294
</section>
10395

10496
<section class="demo-wrapper">
105-
<div class="mdc-form-field">
106-
<div class="mdc-checkbox">
107-
<input type="checkbox" class="mdc-checkbox__native-control" id="toggle-dark" aria-labelledby="toggle-dark-label">
108-
<div class="mdc-checkbox__background">
109-
<svg class="mdc-checkbox__checkmark" viewBox="0 0 24 24">
110-
<path class="mdc-checkbox__checkmark__path" fill="none" stroke="white" d="M1.73,12.91 8.1,19.28 22.79,4.59">
111-
</svg>
112-
<div class="mdc-checkbox__mixedmark"></div>
113-
</div>
114-
</div>
115-
<label for="toggle-dark" id="toggle-dark-label">Dark Theme</label>
116-
</div>
117-
11897
<div class="mdc-form-field">
11998
<div class="mdc-checkbox">
12099
<input type="checkbox" class="mdc-checkbox__native-control" id="toggle-disabled" aria-labelledby="toggle-disabled-label">
@@ -364,15 +343,6 @@ <h1 class="mdc-typography--display2">CSS Only</h1>
364343
mdc.ripple.MDCRipple.attachTo(btn);
365344
}
366345

367-
var demoWrapper = document.querySelector('.demo-wrapper');
368-
document.getElementById('toggle-dark').addEventListener('change', function() {
369-
if (this.checked) {
370-
demoWrapper.classList.add('mdc-theme--dark');
371-
} else {
372-
demoWrapper.classList.remove('mdc-theme--dark');
373-
}
374-
});
375-
376346
document.getElementById('toggle-disabled').addEventListener('change', function() {
377347
var isDisabled = this.checked;
378348
[].forEach.call(document.querySelectorAll('button'), function(button) {

demos/button.scss

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,16 @@
2525
.mdc-button.secondary-text-button {
2626
@include mdc-button-ink-color($mdc-theme-secondary);
2727
@include mdc-states(secondary);
28-
29-
@include mdc-theme-dark(".mdc-button") {
30-
@include mdc-button-ink-color($mdc-theme-secondary);
31-
@include mdc-states(secondary);
32-
}
3328
}
3429

3530
.mdc-button.secondary-filled-button {
3631
@include mdc-button-filled-accessible($mdc-theme-secondary);
37-
38-
@include mdc-theme-dark(".mdc-button") {
39-
@include mdc-button-filled-accessible($mdc-theme-secondary);
40-
}
4132
}
4233

4334
.mdc-button.secondary-stroked-button {
4435
@include mdc-button-ink-color($mdc-theme-secondary);
4536
@include mdc-button-stroke-color($mdc-theme-secondary);
46-
@include mdc-states(secondary);
4737

48-
@include mdc-theme-dark(".mdc-button") {
49-
@include mdc-button-ink-color($mdc-theme-secondary);
50-
@include mdc-button-stroke-color($mdc-theme-secondary);
51-
@include mdc-states(secondary);
52-
}
5338
}
5439

5540
.mdc-button.big-round-corner-button {

demos/common.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fieldset {
4747
border: 0;
4848
}
4949

50+
// TODO mgoo: remove these dark theme when complete with removing other components
5051
.mdc-button {
5152
@include mdc-theme-dark {
5253
@include mdc-button-ink-color($dark-button-color);

packages/mdc-button/_mixins.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@
123123

124124
cursor: default;
125125
pointer-events: none;
126-
127-
@include mdc-theme-dark(".mdc-button") {
128-
@include mdc-theme-prop(color, text-disabled-on-dark);
129-
}
130126
}
131127
}
132128

@@ -145,22 +141,13 @@
145141

146142
&:disabled {
147143
@include mdc-theme-prop(border-color, text-disabled-on-light);
148-
149-
@include mdc-theme-dark(".mdc-button") {
150-
@include mdc-theme-prop(border-color, text-disabled-on-dark);
151-
}
152144
}
153145
}
154146

155147
@mixin mdc-button--filled_() {
156148
&:disabled {
157149
@include mdc-theme-prop(background-color, rgba(black, .12));
158150
@include mdc-theme-prop(color, text-disabled-on-light);
159-
160-
@include mdc-theme-dark(".mdc-button") {
161-
@include mdc-theme-prop(background-color, rgba(white, .12));
162-
@include mdc-theme-prop(color, text-disabled-on-light);
163-
}
164151
}
165152
}
166153

packages/mdc-theme/_mixins.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@
109109
// }
110110
// }
111111
// ```
112+
113+
// TODO: matt goo - remove this once all dark theme is removed
112114
@mixin mdc-theme-dark($root-selector: null, $compound: false) {
113115
@if ($root-selector) {
114116
@at-root {

0 commit comments

Comments
 (0)