Enforces colour scheme adaptability and forces system colours.
System colours enforcer by myfonj
Details
Authormyfonj
LicenseCC0
Categoryglobal
Created
Updated
Code size1.4 kB
Code checksum7d7802ed
Statistics
Learn how we calculate statistics in the FAQ.
Failed to fetch stats.
Description
Notes
Super simple. Basically makes all backgrounds transparent, so all overlays will be confusing. Intended as a band-aid for occasions when Reading mode is not favourable for some reason and page does not respect color-scheme
, or uses terrible palette.
Source code
/* ==UserStyle==
@name System colours enforcer
@namespace github.com/openstyles/stylus
@version 1.0.1
@description Enforces colour scheme adaptability and forces system colours.
@author myf
@license CC0
==/UserStyle== */
/*
Hat tip: https://x.com/shadeed9/status/1910066466764075418
Changelog
1.0.1 (2025-04-10) background also revert. Not sure why I had transparent there.
1.0.0 (2025-04-10) Init. Crude, but somewhat working.
*/
@-moz-document url-prefix("http") {
html:not(#h#e#l#l#o) {
&,
& *
{
&,
&::before,
&::after,
&::marker
{
--text: color-mix(in srgb, currentcolor 75%, canvas) !important;
--dim: color-mix(in srgb, currentcolor 25%, canvas) !important;
color-scheme: dark light !important;
color: revert !important;
background-color: revert !important;
border-color: var(--dim) !important;
outline: revert !important;
text-shadow: revert !important;
filter: revert !important;
-webkit-text-fill-color: var(--text) !important;
-webkit-text-stroke-color: revert !important;
border-image: revert !important;
background-image: revert !important;
}
&::marker {
color: var(--dim) !important;
}
&[role="checkbox"] {
background-color: highlight !important;
&[aria-checked="true"] {
background-color: selectedItem !important;
}
}
}
}
}