Skip to content

Commit

Permalink
feat(button): removed dark theme from buttons (#2038)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matty Goo authored Jan 23, 2018
1 parent 402e17a commit dee5055
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 58 deletions.
30 changes: 0 additions & 30 deletions demos/button.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@
padding-bottom: 100px;
}

.demo-wrapper.mdc-theme--dark{
background-color: #333;
}

.demo-wrapper.mdc-theme--dark fieldset legend, .demo-wrapper.mdc-theme--dark h1 {
color: #f0f0f0;
}

fieldset {
padding: 24px;
padding-top: 0;
Expand Down Expand Up @@ -102,19 +94,6 @@
</section>

<section class="demo-wrapper">
<div class="mdc-form-field">
<div class="mdc-checkbox">
<input type="checkbox" class="mdc-checkbox__native-control" id="toggle-dark" aria-labelledby="toggle-dark-label">
<div class="mdc-checkbox__background">
<svg class="mdc-checkbox__checkmark" viewBox="0 0 24 24">
<path class="mdc-checkbox__checkmark__path" fill="none" stroke="white" d="M1.73,12.91 8.1,19.28 22.79,4.59">
</svg>
<div class="mdc-checkbox__mixedmark"></div>
</div>
</div>
<label for="toggle-dark" id="toggle-dark-label">Dark Theme</label>
</div>

<div class="mdc-form-field">
<div class="mdc-checkbox">
<input type="checkbox" class="mdc-checkbox__native-control" id="toggle-disabled" aria-labelledby="toggle-disabled-label">
Expand Down Expand Up @@ -364,15 +343,6 @@ <h1 class="mdc-typography--display2">CSS Only</h1>
mdc.ripple.MDCRipple.attachTo(btn);
}

var demoWrapper = document.querySelector('.demo-wrapper');
document.getElementById('toggle-dark').addEventListener('change', function() {
if (this.checked) {
demoWrapper.classList.add('mdc-theme--dark');
} else {
demoWrapper.classList.remove('mdc-theme--dark');
}
});

document.getElementById('toggle-disabled').addEventListener('change', function() {
var isDisabled = this.checked;
[].forEach.call(document.querySelectorAll('button'), function(button) {
Expand Down
15 changes: 0 additions & 15 deletions demos/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,16 @@
.mdc-button.secondary-text-button {
@include mdc-button-ink-color($mdc-theme-secondary);
@include mdc-states(secondary);

@include mdc-theme-dark(".mdc-button") {
@include mdc-button-ink-color($mdc-theme-secondary);
@include mdc-states(secondary);
}
}

.mdc-button.secondary-filled-button {
@include mdc-button-filled-accessible($mdc-theme-secondary);

@include mdc-theme-dark(".mdc-button") {
@include mdc-button-filled-accessible($mdc-theme-secondary);
}
}

.mdc-button.secondary-stroked-button {
@include mdc-button-ink-color($mdc-theme-secondary);
@include mdc-button-stroke-color($mdc-theme-secondary);
@include mdc-states(secondary);

@include mdc-theme-dark(".mdc-button") {
@include mdc-button-ink-color($mdc-theme-secondary);
@include mdc-button-stroke-color($mdc-theme-secondary);
@include mdc-states(secondary);
}
}

.mdc-button.big-round-corner-button {
Expand Down
1 change: 1 addition & 0 deletions demos/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ fieldset {
border: 0;
}

// TODO mgoo: remove these dark theme when complete with removing other components
.mdc-button {
@include mdc-theme-dark {
@include mdc-button-ink-color($dark-button-color);
Expand Down
13 changes: 0 additions & 13 deletions packages/mdc-button/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@

cursor: default;
pointer-events: none;

@include mdc-theme-dark(".mdc-button") {
@include mdc-theme-prop(color, text-disabled-on-dark);
}
}
}

Expand All @@ -145,22 +141,13 @@

&:disabled {
@include mdc-theme-prop(border-color, text-disabled-on-light);

@include mdc-theme-dark(".mdc-button") {
@include mdc-theme-prop(border-color, text-disabled-on-dark);
}
}
}

@mixin mdc-button--filled_() {
&:disabled {
@include mdc-theme-prop(background-color, rgba(black, .12));
@include mdc-theme-prop(color, text-disabled-on-light);

@include mdc-theme-dark(".mdc-button") {
@include mdc-theme-prop(background-color, rgba(white, .12));
@include mdc-theme-prop(color, text-disabled-on-light);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/mdc-theme/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
// }
// }
// ```

// TODO: matt goo - remove this once all dark theme is removed
@mixin mdc-theme-dark($root-selector: null, $compound: false) {
@if ($root-selector) {
@at-root {
Expand Down

0 comments on commit dee5055

Please sign in to comment.