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/increaseContrast/presentation/scripts/styles.script.ts b/src/features/increaseContrast/presentation/scripts/styles.script.ts
new file mode 100644
index 0000000..2ff828c
--- /dev/null
+++ b/src/features/increaseContrast/presentation/scripts/styles.script.ts
@@ -0,0 +1,10 @@
+import StylesheetScript from '../../../../common/architecture/scripts/stylesheet/StylesheetScript';
+
+export default class IncreaseContrastStylesScript extends StylesheetScript {
+ stylesheet = 'css/increase_contrast.css';
+ page: never;
+
+ async shouldBeInjected(): Promise<boolean> {
+ return await this.optionsProvider.isEnabled('increasecontrast');
+ }
+}
diff --git a/src/features/increaseContrast/ui/styles.css b/src/features/increaseContrast/ui/styles.css
new file mode 100644
index 0000000..026230e
--- /dev/null
+++ b/src/features/increaseContrast/ui/styles.css
@@ -0,0 +1,3 @@
+.thread-summary.read:not(.checked) {
+ background: var(--TWPT-thread-read-background, #ecedee) !important;
+}