Skip to content

Commit

Permalink
feat: add isLean function
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideMininni-Fincons committed Nov 20, 2024
1 parent 5a02676 commit 5d4d977
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/elements/core/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from './dom/find-referenced-element.js';
export * from './dom/get-document-writing-mode.js';
export * from './dom/host-context.js';
export * from './dom/input-element.js';
export * from './dom/lean-context.js';
export * from './dom/set-or-remove-attribute.js';
export * from './dom/platform.js';
export * from './dom/scroll.js';
Expand Down
6 changes: 6 additions & 0 deletions src/elements/core/dom/lean-context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Checks if the body has the `sbb-lean` class.
*/
export function isLean(): boolean {
return document.body.classList.contains('sbb-lean');
}

0 comments on commit 5d4d977

Please sign in to comment.