refactor(ui-spacing): migrate to the new DI architecture
With this migration we also get for free that this option is now
dynamic, so changing it will automatically update the applied styles.
Bug: twpowertools:176, twpowertools:61
Change-Id: Icac4f829745a06c95439931955be6c52c7303482
diff --git a/src/features/uiSpacing/presentation/scripts/consoleStyles.script.ts b/src/features/uiSpacing/presentation/scripts/consoleStyles.script.ts
new file mode 100644
index 0000000..6ba12c4
--- /dev/null
+++ b/src/features/uiSpacing/presentation/scripts/consoleStyles.script.ts
@@ -0,0 +1,13 @@
+import StylesheetScript from '../../../../common/architecture/scripts/stylesheet/StylesheetScript';
+import UiSpacingSharedStylesScript from './sharedStyles.script';
+
+export default class UiSpacingConsoleStylesScript extends StylesheetScript {
+ stylesheet = 'css/ui_spacing/console.css';
+
+ runAfter = [UiSpacingSharedStylesScript];
+ page: never;
+
+ async shouldBeInjected(): Promise<boolean> {
+ return await this.optionsProvider.isEnabled('uispacing');
+ }
+}