refactor: migrate some styling features to the new architecture
Again, by using StylesheetScript we also get dynamic styles for free.
Bug: twpowertools:176, twpowertools:61
Change-Id: I8c660f8b9cddaf56b3a29c8d07d48d070ee2cd34
diff --git a/src/features/fixedToolbar/presentation/scripts/styles.script.ts b/src/features/fixedToolbar/presentation/scripts/styles.script.ts
new file mode 100644
index 0000000..29133fc
--- /dev/null
+++ b/src/features/fixedToolbar/presentation/scripts/styles.script.ts
@@ -0,0 +1,10 @@
+import StylesheetScript from '../../../../common/architecture/scripts/stylesheet/StylesheetScript';
+
+export default class FixedToolbarStylesScript extends StylesheetScript {
+ stylesheet = 'css/fixed_toolbar.css';
+ page: never;
+
+ async shouldBeInjected(): Promise<boolean> {
+ return await this.optionsProvider.isEnabled('fixedtoolbar');
+ }
+}
diff --git a/src/features/fixedToolbar/ui/styles.css b/src/features/fixedToolbar/ui/styles.css
new file mode 100644
index 0000000..c52fb30
--- /dev/null
+++ b/src/features/fixedToolbar/ui/styles.css
@@ -0,0 +1,6 @@
+ec-bulk-actions {
+ position: sticky;
+ top: 0;
+ background: var(--TWPT-primary-background, #fff);
+ z-index: 96;
+}