diff --git a/src/elements/core/config/config.ts b/src/elements/core/config/config.ts index 838ec7e0e7..7d0de3ceb4 100644 --- a/src/elements/core/config/config.ts +++ b/src/elements/core/config/config.ts @@ -22,12 +22,18 @@ export interface SbbConfig { export function readConfig(): SbbConfig { if (!('sbbConfig' in globalThis)) { - (globalThis as any).sbbConfig = {}; // TODO: fix any type + globalThis.sbbConfig = {}; } - return (globalThis as any).sbbConfig as SbbConfig; // TODO: fix any type + return globalThis.sbbConfig as SbbConfig; } export function mergeConfig(config: Partial): void { const oldConfig = readConfig(); Object.assign(oldConfig, config); } + +declare global { + // Only `var` is working + // eslint-disable-next-line no-var + var sbbConfig: SbbConfig; +} diff --git a/src/elements/icon/icon.snapshot.spec.ts b/src/elements/icon/icon.snapshot.spec.ts index a3593ef351..84d878f9e0 100644 --- a/src/elements/icon/icon.snapshot.spec.ts +++ b/src/elements/icon/icon.snapshot.spec.ts @@ -122,7 +122,7 @@ describe(`sbb-icon`, () => { let interceptorCalled = false; globalConfig.icon = {}; - const sbbIconConfig: SbbIconConfig = (globalThis as any).sbbConfig.icon; // TODO: fix any type + const sbbIconConfig: SbbIconConfig = globalThis.sbbConfig.icon!; sbbIconConfig.namespaces = new Map().set( 'kom', 'https://icons.app.sbb.ch/kom/', @@ -154,7 +154,7 @@ describe(`sbb-icon`, () => { expect(interceptorCalled).to.be.true; // Reset icon config - delete (globalThis as any).sbbConfig.icon; // TODO: fix any type + delete globalThis.sbbConfig.icon; }); testA11yTreeSnapshot(html``); diff --git a/src/elements/navigation/navigation/navigation.scss b/src/elements/navigation/navigation/navigation.scss index 4a47aabeef..3bee4cbb30 100644 --- a/src/elements/navigation/navigation/navigation.scss +++ b/src/elements/navigation/navigation/navigation.scss @@ -82,14 +82,8 @@ --sbb-navigation-content-transform: translateX(-100%); @include sbb.mq($from: 'large') { - --sbb-navigation-expanded-width: 100vw; + --sbb-navigation-expanded-width: 100dvw; --sbb-navigation-content-transform: translateX(0%); - - // Needed for backwards compatibility - // TODO: Remove once not needed - @supports (height: 100dvw) { - --sbb-navigation-expanded-width: 100dvw; - } } }