Skip to content

Commit

Permalink
fix(paper): fix default style
Browse files Browse the repository at this point in the history
  • Loading branch information
Enlcxx committed Dec 11, 2018
1 parent f50d85e commit 416f53b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lib/src/theme/paper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Directive, OnChanges, ElementRef, NgZone, OnDestroy, Input, OnInit } from '@angular/core';
import { Directive, OnChanges, ElementRef, NgZone, OnDestroy, Input, OnInit, Renderer2 } from '@angular/core';
import { LyTheme2 } from './theme2.service';
import { mixinStyleUpdater, mixinBg, mixinRaised, mixinOutlined, mixinElevation, mixinShadowColor, mixinDisableRipple, mixinColor } from '../common/index';
import { toBoolean } from '../minimal/is-boolean';
Expand Down Expand Up @@ -48,7 +48,8 @@ export class LyPaper extends LyPaperMixinBase implements OnChanges, OnInit, OnDe
constructor(
theme: LyTheme2,
ngZone: NgZone,
private _el: ElementRef
private _el: ElementRef,
private _renderer: Renderer2
) {
super(theme, ngZone);
this.setAutoContrast();
Expand All @@ -63,6 +64,13 @@ export class LyPaper extends LyPaperMixinBase implements OnChanges, OnInit, OnDe
ngOnInit() {
if (!this.bg && !this.hasText) {
this.bg = DEFAULT_BG;
this.updateStyle(this._el);
this._renderer.addClass(this._el.nativeElement, this._theme.addSimpleStyle(
'lyPaper',
({
display: 'block'
})
));
}
}

Expand Down

0 comments on commit 416f53b

Please sign in to comment.