Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sbb-sidebar): initial implementation #3335

Merged
merged 110 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
c063cb0
feat(sbb-sidebar): first draft
jeripeierSBB Jan 8, 2025
4001124
fix: mini review Lukas
jeripeierSBB Jan 8, 2025
428eff8
feat: add toggle
jeripeierSBB Jan 8, 2025
2835f22
fix: stabilize
jeripeierSBB Jan 9, 2025
b0777d5
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Jan 20, 2025
a0b5747
feat: over mode part 1
jeripeierSBB Jan 20, 2025
a1cee7e
feat: over mode part 2 focusing
jeripeierSBB Jan 20, 2025
dc7121c
refactor: individually re-activate inertController
jeripeierSBB Jan 20, 2025
99f549f
fix: styling after sidebar removal
jeripeierSBB Jan 20, 2025
723f978
refactor: react to backdrop click over all area
jeripeierSBB Jan 20, 2025
c296ec4
refactor: add TODO to focusHandler
jeripeierSBB Jan 20, 2025
486b475
fix: integrity
jeripeierSBB Jan 20, 2025
8e29d4c
refactor: refactoring of title and close button structure
jeripeierSBB Jan 21, 2025
f951c16
feat: shadow depends on sticky state
jeripeierSBB Jan 21, 2025
13b6dd1
fix: linting
jeripeierSBB Jan 21, 2025
be2c504
fix: remove hide-close-button artifacts
jeripeierSBB Jan 22, 2025
f312916
test: fix them
jeripeierSBB Jan 22, 2025
a828f01
refactor: use scrollbar-gutter
jeripeierSBB Jan 22, 2025
1a8c372
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Jan 27, 2025
7e02b1b
feat: handle small spaces
jeripeierSBB Jan 27, 2025
82644e5
fix: fix SSR
jeripeierSBB Jan 28, 2025
77f065e
fix: review
jeripeierSBB Jan 28, 2025
0a07953
fix: consider initial setup for minimum space closing animation
jeripeierSBB Jan 28, 2025
b559a82
feat: allow closing and opening during animation
jeripeierSBB Jan 28, 2025
3aa5971
fix: integrity
jeripeierSBB Jan 28, 2025
4e78aa4
fix: scroll styling
jeripeierSBB Jan 29, 2025
a7d0c9a
docs: document components part 1
jeripeierSBB Jan 29, 2025
972c48a
fix: fix force type logic
jeripeierSBB Jan 30, 2025
4531ab5
refactor: extract base classes
jeripeierSBB Jan 30, 2025
09c4ef9
fix: restructure again
jeripeierSBB Feb 3, 2025
d86cc38
feat: icon sidebar part 1
jeripeierSBB Feb 3, 2025
2c63682
feat: icon-sidebar-button and link
jeripeierSBB Feb 3, 2025
0b744af
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Feb 3, 2025
6e546a3
feat: icon-sidebar-button and link basic styling
jeripeierSBB Feb 3, 2025
bcd8582
fix: fix tests
jeripeierSBB Feb 3, 2025
8ca120b
fix: fix linting
jeripeierSBB Feb 3, 2025
4c5777d
feat: implement icon sidebar buttons
jeripeierSBB Feb 4, 2025
0e1c408
fix: button visual regression tests
jeripeierSBB Feb 4, 2025
457f596
Merge branch 'main' into sidebar
jeripeierSBB Feb 4, 2025
e9cd6e4
docs: improve docs and remove negative mixin from titlebase
jeripeierSBB Feb 4, 2025
9da5d84
docs: improve docs of sidebar content
jeripeierSBB Feb 4, 2025
afdabca
docs: improve docs core.scss
jeripeierSBB Feb 4, 2025
4667210
Merge branch 'main' into sidebar
jeripeierSBB Feb 12, 2025
cc1925c
refactor: update focus visible design
jeripeierSBB Feb 12, 2025
9e6561b
fix: fix animation logic
jeripeierSBB Feb 13, 2025
38d71c7
docs: add tests and docs for container
jeripeierSBB Feb 13, 2025
2325060
docs: add icon-sidebar-container docs
jeripeierSBB Feb 13, 2025
fa9fadf
Merge branch 'main' into sidebar
jeripeierSBB Feb 13, 2025
2beae96
fix: fix type
jeripeierSBB Feb 13, 2025
e95ee56
fix: manually opening
jeripeierSBB Feb 13, 2025
4c421cc
fix: integrity
jeripeierSBB Feb 13, 2025
00147b2
feat: icon-sidebar design update
jeripeierSBB Feb 18, 2025
a6e6fa9
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Feb 18, 2025
aae0315
feat: icon-sidebar stories
jeripeierSBB Feb 18, 2025
fb46c19
fix: fix padding and accessibility in story
jeripeierSBB Feb 19, 2025
90e1d29
fix: padding block start
jeripeierSBB Feb 19, 2025
1c3ed2a
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Feb 20, 2025
1ec9b09
Merge branch 'main' into sidebar
jeripeierSBB Feb 20, 2025
8126592
fix: fix tests for Safari
jeripeierSBB Feb 20, 2025
b80e35d
feat: active state for block-link
jeripeierSBB Feb 20, 2025
ab3711a
fix: integrity
jeripeierSBB Feb 20, 2025
fbab62c
Merge branch 'main' into sidebar
jeripeierSBB Feb 24, 2025
d979168
fix: sbb-active color on link
jeripeierSBB Feb 24, 2025
3bf65f7
refactor: apply styles of contents on host
jeripeierSBB Feb 24, 2025
f0ef8cb
feat: update scrollOrigin of header
jeripeierSBB Feb 24, 2025
7ceb9e9
test: add tests to the icon sidebar
jeripeierSBB Feb 24, 2025
232e80e
test: add visual tests for the icon sidebar
jeripeierSBB Feb 24, 2025
37e4bef
test: improve icon sidebar visual specs
jeripeierSBB Feb 25, 2025
a31fa8f
docs: add documentation and remove position prop
jeripeierSBB Feb 25, 2025
34222f8
fix: fix inertion bug
jeripeierSBB Feb 25, 2025
8ca168a
Merge branch 'main' into sidebar
jeripeierSBB Feb 25, 2025
11542db
refactor: refactor start end getters if icon sidebar container
jeripeierSBB Feb 25, 2025
d6cc829
refactor: remove sidebar common styles
jeripeierSBB Feb 25, 2025
5771521
test: align sidebar container with icon sidebar container tests
jeripeierSBB Feb 25, 2025
26e49f4
docs: enhance content docs
jeripeierSBB Feb 25, 2025
f3fada2
docs: sidebar docs
jeripeierSBB Feb 26, 2025
5e5693e
Merge branch 'main' into sidebar
jeripeierSBB Feb 26, 2025
b01272a
fix: docs
jeripeierSBB Feb 26, 2025
c224a47
fix(header-action): remove obsolete aria-expanded=true from hover sel…
jeripeierSBB Feb 26, 2025
ae6464c
docs: sidebar stories
jeripeierSBB Feb 26, 2025
fe8e9af
docs: enhance sidebar docs
jeripeierSBB Feb 26, 2025
f74af58
refactor: use relative types
jeripeierSBB Feb 26, 2025
c74c8da
fix: fix integrity
jeripeierSBB Feb 26, 2025
887b2dc
test: add visual tests for sidebar
jeripeierSBB Feb 27, 2025
fe7c34d
fix: fix SSR
jeripeierSBB Feb 27, 2025
001b820
test: remove console error
jeripeierSBB Feb 27, 2025
4f24540
test: add a couple of basic tests
jeripeierSBB Feb 27, 2025
9b59ab7
fix: use scroll events instead of sticky state
jeripeierSBB Mar 4, 2025
cd065e0
test: add more tests
jeripeierSBB Mar 4, 2025
c7bbfdf
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Mar 4, 2025
6f88abe
test: test everything
jeripeierSBB Mar 4, 2025
f4855fb
fix: ux review
jeripeierSBB Mar 6, 2025
7c900d3
test: improve test stability
jeripeierSBB Mar 6, 2025
9ef2176
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Mar 6, 2025
a9fd1aa
fix: review Davide
jeripeierSBB Mar 10, 2025
9f5208a
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Mar 10, 2025
0963912
refactor: use new overlay controller
jeripeierSBB Mar 10, 2025
dfceeb4
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Mar 10, 2025
faec4e9
fix: review Tommaso
jeripeierSBB Mar 11, 2025
3497651
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Mar 11, 2025
385941d
fix: review Tommaso
jeripeierSBB Mar 12, 2025
b02ab3d
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Mar 12, 2025
98b3fe3
Merge branch 'refs/heads/main' into sidebar
jeripeierSBB Mar 17, 2025
9c3fda9
fix: provide focusOnOpen option
jeripeierSBB Mar 17, 2025
650cb34
fix: a11y review
jeripeierSBB Mar 17, 2025
c52d29a
fix: fix tests
jeripeierSBB Mar 17, 2025
92399e8
Merge branch 'main' into sidebar
jeripeierSBB Mar 20, 2025
d27e9db
Merge branch 'main' into sidebar
jeripeierSBB Mar 20, 2025
2d2e2ea
fix: review Lukas
jeripeierSBB Mar 20, 2025
687d3dd
fix: review 2
jeripeierSBB Mar 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/elements/button/common/button-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export type SbbButtonCommonElement = SbbButtonCommonElementMixinType & SbbAction
export type SbbButtonSize = 'l' | 'm' | 's';

export declare class SbbButtonCommonElementMixinType
implements SbbNegativeMixinType, Partial<SbbDisabledMixinType>, Partial<SbbIconNameMixinType>
extends SbbIconNameMixinType
implements SbbNegativeMixinType, Partial<SbbDisabledMixinType>
{
public accessor size: SbbButtonSize;
public accessor disabled: boolean;
public accessor iconName: string;
public accessor negative: boolean;
}

Expand Down
1 change: 1 addition & 0 deletions src/elements/core/a11y/focus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export function getFirstFocusableElement(
return focusableElements.length ? focusableElements[0] : null;
}

// TODO: Convert to Controller and handle disconnectedCallback here with hostDisconnected().
export class SbbFocusHandler {
private _controller = new AbortController();

Expand Down
17 changes: 7 additions & 10 deletions src/elements/core/controllers/inert-controller.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
import type { ReactiveController, ReactiveControllerHost } from 'lit';

import type { SbbOpenCloseBaseElement } from '../base-elements/open-close-base-element.js';

const IGNORED_ELEMENTS = ['script', 'head', 'template', 'style'];
const inertElements = new Set<HTMLElement>();
const inertOverlays = new Set<HTMLElement>();

export class SbbInertController implements ReactiveController {
public constructor(
private _host: ReactiveControllerHost & SbbOpenCloseBaseElement,
private _host: ReactiveControllerHost & HTMLElement,
private _inertElements = inertElements,
private _inertOverlays = inertOverlays,
) {
this._host.addController?.(this);
}

public hostConnected(): void {
if (this._host.isOpen) {
this.activate();
}
}

public hostDisconnected(): void {
if (this._inertOverlays.has(this._host)) {
if (this.isInert()) {
this.deactivate();
}
}
Expand Down Expand Up @@ -64,6 +56,11 @@ export class SbbInertController implements ReactiveController {
}
}

/** Whether the assigned host is currently inert */
public isInert(): boolean {
return this._inertOverlays.has(this._host);
}

private _currentOverlay(): HTMLElement | null {
return [...this._inertOverlays].pop() ?? null;
}
Expand Down
16 changes: 10 additions & 6 deletions src/elements/core/decorators/force-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import type { Interface, PropertyDecorator } from './base.js';
* Decorator that forces the value of a property or getter/setter
* to the defined type.
*/
export const forceType = <C extends Interface<ReactiveElement>, V>(): PropertyDecorator => {
export const forceType = <C extends Interface<ReactiveElement>, V>(
convert?: (v: unknown) => V,
): PropertyDecorator => {
return (
target: ClassAccessorDecoratorTarget<C, V> | ((value: V) => void),
context: ClassAccessorDecoratorContext<C, V> | ClassSetterDecoratorContext<C, V>,
Expand All @@ -16,13 +18,15 @@ export const forceType = <C extends Interface<ReactiveElement>, V>(): PropertyDe
const type = (globalThis.litPropertyMetadata.get(metadata)?.get(name)?.type ?? String) as (
v: unknown,
) => V;
let convert = type;
if ((type as unknown) === String) {

convert ??= type;

if ((convert as unknown) === String) {
// In case of String, we want to handle null/undefined differently
// from the native behavior in that we want to treat these values
// as empty strings.
convert = (v) => (v == null ? '' : String(v)) as V;
} else if ((type as unknown) === Number) {
} else if ((convert as unknown) === Number) {
// In case of Number, we want to handle null differently
// from the native behavior in that we want to treat null as NaN.
convert = (v) => (v == null ? NaN : Number(v)) as V;
Expand All @@ -32,13 +36,13 @@ export const forceType = <C extends Interface<ReactiveElement>, V>(): PropertyDe
set(this: C, value) {
(target as ClassAccessorDecoratorTarget<C, V>).set.call(
this as unknown as C,
convert(value) as V,
convert!(value) as V,
);
},
} satisfies ClassAccessorDecoratorResult<C, V>;
} else if (kind === 'setter') {
return function (value: unknown) {
(target as (value: unknown) => void).call(this, convert(value));
(target as (value: unknown) => void).call(this, convert!(value));
} satisfies (this: C, value: V) => void;
}

Expand Down
7 changes: 7 additions & 0 deletions src/elements/core/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,13 @@ export const i18nCloseNavigation: Record<string, string> = {
it: 'Chiudere la navigazione',
};

export const i18nCloseSidebar: Record<string, string> = {
de: 'Seitenleiste schliessen',
en: 'Close sidebar',
fr: 'Fermer la barre latérale',
it: 'Chiudere la barra laterale',
};

export const i18nClosePopover: Record<string, string> = {
de: 'Hinweis schliessen',
en: 'Close note',
Expand Down
1 change: 1 addition & 0 deletions src/elements/core/mixins.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './mixins/animation-complete-mixin.js';
export * from './mixins/constructor.js';
export * from './mixins/disabled-mixin.js';
export * from './mixins/form-associated-checkbox-mixin.js';
Expand Down
80 changes: 80 additions & 0 deletions src/elements/core/mixins/animation-complete-mixin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import type { LitElement } from 'lit';

import type { AbstractConstructor } from './constructor.js';

export declare class SbbAnimationCompleteMixinType {
public isAnimating: boolean;
public get animationComplete(): Promise<void> | null;
protected startAnimation(): void;
protected stopAnimation(): void;
}

/**
* Enhances the component with a Promise which resolves whenever an animation ends.
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export const SbbAnimationCompleteMixin = <T extends AbstractConstructor<LitElement>>(
superClass: T,
): AbstractConstructor<SbbAnimationCompleteMixinType> & T => {
abstract class SbbAnimationCompleteElement
extends superClass
implements Partial<SbbAnimationCompleteMixinType>
{
/**
* Whether the component is currently animating.
*/
public isAnimating = false;

/**
* Returns a promise which completes whenever an animation ends.
* When a new animation starts, a new Promise is returned.
*/
public get animationComplete(): Promise<void> {
return this._animationPromise;
}
private _animationPromise: Promise<void> = Promise.resolve();

public override disconnectedCallback(): void {
super.disconnectedCallback();
this.stopAnimation();
}

protected startAnimation(): void {
if (!this.isAnimating) {
this._animationPromise = this._enqueueAnimation();
}
}

/**
* Overriding stopAnimation() breaks functionality.
*/
protected stopAnimation(): void {}

private async _enqueueAnimation(): Promise<void> {
this.isAnimating = true;
const stopAnimation = this.stopAnimation;

const result = new Promise<void>((r) => {
this.stopAnimation = () => {
stopAnimation();
this.isAnimating = false;
r();
};
});
try {
// Ensure any previous update has resolved before updating.
await this._animationPromise;
} catch (e) {
// Refire any previous errors async so they do not disrupt the update
// cycle. Errors are re-fired so developers have a chance to observe
// them, and this can be done by implementing
// `window.onunhandledrejection`.
Promise.reject(e);
}
return result;
}
}

return SbbAnimationCompleteElement as unknown as AbstractConstructor<SbbAnimationCompleteMixinType> &
T;
};
81 changes: 81 additions & 0 deletions src/elements/core/styles/core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,84 @@ sbb-train-formation[view='top'] sbb-train-wagon {
--sbb-train-wagon-locomotive-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath d='M20,0.5 h40 a19.5,19.5 0 0 1 19.5,19.5 v0 a19.5,19.5 0 0 1 -19.5,19.5 h-40 a19.5,19.5 0 0 1 -19.5,-19.5 v0 a19.5,19.5 0 0 1 19.5,-19.5 z' stroke='%23000000' stroke-width='1'/%3E%3C/svg%3E%0A");
--sbb-train-wagon-wagon-end-right-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath d='M8.5,0.5 h51.5 a19.5,19.5 0 0 1 19.5,19.5 v0 a19.5,19.5 0 0 1 -19.5,19.5 h-51.5 a8,8 0 0 1 -8,-8 v-23 a8,8 0 0 1 8,-8 z' stroke='%23000000' stroke-width='1'/%3E%3C/svg%3E");
}

// Skip animation for the container, content and sidebars when a sidebar requests it
// (during initialization or if animation is disabled, but only during transition)
sbb-sidebar-container:has(> sbb-sidebar[data-skip-animation]) {
--sbb-sidebar-container-animation-duration: 0s;
}

// Controls the start margin of the sbb-sidebar-content.
// Whenever the sidebar with position start is in a closed state in over mode (or forced over mode),
// or if there is no sidebar with position start, then override the margin with 0.
// Direct child selector is mandatory to enable nested sidebars.
sbb-sidebar-container:is(
:has(
> sbb-sidebar:not([position='end']):is(
[data-state='closing'],
[data-state='closed'],
[mode='over'],
[data-mode-over-forced]
)
),
:not(:has(> sbb-sidebar:not([position='end'])))
)
> sbb-sidebar-content {
--sbb-sidebar-content__margin-inline-start: 0;
}

// Controls the end margin of the sbb-sidebar-content.
// Whenever the sidebar with position end is in a closed state in over mode (or forced over mode),
// or if there is no sidebar with position end, then override the margin with 0.
// Direct child selector is mandatory to enable nested sidebars.
sbb-sidebar-container:is(
:has(
> sbb-sidebar[position='end']:is(
[data-state='closing'],
[data-state='closed'],
[mode='over'],
[data-mode-over-forced]
)
),
:not(:has(> sbb-sidebar[position='end']))
)
> sbb-sidebar-content {
--sbb-sidebar-content__margin-inline-end: 0;
}

// Toggles visibility of backdrop if there is an affected sidebar inside the container.
sbb-sidebar-container:has(
> sbb-sidebar:is([mode='over'], [data-mode-over-forced]):is(
[data-state='opening'],
[data-state='opened']
)
) {
--sbb-sidebar-container__backdrop-visibility: visible;
--sbb-sidebar-container-backdrop-opacity: 0.4;
}

// Move the current-page-border to the right side if the sidebar is right positioned
sbb-icon-sidebar-content + sbb-icon-sidebar :is(sbb-icon-sidebar-link, sbb-icon-sidebar-button) {
--sbb-icon-sidebar-button__current-border-inset-inline-start: auto;
}

// Set the border radius at the left top side if the sidebar is right positioned
sbb-icon-sidebar-content + sbb-icon-sidebar {
border-start-end-radius: 0;
border-start-start-radius: var(--sbb-icon-sidebar-border-radius);
}

// If there is no close button, avoid reserving any space for the button in the sidebar title
sbb-sidebar:not(:has(sbb-sidebar-title)) sbb-sidebar-close-button {
position: absolute;
}

// If there is a title, remove top spacing for the content
sbb-sidebar:has(sbb-sidebar-title) {
--sbb-sidebar__padding-block-start: 0;
}

// Move container below header
sbb-header + :where(sbb-sidebar-container, sbb-icon-sidebar-container) {
margin-block-start: var(--sbb-header-height);
}
14 changes: 14 additions & 0 deletions src/elements/core/styles/mixins/link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@
--sbb-link-color-active: var(--sbb-color-silver);
}

// To display a current active page, e.g. if the CSS class sbb-active is set
@mixin block-link-variables--active {
--sbb-link-color-normal: var(--sbb-color-black);
--sbb-link-text-decoration: underline;
--sbb-link-text-decoration-color: currentcolor;
}

// To display a current active page, e.g. if the CSS class sbb-active is set
@mixin block-link-variables--active-negative {
--sbb-link-color-normal: var(--sbb-color-cement);
--sbb-link-text-decoration: underline;
--sbb-link-text-decoration-color: currentcolor;
}

@mixin link-variables {
@include link-common-variables;

Expand Down
4 changes: 4 additions & 0 deletions src/elements/dialog/dialog-title/dialog-title.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
display: contents;
}

:host([negative]) {
@include sbb.title--negative;
}

:host([data-overflows]) {
--sbb-dialog-title-padding-block: var(--sbb-spacing-responsive-s);
}
Expand Down
3 changes: 2 additions & 1 deletion src/elements/dialog/dialog-title/dialog-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { forceType } from '../../core/decorators.js';
import type { Breakpoint } from '../../core/dom.js';
import { EventEmitter } from '../../core/eventing.js';
import { i18nCloseDialog, i18nGoBack } from '../../core/i18n.js';
import { SbbNegativeMixin } from '../../core/mixins.js';
import { SbbTitleBase } from '../../title.js';

import style from './dialog-title.scss?lit&inline';
Expand All @@ -23,7 +24,7 @@ import '../../button/transparent-button.js';
*/
export
@customElement('sbb-dialog-title')
class SbbDialogTitleElement extends SbbTitleBase {
class SbbDialogTitleElement extends SbbNegativeMixin(SbbTitleBase) {
public static override styles: CSSResultGroup = [SbbTitleBase.styles, style];
public static readonly events: Record<string, string> = {
backClick: 'requestBackAction',
Expand Down
6 changes: 3 additions & 3 deletions src/elements/dialog/dialog-title/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ If a back button is displayed it emits a `requestBackAction` event on click.

## Slots

| Name | Description |
| ---- | ------------------------------------------ |
| | Use the unnamed slot to display the title. |
| Name | Description |
| ---- | ------------------------------------------------------- |
| | Use the unnamed slot to place the content of the title. |
2 changes: 1 addition & 1 deletion src/elements/header/common/header-action.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}

@include sbb.hover-mq($hover: true) {
:host(:hover:not(:active, [data-active], [aria-expanded='true'])) {
:host(:hover:not(:active, [data-active])) {
--sbb-header-action-background-color: var(--sbb-color-milk);
--sbb-header-action-translate-y: #{sbb.px-to-rem-build(-1)};
--sbb-header-action-background-inset: calc(var(--sbb-border-width-2x) * -1);
Expand Down
Loading