Skip to content

Commit

Permalink
fix(slide-toggle): remove view encapsulation
Browse files Browse the repository at this point in the history
* Removes the ViewEncapsulation from the slide-toggle component to allow developer overwriting the styles easly.

Fixes angular#1343.
  • Loading branch information
devversion committed Oct 6, 2016
1 parent 0b5b6f2 commit f2944c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/slide-toggle/slide-toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $md-slide-toggle-margin: 16px !default;
@include md-temporary-ink-ripple(slide-toggle, true);
}

:host {
md-slide-toggle {
display: flex;
height: $md-slide-toggle-height;

Expand Down
4 changes: 3 additions & 1 deletion src/lib/slide-toggle/slide-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
AfterContentInit,
NgModule,
ModuleWithProviders,
ViewEncapsulation,
} from '@angular/core';
import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser';
import {
Expand Down Expand Up @@ -50,6 +51,7 @@ let nextId = 0;
templateUrl: 'slide-toggle.html',
styleUrls: ['slide-toggle.css'],
providers: [MD_SLIDE_TOGGLE_VALUE_ACCESSOR],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MdSlideToggle implements AfterContentInit, ControlValueAccessor {
Expand All @@ -61,7 +63,7 @@ export class MdSlideToggle implements AfterContentInit, ControlValueAccessor {
private _uniqueId = `md-slide-toggle-${++nextId}`;
private _checked: boolean = false;
private _color: string;
_hasFocus: boolean = false;
private _hasFocus: boolean = false;
private _isMousedown: boolean = false;
private _slideRenderer: SlideToggleRenderer = null;

Expand Down

0 comments on commit f2944c6

Please sign in to comment.