diff --git a/web/text_layer_builder.css b/web/text_layer_builder.css index ff115d99c..8e7269e2f 100644 --- a/web/text_layer_builder.css +++ b/web/text_layer_builder.css @@ -13,6 +13,18 @@ * limitations under the License. */ +:root { + --highlight-bg-color: rgba(180, 0, 170, 1); + --highlight-selected-bg-color: rgba(0, 100, 0, 1); +} + +@media (forced-colors: active) { + :root { + --highlight-bg-color: Highlight; + --highlight-selected-bg-color: ButtonText; + } +} + .textLayer { position: absolute; text-align: initial; @@ -48,7 +60,7 @@ .textLayer .highlight { margin: -1px; padding: 1px; - background-color: rgba(180, 0, 170, 1); + background-color: var(--highlight-bg-color); border-radius: 4px; } @@ -69,16 +81,7 @@ } .textLayer .highlight.selected { - background-color: rgba(0, 100, 0, 1); -} - -@media (forced-colors: active) { - .textLayer .highlight { - background-color: Highlight; - } - .textLayer .highlight.selected { - background-color: ButtonText; - } + background-color: var(--highlight-selected-bg-color); } .textLayer ::selection {