mirror of
https://github.com/bitwarden/browser
synced 2026-02-12 22:44:11 +00:00
add BitSettingsService
This commit is contained in:
@@ -30,6 +30,7 @@ export * from "./radio-button";
|
||||
export * from "./search";
|
||||
export * from "./section";
|
||||
export * from "./select";
|
||||
export * from "./shared/bit-settings.service";
|
||||
export * from "./table";
|
||||
export * from "./tabs";
|
||||
export * from "./toast";
|
||||
|
||||
15
libs/components/src/shared/bit-settings.service.ts
Normal file
15
libs/components/src/shared/bit-settings.service.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { effect, Injectable, signal, WritableSignal } from "@angular/core";
|
||||
|
||||
/** Global settings for the Bitwarden Design System */
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class BitSettingsService {
|
||||
compactMode: WritableSignal<boolean> = signal(false);
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
this.compactMode()
|
||||
? document.body.classList.add("tw-bit-compact")
|
||||
: document.body.classList.remove("tw-bit-compact");
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user