diff --git a/api-goldens/element-ng/icon/index.api.md b/api-goldens/element-ng/icon/index.api.md index 510946514c..c6f01dad97 100644 --- a/api-goldens/element-ng/icon/index.api.md +++ b/api-goldens/element-ng/icon/index.api.md @@ -20,7 +20,6 @@ export const elementCheckedImageShape = "data:image/svg+xml;base64,PHN2ZyBpZD0iS // @public export interface IconConfig { - disableSvgIcons?: boolean; } // @public diff --git a/projects/element-ng/icon/si-icon.component.spec.ts b/projects/element-ng/icon/si-icon.component.spec.ts index 631074acd4..ebde33ae0b 100644 --- a/projects/element-ng/icon/si-icon.component.spec.ts +++ b/projects/element-ng/icon/si-icon.component.spec.ts @@ -7,7 +7,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { SiThemeService } from '@siemens/element-ng/theme'; -import { provideIconConfig, SiIconComponent } from './si-icon.component'; +import { SiIconComponent } from './si-icon.component'; import { addIcons, IconService } from './si-icons'; // It seems like the debug element is not able to query the SVGs. @@ -41,9 +41,6 @@ describe('SiSvgIconComponent', () => { describe('with enabled svg icons', () => { beforeEach(async () => { - TestBed.configureTestingModule({ - providers: [provideIconConfig({ disableSvgIcons: false })] - }); fixture = TestBed.createComponent(TestHostComponent); component = fixture.componentInstance; fixture.detectChanges(); @@ -109,24 +106,6 @@ describe('SiSvgIconComponent', () => { }); }); }); - - describe('with disabled svg icons', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [provideIconConfig({ disableSvgIcons: true })] - }); - fixture = TestBed.createComponent(TestHostComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should always use the icon-font', () => { - component.icon.set('element-svg'); - fixture.detectChanges(); - expect(getIconHostStyle()).toBe(''); - expect(fixture.debugElement.query(By.css('.element-svg'))).toBeTruthy(); - }); - }); }); describe('with multiple instances', () => { diff --git a/projects/element-ng/icon/si-icon.component.ts b/projects/element-ng/icon/si-icon.component.ts index f481c9fc70..8b2317f305 100644 --- a/projects/element-ng/icon/si-icon.component.ts +++ b/projects/element-ng/icon/si-icon.component.ts @@ -17,18 +17,12 @@ import { IconService } from './si-icons'; /** * Global configuration for icons. */ -export interface IconConfig { - /** - * If true, the si-icon component will always render the icon font instead of the svg. - * - * @defaultValue false - */ - disableSvgIcons?: boolean; -} +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface IconConfig {} const ICON_CONFIG = new InjectionToken('ICON_CONFIG', { providedIn: 'root', - factory: () => ({ disableSvgIcons: false }) + factory: () => ({}) }); /** @@ -82,11 +76,10 @@ export class SiIconComponent { */ readonly icon = input.required(); - private readonly config = inject(ICON_CONFIG); private readonly iconService = inject(IconService); protected readonly svgIcon = computed(() => { - const icon = this.config.disableSvgIcons ? undefined : this.iconService.getIcon(this.icon()); + const icon = this.iconService.getIcon(this.icon()); if (!icon) { return undefined; }