MediaWiki:Gadget-bhc-accessibility.css: Difference between revisions
Tags: Undo Reverted |
CSS Rebuild prior to editor toolbar issues Tag: Reverted |
||
| Line 4: | Line 4: | ||
/* ========================================================= | /* ========================================================= | ||
BHC Accessibility Gadget – MediaWiki / Timeless | BHC Accessibility Gadget – MediaWiki / Timeless (STABLE BASELINE) | ||
- Includes: gadget UI, skip links, site-wide contrast coverage | |||
- Excludes: editor toolbar / WikiEditor / OOUI / Codex / editOptions / scrollbars | |||
========================================================= */ | ========================================================= */ | ||
| Line 19: | Line 21: | ||
} | } | ||
/* Timeless: stop skin CSS shrinking the accessibility icon */ | /* --------------------------------------------------------- | ||
Timeless: stop skin CSS shrinking the accessibility icon | |||
--------------------------------------------------------- */ | |||
body.skin-timeless .a11y-toggle{ | body.skin-timeless .a11y-toggle{ | ||
font-size: 16px !important; | font-size: 16px !important; | ||
| Line 32: | Line 36: | ||
max-width: none !important; | max-width: none !important; | ||
max-height: none !important; | max-height: none !important; | ||
transform: scale(1.15) !important; | transform: scale(1.15) !important; | ||
transform-origin: 50% 50% !important; | transform-origin: 50% 50% !important; | ||
} | } | ||
body.skin-timeless .a11y-toggle svg path{ | body.skin-timeless .a11y-toggle svg path{ | ||
fill: currentColor !important; | fill: currentColor !important; | ||
| Line 43: | Line 44: | ||
/* --------------------------------------------------------- | /* --------------------------------------------------------- | ||
Skip links ( | Skip links (focus-only) | ||
--------------------------------------------------------- */ | --------------------------------------------------------- */ | ||
.skip-link{ | .skip-link{ | ||
position: absolute; | position: absolute; | ||
left: 12px; | left: 12px; | ||
top: | top: -9999px; /* hidden until focus */ | ||
z-index: 11000; | z-index: 11000; | ||
| Line 57: | Line 58: | ||
color: #fff; | color: #fff; | ||
text-decoration: none; | text-decoration: none; | ||
border: 2px solid var(--a11y-focus); | border: 2px solid var(--a11y-focus); | ||
} | } | ||
.skip-link:focus, | .skip-link:focus, | ||
.skip-link:focus-visible{ | .skip-link:focus-visible{ | ||
top: 12px; | top: 12px; | ||
outline: none; | outline: none; | ||
z-index: 11001; | z-index: 11001; | ||
| Line 76: | Line 75: | ||
} | } | ||
/* Stack | /* Stack skip links only while focused */ | ||
#a11y-skip-content:focus, | #a11y-skip-content:focus, | ||
#a11y-skip-content:focus-visible{ top: 56px; } | #a11y-skip-content:focus-visible{ top: 56px; } | ||
| Line 85: | Line 84: | ||
#a11y-skip-search:focus, | #a11y-skip-search:focus, | ||
#a11y-skip-search:focus-visible{ top: 144px; } | #a11y-skip-search:focus-visible{ top: 144px; } | ||
/* --------------------------------------------------------- | /* --------------------------------------------------------- | ||
| Line 125: | Line 123: | ||
Panel | Panel | ||
--------------------------------------------------------- */ | --------------------------------------------------------- */ | ||
.a11y-status{ | .a11y-status{ | ||
font-size: 13px; | font-size: 13px; | ||
| Line 152: | Line 149: | ||
.a11y-panel[hidden]{ display:none !important; } | .a11y-panel[hidden]{ display:none !important; } | ||
.a11y-head{ | .a11y-head{ | ||
display:flex; | display:flex; | ||
| Line 163: | Line 159: | ||
margin: 0; | margin: 0; | ||
} | } | ||
.a11y-help{ | .a11y-help{ | ||
width: 28px; | width: 28px; | ||
| Line 180: | Line 177: | ||
} | } | ||
.a11y-row{ | .a11y-row{ | ||
display:flex; | display:flex; | ||
| Line 212: | Line 208: | ||
} | } | ||
.a11y-sr{ | .a11y-sr{ | ||
position:absolute; | position:absolute; | ||
| Line 226: | Line 221: | ||
/* ------------------------------ | /* ------------------------------ | ||
High contrast ( | High contrast (site-wide) | ||
------------------------------ */ | ------------------------------ */ | ||
body.a11y-contrast{ | body.a11y-contrast{ | ||
| Line 239: | Line 234: | ||
} | } | ||
/* Global link colour in contrast mode */ | |||
body.a11y-contrast a, | body.a11y-contrast a, | ||
body.a11y-contrast a:visited{ | body.a11y-contrast a:visited{ | ||
| Line 255: | Line 251: | ||
} | } | ||
/* Main containers | /* Main containers */ | ||
body.a11y-contrast #mw-wrapper, | body.a11y-contrast #mw-wrapper, | ||
body.a11y-contrast #mw-content-container, | body.a11y-contrast #mw-content-container, | ||
| Line 265: | Line 261: | ||
} | } | ||
/* Sidebars / | /* Timeless header container */ | ||
body.a11y-contrast.skin-timeless #mw-header-container{ | |||
background: #000 !important; | |||
background-image: none !important; | |||
} | |||
/* Search input (Timeless is forceful, so be explicit) */ | |||
body.a11y-contrast #searchInput, | |||
body.a11y-contrast #p-search #searchInput, | |||
body.a11y-contrast #p-search input[type="search"]{ | |||
background: #000 !important; | |||
color: #FFD400 !important; | |||
caret-color: #FFD400 !important; | |||
border: 2px solid #FFD400 !important; | |||
box-shadow: none !important; | |||
-webkit-text-fill-color: #FFD400 !important; | |||
} | |||
body.a11y-contrast #searchInput::placeholder{ | |||
color: rgba(255,212,0,0.75) !important; | |||
} | |||
/* Sidebars / portlets */ | |||
body.a11y-contrast #site-navigation, | body.a11y-contrast #site-navigation, | ||
body.a11y-contrast #site-tools, | body.a11y-contrast #site-tools, | ||
| Line 275: | Line 292: | ||
border-color: rgba(255,212,0,.7) !important; | border-color: rgba(255,212,0,.7) !important; | ||
} | } | ||
body.a11y-contrast .mw-portlet-body *{ | body.a11y-contrast .mw-portlet-body *{ | ||
color:#FFD400 !important; | color:#FFD400 !important; | ||
} | } | ||
/* | /* Timeless sidebar chunks (1100–1339px) */ | ||
body.a11y-contrast #site-navigation | @media screen and (min-width: 1100px) and (max-width: 1339px){ | ||
body.a11y-contrast #site- | body.a11y-contrast.skin-timeless #mw-site-navigation .sidebar-chunk, | ||
body.a11y-contrast # | body.a11y-contrast.skin-timeless #mw-related-navigation .sidebar-chunk{ | ||
background: #000 !important; | |||
background-image: none !important; | |||
border-color: rgba(255,212,0,.85) !important; | |||
box-shadow: none !important; | |||
} | |||
body.a11y-contrast.skin-timeless #mw-site-navigation .sidebar-chunk *, | |||
body.a11y-contrast.skin-timeless #mw-related-navigation .sidebar-chunk *{ | |||
color: #FFD400 !important; | |||
} | |||
} | } | ||
/* | /* Timeless related-navigation sidebar chunk at ≥1340px */ | ||
@media screen and (min-width: 1340px){ | |||
body.a11y-contrast . | body.a11y-contrast.skin-timeless #mw-related-navigation .sidebar-chunk{ | ||
background: #000 !important; | |||
background-image: none !important; | |||
border-color: rgba(255,212,0,.85) !important; | |||
box-shadow: none !important; | |||
} | |||
} | } | ||
/* | /* mw-content border colour in high-contrast mode */ | ||
body.a11y-contrast | body.a11y-contrast #mw-content{ | ||
border-color: #FFD400 !important; | |||
border | |||
} | } | ||
/* TOC */ | /* TOC */ | ||
body.a11y-contrast #toc, | body.a11y-contrast #toc, | ||
body.a11y-contrast .toc, | body.a11y-contrast .toc, | ||
body.a11y-contrast #toc * , | body.a11y-contrast #toc *, | ||
body.a11y-contrast .toc *{ | body.a11y-contrast .toc *{ | ||
background: #000 !important; | background: #000 !important; | ||
| Line 393: | Line 346: | ||
} | } | ||
/* | /* Tables */ | ||
body.a11y-contrast table, | body.a11y-contrast table, | ||
body.a11y-contrast table *, | body.a11y-contrast table *, | ||
| Line 413: | Line 366: | ||
body.a11y-contrast figure, | body.a11y-contrast figure, | ||
body.a11y-contrast figure *, | body.a11y-contrast figure *, | ||
body.a11y-contrast .thumb, | body.a11y-contrast .thumb, | ||
body.a11y-contrast .thumb *, | body.a11y-contrast .thumb *, | ||
| Line 443: | Line 387: | ||
} | } | ||
/* | /* Footer */ | ||
body.a11y-contrast #mw-footer, | body.a11y-contrast #mw-footer, | ||
body.a11y-contrast #mw-footer-container{ | body.a11y-contrast #mw-footer-container{ | ||
| Line 458: | Line 394: | ||
background-image: none !important; | background-image: none !important; | ||
border-top: 10px solid #FFD400 !important; | border-top: 10px solid #FFD400 !important; | ||
} | } | ||
body.a11y-contrast #mw-footer a, | body.a11y-contrast #mw-footer a, | ||
| Line 470: | Line 399: | ||
color: #FFD400 !important; | color: #FFD400 !important; | ||
text-decoration-color: #FFD400 !important; | text-decoration-color: #FFD400 !important; | ||
} | } | ||
/* | /* ------------------------------ | ||
Underline links | Underline links | ||
------------------------------ */ | |||
body.a11y-underline-links | body.a11y-underline-links a{ | ||
text-decoration: none !important; | |||
border-bottom | border-bottom: 2px solid var(--a11y-link-underline); | ||
padding-bottom: 0.05em; | |||
} | } | ||
body.a11y-underline-links.a11y-contrast | body.a11y-underline-links.a11y-contrast a{ | ||
border-bottom-color: #36C !important; | border-bottom-color: #36C !important; | ||
} | } | ||
/* | /* ------------------------------ | ||
Text spacing | |||
------------------------------ */ | |||
body.a11y-spacing-plus{ | |||
line-height: 1.8 !important; | |||
body.a11y- | letter-spacing: 0.06em !important; | ||
word-spacing: 0.16em !important; | |||
} | } | ||
body.a11y-spacing-minus{ | |||
line-height: 1.45 !important; | |||
letter-spacing: 0.01em !important; | |||
word-spacing: 0.02em !important; | |||
body.a11y- | |||
} | } | ||
/* | /* ------------------------------ | ||
Large cursors (wiki-hosted) | |||
------------------------------ */ | |||
body.a11y- | body.a11y-cursor-white, | ||
body.a11y-cursor-white *{ | |||
cursor: url("/index.php/Special:FilePath/large-arrow-white-64.png") 8 8, auto !important; | |||
} | } | ||
body.a11y-cursor-yellow, | |||
body.a11y-cursor-yellow *{ | |||
body.a11y- | cursor: url("/index.php/Special:FilePath/large-arrow-yellow-64.png") 8 8, auto !important; | ||
body.a11y- | |||
} | } | ||
/* | /* ------------------------------ | ||
Reading ruler | |||
------------------------------ */ | |||
#a11y-ruler{ | |||
position: fixed; | |||
left: 0; | |||
top: 0; | |||
height: 22px; | |||
width: 100vw; | |||
z-index: 9999; | |||
pointer-events: none; | |||
background: linear-gradient( | |||
to bottom, | |||
#FFD400 0%, | |||
#FFD400 40%, | |||
#000000 40%, | |||
background: | #000000 60%, | ||
#FFD400 60%, | |||
#FFD400 100% | |||
); | |||
} | } | ||
#a11y-ruler[hidden]{ display:none !important; } | |||
/* ========================================================= | /* ========================================================= | ||
| Line 822: | Line 485: | ||
visibility: visible !important; | visibility: visible !important; | ||
opacity: 1 !important; | opacity: 1 !important; | ||
} | } | ||
Revision as of 15:34, 28 January 2026
/*
⚠️ Do not reorder rules below this line — contrast overrides depend on cascade order.
*/
/* =========================================================
BHC Accessibility Gadget – MediaWiki / Timeless (STABLE BASELINE)
- Includes: gadget UI, skip links, site-wide contrast coverage
- Excludes: editor toolbar / WikiEditor / OOUI / Codex / editOptions / scrollbars
========================================================= */
/* ---------------------------------------------------------
Variables
--------------------------------------------------------- */
:root{
--a11y-bg: #111827;
--a11y-border: #374151;
--a11y-fg: #ffffff;
--a11y-focus: #FFBF47;
--a11y-link-underline: #36C; /* MediaWiki link blue */
--a11y-menu-width: 340px;
}
/* ---------------------------------------------------------
Timeless: stop skin CSS shrinking the accessibility icon
--------------------------------------------------------- */
body.skin-timeless .a11y-toggle{
font-size: 16px !important;
line-height: 1 !important;
}
body.skin-timeless .a11y-toggle svg{
display: block !important;
width: 36px !important;
height: 36px !important;
min-width: 36px !important;
min-height: 36px !important;
max-width: none !important;
max-height: none !important;
transform: scale(1.15) !important;
transform-origin: 50% 50% !important;
}
body.skin-timeless .a11y-toggle svg path{
fill: currentColor !important;
}
/* ---------------------------------------------------------
Skip links (focus-only)
--------------------------------------------------------- */
.skip-link{
position: absolute;
left: 12px;
top: -9999px; /* hidden until focus */
z-index: 11000;
padding: 10px 14px;
border-radius: 8px;
background: #111827;
color: #fff;
text-decoration: none;
border: 2px solid var(--a11y-focus);
}
.skip-link:focus,
.skip-link:focus-visible{
top: 12px;
outline: none;
z-index: 11001;
}
body.a11y-contrast .skip-link{
background: #000 !important;
color: #FFD400 !important;
border-color: #FFD400 !important;
}
/* Stack skip links only while focused */
#a11y-skip-content:focus,
#a11y-skip-content:focus-visible{ top: 56px; }
#a11y-skip-nav:focus,
#a11y-skip-nav:focus-visible{ top: 100px; }
#a11y-skip-search:focus,
#a11y-skip-search:focus-visible{ top: 144px; }
/* ---------------------------------------------------------
Floating accessibility toggle
--------------------------------------------------------- */
.a11y-toggle{
position: fixed;
right: 16px;
bottom: 16px;
z-index: 10001;
width: 56px;
height: 56px;
border-radius: 50%;
background: #005FCC;
border: 2px solid #ffffff;
color: #ffffff;
display: inline-flex;
align-items: center;
justify-content: center;
box-shadow: 0 10px 24px rgba(0,0,0,0.25);
cursor: pointer;
}
.a11y-toggle:hover{ background:#0047A6; }
.a11y-toggle:focus-visible{
outline: 3px solid var(--a11y-focus);
outline-offset: 3px;
}
.a11y-toggle svg{
width: 44px;
height: 44px;
fill: currentColor;
}
/* ---------------------------------------------------------
Panel
--------------------------------------------------------- */
.a11y-status{
font-size: 13px;
line-height: 1.25;
margin: 6px 0 8px;
opacity: 0.95;
}
.a11y-panel{
position: fixed;
right: 14px;
bottom: 76px;
z-index: 10000;
width: var(--a11y-menu-width);
max-width: calc(100vw - 28px);
background: var(--a11y-bg);
border: 1px solid var(--a11y-border);
color: var(--a11y-fg);
border-radius: 16px;
padding: 12px;
box-shadow: 0 14px 40px rgba(0,0,0,0.28);
}
.a11y-panel[hidden]{ display:none !important; }
.a11y-head{
display:flex;
align-items:center;
justify-content: space-between;
margin-bottom: 10px;
}
.a11y-head h2{
font-size: 16px;
margin: 0;
}
.a11y-help{
width: 28px;
height: 28px;
border-radius: 50%;
background: #fff;
color: #111827;
font-weight: 900;
text-decoration: none;
display:flex;
align-items:center;
justify-content:center;
}
.a11y-help:focus-visible{
outline: 3px solid var(--a11y-focus);
outline-offset: 2px;
}
.a11y-row{
display:flex;
gap: 8px;
flex-wrap: wrap;
margin-bottom: 10px;
}
.a11y-btn{
border: 1px solid #D1D5DB;
background:#fff;
color:#111827;
padding: 8px 10px;
border-radius: 999px;
font-size: 14px;
font-weight: 800;
cursor: pointer;
}
.a11y-btn[aria-pressed="true"]{
background:#111827;
color:#fff;
}
.a11y-btn:focus-visible{
outline: 3px solid var(--a11y-focus);
outline-offset: 2px;
}
.a11y-hint{
font-size: 13px;
color: var(--a11y-fg);
line-height: 1.4;
}
.a11y-sr{
position:absolute;
width:1px;
height:1px;
overflow:hidden;
clip:rect(0,0,0,0);
}
/* =========================================================
Feature classes
========================================================= */
/* ------------------------------
High contrast (site-wide)
------------------------------ */
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;
--a11y-link-underline: #36C;
}
/* Global link colour in contrast mode */
body.a11y-contrast a,
body.a11y-contrast a:visited{
color:#FFD400 !important;
}
/* Headings */
body.a11y-contrast h1,
body.a11y-contrast h2,
body.a11y-contrast h3,
body.a11y-contrast h4,
body.a11y-contrast h5,
body.a11y-contrast h6{
color:#FFD400 !important;
border-color:#FFD400 !important;
}
/* Main containers */
body.a11y-contrast #mw-wrapper,
body.a11y-contrast #mw-content-container,
body.a11y-contrast #mw-content,
body.a11y-contrast .mw-body,
body.a11y-contrast .mw-parser-output{
background:#000 !important;
color:#FFD400 !important;
}
/* Timeless header container */
body.a11y-contrast.skin-timeless #mw-header-container{
background: #000 !important;
background-image: none !important;
}
/* Search input (Timeless is forceful, so be explicit) */
body.a11y-contrast #searchInput,
body.a11y-contrast #p-search #searchInput,
body.a11y-contrast #p-search input[type="search"]{
background: #000 !important;
color: #FFD400 !important;
caret-color: #FFD400 !important;
border: 2px solid #FFD400 !important;
box-shadow: none !important;
-webkit-text-fill-color: #FFD400 !important;
}
body.a11y-contrast #searchInput::placeholder{
color: rgba(255,212,0,0.75) !important;
}
/* Sidebars / portlets */
body.a11y-contrast #site-navigation,
body.a11y-contrast #site-tools,
body.a11y-contrast #page-tools,
body.a11y-contrast .mw-portlet,
body.a11y-contrast .mw-portlet-body{
background:#000 !important;
color:#FFD400 !important;
border-color: rgba(255,212,0,.7) !important;
}
body.a11y-contrast .mw-portlet-body *{
color:#FFD400 !important;
}
/* Timeless sidebar chunks (1100–1339px) */
@media screen and (min-width: 1100px) and (max-width: 1339px){
body.a11y-contrast.skin-timeless #mw-site-navigation .sidebar-chunk,
body.a11y-contrast.skin-timeless #mw-related-navigation .sidebar-chunk{
background: #000 !important;
background-image: none !important;
border-color: rgba(255,212,0,.85) !important;
box-shadow: none !important;
}
body.a11y-contrast.skin-timeless #mw-site-navigation .sidebar-chunk *,
body.a11y-contrast.skin-timeless #mw-related-navigation .sidebar-chunk *{
color: #FFD400 !important;
}
}
/* Timeless related-navigation sidebar chunk at ≥1340px */
@media screen and (min-width: 1340px){
body.a11y-contrast.skin-timeless #mw-related-navigation .sidebar-chunk{
background: #000 !important;
background-image: none !important;
border-color: rgba(255,212,0,.85) !important;
box-shadow: none !important;
}
}
/* mw-content border colour in high-contrast mode */
body.a11y-contrast #mw-content{
border-color: #FFD400 !important;
}
/* TOC */
body.a11y-contrast #toc,
body.a11y-contrast .toc,
body.a11y-contrast #toc *,
body.a11y-contrast .toc *{
background: #000 !important;
color: #FFD400 !important;
border-color: rgba(255, 212, 0, 0.75) !important;
}
/* Category links area */
body.a11y-contrast .mw-normal-catlinks,
body.a11y-contrast .mw-normal-catlinks *,
body.a11y-contrast .catlinks,
body.a11y-contrast .catlinks *{
background: #000 !important;
color: #FFD400 !important;
border-color: rgba(255, 212, 0, 0.75) !important;
}
/* Tables */
body.a11y-contrast table,
body.a11y-contrast table *,
body.a11y-contrast .wikitable,
body.a11y-contrast .wikitable *,
body.a11y-contrast .mw-datatable,
body.a11y-contrast .mw-datatable *{
background: #000 !important;
color: #FFD400 !important;
border-color: rgba(255, 212, 0, 0.75) !important;
}
body.a11y-contrast .wikitable th,
body.a11y-contrast table th{
background: #000 !important;
color: #FFD400 !important;
}
/* Figures/captions */
body.a11y-contrast figure,
body.a11y-contrast figure *,
body.a11y-contrast .thumb,
body.a11y-contrast .thumb *,
body.a11y-contrast .thumbinner,
body.a11y-contrast .thumbinner *,
body.a11y-contrast .thumbcaption,
body.a11y-contrast .thumbcaption *{
background: #000 !important;
color: #FFD400 !important;
border-color: rgba(255, 212, 0, 0.75) !important;
}
/* Code-like blocks */
body.a11y-contrast pre,
body.a11y-contrast pre *,
body.a11y-contrast code,
body.a11y-contrast code *{
background: #000 !important;
color: #FFD400 !important;
border-color: rgba(255, 212, 0, 0.75) !important;
}
/* Footer */
body.a11y-contrast #mw-footer,
body.a11y-contrast #mw-footer-container{
background: #000 !important;
color: #FFD400 !important;
background-image: none !important;
border-top: 10px solid #FFD400 !important;
}
body.a11y-contrast #mw-footer a,
body.a11y-contrast #mw-footer a:visited{
color: #FFD400 !important;
text-decoration-color: #FFD400 !important;
}
/* ------------------------------
Underline links
------------------------------ */
body.a11y-underline-links a{
text-decoration: none !important;
border-bottom: 2px solid var(--a11y-link-underline);
padding-bottom: 0.05em;
}
body.a11y-underline-links.a11y-contrast a{
border-bottom-color: #36C !important;
}
/* ------------------------------
Text spacing
------------------------------ */
body.a11y-spacing-plus{
line-height: 1.8 !important;
letter-spacing: 0.06em !important;
word-spacing: 0.16em !important;
}
body.a11y-spacing-minus{
line-height: 1.45 !important;
letter-spacing: 0.01em !important;
word-spacing: 0.02em !important;
}
/* ------------------------------
Large cursors (wiki-hosted)
------------------------------ */
body.a11y-cursor-white,
body.a11y-cursor-white *{
cursor: url("/index.php/Special:FilePath/large-arrow-white-64.png") 8 8, auto !important;
}
body.a11y-cursor-yellow,
body.a11y-cursor-yellow *{
cursor: url("/index.php/Special:FilePath/large-arrow-yellow-64.png") 8 8, auto !important;
}
/* ------------------------------
Reading ruler
------------------------------ */
#a11y-ruler{
position: fixed;
left: 0;
top: 0;
height: 22px;
width: 100vw;
z-index: 9999;
pointer-events: none;
background: linear-gradient(
to bottom,
#FFD400 0%,
#FFD400 40%,
#000000 40%,
#000000 60%,
#FFD400 60%,
#FFD400 100%
);
}
#a11y-ruler[hidden]{ display:none !important; }
/* =========================================================
EMERGENCY: ensure the accessibility toggle is 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;
}
