Skip to content

Commit

Permalink
fix(icon): set style priority
Browse files Browse the repository at this point in the history
  • Loading branch information
alyleui committed Sep 15, 2018
1 parent f7adf01 commit e4ea510
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/lib/icon/icon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Observable } from 'rxjs';
import { map, share } from 'rxjs/operators';
import { LyTheme2 } from '@alyle/ui';

const STYLE_PRIORITY = -1;

const styles = {
svg: {
width: 'inherit',
Expand All @@ -23,7 +25,7 @@ export interface SvgIcon {
})
export class LyIconService {
private svgMap = new Map<string, SvgIcon>();
classes = this.theme.addStyleSheet(styles, 'lyIcon');
classes = this.theme.addStyleSheet(styles, 'lyIcon', STYLE_PRIORITY);
constructor(
private http: HttpClient,
@Optional() @Inject(DOCUMENT) private document: any,
Expand Down
6 changes: 4 additions & 2 deletions src/lib/icon/icon.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Directive, Input, Renderer2, ElementRef, OnChanges, OnInit } from '@angular/core';
import { Directive, Input, Renderer2, ElementRef, OnInit } from '@angular/core';
import { LyIconService, SvgIcon } from './icon.service';
import { take } from 'rxjs/operators';
import { Platform, LyTheme2 } from '@alyle/ui';

const STYLE_PRIORITY = -1;

@Directive({
selector: 'ly-icon'
})
Expand Down Expand Up @@ -83,7 +85,7 @@ export class Icon implements OnInit {
`width:1em;` +
`height:1em;` +
`display:inline-flex;`
), this.elementRef.nativeElement);
), this.elementRef.nativeElement, undefined, STYLE_PRIORITY);
}

/**
Expand Down

0 comments on commit e4ea510

Please sign in to comment.