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/twBasicStyles.script.ts b/src/features/uiSpacing/presentation/scripts/twBasicStyles.script.ts
new file mode 100644
index 0000000..20e6dc9
--- /dev/null
+++ b/src/features/uiSpacing/presentation/scripts/twBasicStyles.script.ts
@@ -0,0 +1,13 @@
+import StylesheetScript from '../../../../common/architecture/scripts/stylesheet/StylesheetScript';
+import UiSpacingSharedStylesScript from './sharedStyles.script';
+
+export default class UiSpacingTwBasicStylesScript extends StylesheetScript {
+ stylesheet = 'css/ui_spacing/twbasic.css';
+
+ runAfter = [UiSpacingSharedStylesScript];
+ page: never;
+
+ async shouldBeInjected(): Promise<boolean> {
+ return await this.optionsProvider.isEnabled('uispacing');
+ }
+}