MediaWiki:Gadget-bhc-accessibility.css: Difference between revisions
No edit summary Tag: Manual revert |
No edit summary |
||
| Line 7: | Line 7: | ||
========================================================= */ | ========================================================= */ | ||
/* | /* ========================================================= | ||
Variables | Variables | ||
========================================================= */ | |||
:root{ | :root{ | ||
--a11y-bg: #111827; | --a11y-bg: #111827; | ||
| Line 15: | Line 15: | ||
--a11y-fg: #ffffff; | --a11y-fg: #ffffff; | ||
--a11y-focus: #FFBF47; | --a11y-focus: #FFBF47; | ||
--a11y-link-underline: #36C; | --a11y-link-underline: #36C; | ||
--a11y-menu-width: 340px; | --a11y-menu-width: 340px; | ||
} | } | ||
/* | /* ========================================================= | ||
Skip links | |||
========================================================= */ | |||
Skip links | |||
.skip-link{ | .skip-link{ | ||
position: absolute; | position:absolute; | ||
left: 12px; | left:12px; | ||
top: 12px; | top:12px; | ||
z-index: 11000; | z-index:11000; | ||
padding:10px 14px; | |||
padding: 10px 14px; | border-radius:8px; | ||
border-radius: 8px; | background:#111827; | ||
color:#fff; | |||
background: #111827; | text-decoration:none; | ||
color: #fff; | transform:translateY(-150%); | ||
text-decoration: none; | transition:transform .15s ease; | ||
border:2px solid var(--a11y-focus); | |||
transform: translateY(-150%); | |||
transition: transform | |||
border: 2px solid var(--a11y-focus) | |||
} | } | ||
.skip-link:focus-visible{ transform:translateY(0); } | |||
body.a11y-contrast .skip-link{ | body.a11y-contrast .skip-link{ | ||
background: #000 !important; | background:#000!important; | ||
color: #FFD400 !important; | color:#FFD400!important; | ||
border-color: #FFD400 !important; | border-color:#FFD400!important; | ||
} | } | ||
/* | /* ========================================================= | ||
Floating accessibility toggle | Floating accessibility toggle | ||
========================================================= */ | |||
.a11y-toggle{ | .a11y-toggle{ | ||
position: fixed; | position:fixed; | ||
right: 16px; | right:16px; | ||
bottom: 16px; | bottom:16px; | ||
width:56px; | |||
height:56px; | |||
width: 56px; | border-radius:50%; | ||
height: 56px; | background:#005FCC; | ||
border-radius: 50%; | border:2px solid #fff; | ||
color:#fff; | |||
background: #005FCC; | display:inline-flex; | ||
border: 2px solid # | align-items:center; | ||
color: # | justify-content:center; | ||
box-shadow:0 10px 24px rgba(0,0,0,.25); | |||
display: inline-flex; | cursor:pointer; | ||
align-items: center; | z-index:10001; | ||
justify-content: center; | |||
box-shadow: 0 10px 24px rgba(0,0,0, | |||
cursor: pointer; | |||
} | } | ||
.a11y-toggle:focus-visible{ | .a11y-toggle:focus-visible{ | ||
outline: 3px solid var(--a11y-focus); | outline:3px solid var(--a11y-focus); | ||
outline-offset: 3px; | outline-offset:3px; | ||
} | } | ||
.a11y-toggle svg{ | .a11y-toggle svg{ | ||
width: 44px; | width:44px; | ||
height: 44px; | height:44px; | ||
fill: currentColor; | fill:currentColor; | ||
} | } | ||
/* | /* ========================================================= | ||
Accessibility panel | |||
========================================================= */ | |||
.a11y-panel{ | .a11y-panel{ | ||
position: fixed; | position:fixed; | ||
right: 14px; | right:14px; | ||
bottom: 76px; | bottom:76px; | ||
width:var(--a11y-menu-width); | |||
max-width:calc(100vw - 28px); | |||
width: var(--a11y-menu-width); | background:var(--a11y-bg); | ||
max-width: calc(100vw - 28px); | color:var(--a11y-fg); | ||
border:1px solid var(--a11y-border); | |||
background: var(--a11y-bg); | border-radius:16px; | ||
padding:12px; | |||
box-shadow:0 14px 40px rgba(0,0,0,.28); | |||
border-radius: 16px; | z-index:10000; | ||
padding: 12px; | |||
box-shadow: 0 14px 40px rgba(0,0,0, | |||
} | } | ||
.a11y-panel[hidden]{ display:none!important; } | |||
/* ========================================================= | /* ========================================================= | ||
High contrast base | |||
========================================================= */ | ========================================================= */ | ||
body.a11y-contrast{ | body.a11y-contrast{ | ||
background:#000 !important; | background:#000!important; | ||
color:#FFD400 !important; | color:#FFD400!important; | ||
--a11y-bg:#000; | |||
--a11y-bg: #000; | --a11y-border:rgba(255,212,0,.7); | ||
--a11y-border: rgba(255,212,0,.7); | --a11y-fg:#FFD400; | ||
--a11y-fg: #FFD400; | --a11y-focus:#FFD400; | ||
--a11y-focus: #FFD400 | |||
} | } | ||
/* Links */ | |||
body.a11y-contrast a, | body.a11y-contrast a, | ||
body.a11y-contrast a:visited{ | body.a11y-contrast a:visited{ | ||
color:#FFD400 | color:#FFD400!important; | ||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
Timeless: core containers | |||
========================================================= */ | ========================================================= */ | ||
body.a11y-contrast.skin-timeless #mw-header-container, | |||
body.a11y-contrast.skin-timeless #mw-content-container, | |||
body.a11y-contrast # | body.a11y-contrast.skin-timeless #mw-wrapper, | ||
body.a11y-contrast . | body.a11y-contrast.skin-timeless #mw-content, | ||
body.a11y-contrast | body.a11y-contrast.skin-timeless .mw-body, | ||
body.a11y-contrast . | body.a11y-contrast.skin-timeless .mw-parser-output{ | ||
background: #000 !important; | background:#000!important; | ||
background-image:none!important; | |||
color:#FFD400!important; | |||
} | } | ||
/* | /* mw-content border */ | ||
body.a11y-contrast #mw-content{ | |||
border-color:#FFD400!important; | |||
body.a11y-contrast | |||
border- | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
Timeless: search input | |||
========================================================= */ | ========================================================= */ | ||
body.a11y-contrast | body.a11y-contrast.skin-timeless #p-search input[type="search"], | ||
body.a11y-contrast.skin-timeless #p-search #searchInput{ | |||
background:#000!important; | |||
color:#FFD400!important; | |||
caret-color:#FFD400!important; | |||
border:2px solid #FFD400!important; | |||
-webkit-text-fill-color:#FFD400!important; | |||
body.a11y-contrast | |||
background: #000 !important; | |||
color: #FFD400 !important; | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
Timeless: personal tools | |||
========================================================= */ | ========================================================= */ | ||
body.a11y-contrast.skin-timeless #personal, | |||
body.a11y-contrast.skin-timeless #personal *{ | |||
background:#000!important; | |||
color:#FFD400!important; | |||
body.a11y-contrast.skin-timeless # | |||
body.a11y-contrast.skin-timeless # | |||
background: #000 !important; | |||
color: #FFD400 !important; | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
Sidebar chunk ≥1340px | |||
========================================================= */ | ========================================================= */ | ||
@media screen and (min-width:1340px){ | |||
@media screen and (min-width: 1340px){ | |||
body.a11y-contrast.skin-timeless | body.a11y-contrast.skin-timeless | ||
#mw-related-navigation .sidebar-chunk{ | #mw-related-navigation .sidebar-chunk{ | ||
background: #000 | background:#000!important; | ||
border-color:rgba(255,212,0,.85)!important; | |||
border-color: rgba(255,212,0,.85) !important; | box-shadow:none!important; | ||
box-shadow: none !important; | |||
} | } | ||
} | } | ||
/* | /* ========================================================= | ||
Edit textarea | |||
========================================================= */ | |||
body.a11y-contrast #wpTextbox1, | body.a11y-contrast #wpTextbox1, | ||
body.a11y-contrast textarea.mw-editfont-monospace{ | body.a11y-contrast textarea.mw-editfont-monospace{ | ||
background: #000 !important; | background:#000!important; | ||
color: #FFD400 !important; | color:#FFD400!important; | ||
caret-color: #FFD400 !important; | caret-color:#FFD400!important; | ||
border: 2px solid #FFD400 | border:2px solid #FFD400!important; | ||
-webkit-text-fill-color:#FFD400!important; | |||
-webkit-text-fill-color: #FFD400 | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
EditOptions bar | |||
========================================================= */ | ========================================================= */ | ||
body.a11y-contrast .editOptions{ | |||
body.a11y-contrast .editOptions | background:#000!important; | ||
color:#FFD400!important; | |||
background: #000 !important; | border-color:rgba(255,212,0,.85)!important; | ||
color: #FFD400 !important; | |||
border-color: rgba(255,212,0,.85) | |||
} | } | ||
body.a11y-contrast .editOptions button, | body.a11y-contrast .editOptions button, | ||
body.a11y-contrast .editOptions input, | body.a11y-contrast .editOptions input, | ||
body.a11y-contrast .editOptions select | body.a11y-contrast .editOptions select{ | ||
background:#000!important; | |||
color:#FFD400!important; | |||
border:2px solid rgba(255,212,0,.85)!important; | |||
background: #000 !important; | |||
color: #FFD400 !important; | |||
border: 2px solid rgba(255,212,0,.85) | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
WikiEditor — SAFE styling (no icon breakage) | |||
========================================================= */ | ========================================================= */ | ||
body.a11y-contrast .wikiEditor-ui, | body.a11y-contrast .wikiEditor-ui, | ||
body.a11y-contrast .wikiEditor-ui-toolbar, | body.a11y-contrast .wikiEditor-ui-toolbar, | ||
body.a11y-contrast .wikiEditor-ui-toolbar .group, | body.a11y-contrast .wikiEditor-ui-toolbar .group, | ||
body.a11y-contrast .wikiEditor-ui-toolbar .section{ | body.a11y-contrast .wikiEditor-ui-toolbar .section{ | ||
background: #000 !important; | background-color:#000!important; | ||
color: #FFD400 !important; | color:#FFD400!important; | ||
border-color: rgba(255,212,0,.85) !important; | border-color:rgba(255,212,0,.85)!important; | ||
} | } | ||
/* | /* DO NOT touch background-image on icons */ | ||
body.a11y-contrast .wikiEditor-ui .oo-ui-iconElement-icon{ | |||
background-color:transparent!important; | |||
body.a11y-contrast .wikiEditor-ui | |||
background | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
Codex (CDX) messages | |||
========================================================= */ | ========================================================= */ | ||
body.a11y-contrast .cdx-message, | body.a11y-contrast .cdx-message, | ||
body.a11y-contrast .cdx-message--block, | body.a11y-contrast .cdx-message--block, | ||
body.a11y-contrast .cdx-message--error{ | body.a11y-contrast .cdx-message--error{ | ||
background: #000 !important; | background:#000!important; | ||
color: #FFD400 !important; | color:#FFD400!important; | ||
border: 2px solid rgba(255,212,0,.85) | border:2px solid rgba(255,212,0,.85)!important; | ||
} | } | ||
body.a11y-contrast .cdx-message__content, | body.a11y-contrast .cdx-message__content, | ||
body.a11y-contrast .cdx-message__content *{ | body.a11y-contrast .cdx-message__content *{ | ||
background: transparent !important; | background:transparent!important; | ||
color: #FFD400 !important; | color:#FFD400!important; | ||
} | } | ||
body.a11y-contrast .cdx-message__icon, | body.a11y-contrast .cdx-message__icon, | ||
body.a11y-contrast .cdx-message__icon *{ | body.a11y-contrast .cdx-message__icon *{ | ||
fill:#FFD400!important; | |||
fill: #FFD400 !important; | |||
} | } | ||
/* | /* ========================================================= | ||
EMERGENCY: ensure accessibility toggle always visible | |||
KEEP AT VERY END | |||
========================================================= */ | |||
#a11y-toggle.a11y-toggle{ | |||
position:fixed!important; | |||
right:16px!important; | |||
bottom:16px!important; | |||
display:inline-flex!important; | |||
visibility:visible!important; | |||
opacity:1!important; | |||
z-index:2147483647!important; | |||
pointer-events:auto!important; | |||
transform:none!important; | |||
} | |||
#a11y-toggle.a11y-toggle svg{ | |||
display:block!important; | |||
visibility:visible!important; | |||
opacity:1!important; | |||
} | } | ||
Revision as of 19:42, 27 January 2026
/*
⚠️ Do not reorder rules below this line — contrast overrides depend on cascade order.
*/
/* =========================================================
BHC Accessibility Gadget – MediaWiki / Timeless
========================================================= */
/* =========================================================
Variables
========================================================= */
:root{
--a11y-bg: #111827;
--a11y-border: #374151;
--a11y-fg: #ffffff;
--a11y-focus: #FFBF47;
--a11y-link-underline: #36C;
--a11y-menu-width: 340px;
}
/* =========================================================
Skip links
========================================================= */
.skip-link{
position:absolute;
left:12px;
top:12px;
z-index:11000;
padding:10px 14px;
border-radius:8px;
background:#111827;
color:#fff;
text-decoration:none;
transform:translateY(-150%);
transition:transform .15s ease;
border:2px solid var(--a11y-focus);
}
.skip-link:focus-visible{ transform:translateY(0); }
body.a11y-contrast .skip-link{
background:#000!important;
color:#FFD400!important;
border-color:#FFD400!important;
}
/* =========================================================
Floating accessibility toggle
========================================================= */
.a11y-toggle{
position:fixed;
right:16px;
bottom:16px;
width:56px;
height:56px;
border-radius:50%;
background:#005FCC;
border:2px solid #fff;
color:#fff;
display:inline-flex;
align-items:center;
justify-content:center;
box-shadow:0 10px 24px rgba(0,0,0,.25);
cursor:pointer;
z-index:10001;
}
.a11y-toggle:focus-visible{
outline:3px solid var(--a11y-focus);
outline-offset:3px;
}
.a11y-toggle svg{
width:44px;
height:44px;
fill:currentColor;
}
/* =========================================================
Accessibility panel
========================================================= */
.a11y-panel{
position:fixed;
right:14px;
bottom:76px;
width:var(--a11y-menu-width);
max-width:calc(100vw - 28px);
background:var(--a11y-bg);
color:var(--a11y-fg);
border:1px solid var(--a11y-border);
border-radius:16px;
padding:12px;
box-shadow:0 14px 40px rgba(0,0,0,.28);
z-index:10000;
}
.a11y-panel[hidden]{ display:none!important; }
/* =========================================================
High contrast base
========================================================= */
body.a11y-contrast{
background:#000!important;
color:#FFD400!important;
--a11y-bg:#000;
--a11y-border:rgba(255,212,0,.7);
--a11y-fg:#FFD400;
--a11y-focus:#FFD400;
}
/* Links */
body.a11y-contrast a,
body.a11y-contrast a:visited{
color:#FFD400!important;
}
/* =========================================================
Timeless: core containers
========================================================= */
body.a11y-contrast.skin-timeless #mw-header-container,
body.a11y-contrast.skin-timeless #mw-content-container,
body.a11y-contrast.skin-timeless #mw-wrapper,
body.a11y-contrast.skin-timeless #mw-content,
body.a11y-contrast.skin-timeless .mw-body,
body.a11y-contrast.skin-timeless .mw-parser-output{
background:#000!important;
background-image:none!important;
color:#FFD400!important;
}
/* mw-content border */
body.a11y-contrast #mw-content{
border-color:#FFD400!important;
}
/* =========================================================
Timeless: search input
========================================================= */
body.a11y-contrast.skin-timeless #p-search input[type="search"],
body.a11y-contrast.skin-timeless #p-search #searchInput{
background:#000!important;
color:#FFD400!important;
caret-color:#FFD400!important;
border:2px solid #FFD400!important;
-webkit-text-fill-color:#FFD400!important;
}
/* =========================================================
Timeless: personal tools
========================================================= */
body.a11y-contrast.skin-timeless #personal,
body.a11y-contrast.skin-timeless #personal *{
background:#000!important;
color:#FFD400!important;
}
/* =========================================================
Sidebar chunk ≥1340px
========================================================= */
@media screen and (min-width:1340px){
body.a11y-contrast.skin-timeless
#mw-related-navigation .sidebar-chunk{
background:#000!important;
border-color:rgba(255,212,0,.85)!important;
box-shadow:none!important;
}
}
/* =========================================================
Edit textarea
========================================================= */
body.a11y-contrast #wpTextbox1,
body.a11y-contrast textarea.mw-editfont-monospace{
background:#000!important;
color:#FFD400!important;
caret-color:#FFD400!important;
border:2px solid #FFD400!important;
-webkit-text-fill-color:#FFD400!important;
}
/* =========================================================
EditOptions bar
========================================================= */
body.a11y-contrast .editOptions{
background:#000!important;
color:#FFD400!important;
border-color:rgba(255,212,0,.85)!important;
}
body.a11y-contrast .editOptions button,
body.a11y-contrast .editOptions input,
body.a11y-contrast .editOptions select{
background:#000!important;
color:#FFD400!important;
border:2px solid rgba(255,212,0,.85)!important;
}
/* =========================================================
WikiEditor — SAFE styling (no icon breakage)
========================================================= */
body.a11y-contrast .wikiEditor-ui,
body.a11y-contrast .wikiEditor-ui-toolbar,
body.a11y-contrast .wikiEditor-ui-toolbar .group,
body.a11y-contrast .wikiEditor-ui-toolbar .section{
background-color:#000!important;
color:#FFD400!important;
border-color:rgba(255,212,0,.85)!important;
}
/* DO NOT touch background-image on icons */
body.a11y-contrast .wikiEditor-ui .oo-ui-iconElement-icon{
background-color:transparent!important;
}
/* =========================================================
Codex (CDX) messages
========================================================= */
body.a11y-contrast .cdx-message,
body.a11y-contrast .cdx-message--block,
body.a11y-contrast .cdx-message--error{
background:#000!important;
color:#FFD400!important;
border:2px solid rgba(255,212,0,.85)!important;
}
body.a11y-contrast .cdx-message__content,
body.a11y-contrast .cdx-message__content *{
background:transparent!important;
color:#FFD400!important;
}
body.a11y-contrast .cdx-message__icon,
body.a11y-contrast .cdx-message__icon *{
fill:#FFD400!important;
}
/* =========================================================
EMERGENCY: ensure accessibility toggle always visible
KEEP AT VERY END
========================================================= */
#a11y-toggle.a11y-toggle{
position:fixed!important;
right:16px!important;
bottom:16px!important;
display:inline-flex!important;
visibility:visible!important;
opacity:1!important;
z-index:2147483647!important;
pointer-events:auto!important;
transform:none!important;
}
#a11y-toggle.a11y-toggle svg{
display:block!important;
visibility:visible!important;
opacity:1!important;
}
