From 0e9d6ec4bd84f07a2321c8b3c2cce7e9d1e7b6be Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Wed, 19 Oct 2022 01:22:20 +0100 Subject: [PATCH] Desktop/browser: explicitly define themed text `::selection` styles (#3675) --- apps/browser/src/popup/scss/misc.scss | 12 ++++++++++++ apps/desktop/src/scss/misc.scss | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/apps/browser/src/popup/scss/misc.scss b/apps/browser/src/popup/scss/misc.scss index 1d6acfe6417..6fc0a1462cf 100644 --- a/apps/browser/src/popup/scss/misc.scss +++ b/apps/browser/src/popup/scss/misc.scss @@ -392,6 +392,18 @@ input[type="password"]::-ms-reveal { } } +// Text selection styles +// Set explicit selection styles (assumes primary accent color has sufficient +// contrast against the background, so its inversion is also still readable) +// and suppress user selection for most elements (to make it more app-like) + +::selection { + @include themify($themes) { + color: themed("backgroundColor"); + background-color: themed("primaryAccentColor"); + } +} + h1, h2, h3, diff --git a/apps/desktop/src/scss/misc.scss b/apps/desktop/src/scss/misc.scss index 26ae58a5f14..50ba40ba707 100644 --- a/apps/desktop/src/scss/misc.scss +++ b/apps/desktop/src/scss/misc.scss @@ -492,6 +492,18 @@ app-root > #loading, border-radius: 50% !important; } +// Text selection styles +// Set explicit selection styles (assumes primary accent color has sufficient +// contrast against the background, so its inversion is also still readable) +// and suppress user selection for most elements (to make it more app-like) + +::selection { + @include themify($themes) { + color: themed("backgroundColor"); + background-color: themed("primaryAccentColor"); + } +} + h1, h2, h3,