MediaWiki:Gadget-bhc-accessibility.css: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/* ========================================================= | |||
BHC Accessibility Gadget CSS (MediaWiki) | |||
- Floating launcher + panel | |||
- High contrast (black/yellow) across Timeless containers | |||
- Underline links, spacing presets | |||
- Two large cursors via uploaded wiki files | |||
- Reading ruler overlay | |||
========================================================= */ | |||
/* ========================================================= | /* ========================================================= | ||
Accessibility launcher + menu (bottom-right icon) | Accessibility launcher + menu (bottom-right icon) | ||
| Line 75: | Line 84: | ||
font-size: 16px; | font-size: 16px; | ||
margin: 0; | margin: 0; | ||
color: inherit; | |||
} | } | ||
.a11y-help{ | .a11y-help{ | ||
| Line 133: | Line 143: | ||
/* Small explanatory text */ | /* Small explanatory text */ | ||
.a11y-hint{ | .a11y-hint{ | ||
font-size: | font-size: 14px; | ||
color: #D1D5DB; | color: #D1D5DB; | ||
margin-top: 6px; | margin-top: 6px; | ||
| Line 156: | Line 166: | ||
========================================================= */ | ========================================================= */ | ||
/* High contrast: black + yellow */ | |||
/* High contrast: black + yellow | |||
body.a11y-contrast{ | body.a11y-contrast{ | ||
background:#000 !important; | background:#000 !important; | ||
| Line 171: | Line 180: | ||
/* Links */ | /* Links */ | ||
body.a11y-contrast a | body.a11y-contrast a, | ||
body.a11y-contrast a:visited{ | |||
body.a11y-contrast | |||
color:#FFD400 !important; | color:#FFD400 !important; | ||
} | } | ||
| Line 188: | Line 189: | ||
body.a11y-contrast .a11y-toggle{ | body.a11y-contrast .a11y-toggle{ | ||
background:#000 !important; | background:#000 !important; | ||
border-color: rgba(255, 212, 0, 0.75) !important; | |||
color: #FFD400 !important; | |||
} | } | ||
/* | /* Panel buttons readable in contrast mode */ | ||
body.a11y-contrast .a11y-hint{ | body.a11y-contrast .a11y-hint{ | ||
color:#FFD400 !important; | color:#FFD400 !important; | ||
} | } | ||
body.a11y-contrast .a11y-btn{ | body.a11y-contrast .a11y-btn{ | ||
background:#000000 !important; | background:#000000 !important; | ||
| Line 203: | Line 202: | ||
border:2px solid rgba(255, 212, 0, 0.85) !important; | border:2px solid rgba(255, 212, 0, 0.85) !important; | ||
} | } | ||
body.a11y-contrast .a11y-btn:hover{ background:#111111 !important; } | |||
body.a11y-contrast .a11y-btn:hover{ | |||
} | |||
body.a11y-contrast .a11y-btn[aria-pressed="true"]{ | body.a11y-contrast .a11y-btn[aria-pressed="true"]{ | ||
background:#000000 !important; | background:#000000 !important; | ||
color:#FFD400 !important; | color:#FFD400 !important; | ||
border-color:#FFD400 !important; | border-color:#FFD400 !important; | ||
} | } | ||
| Line 244: | Line 231: | ||
} | } | ||
/* Large cursor (two options) — | /* Large cursor (two options) — use wiki-uploaded files */ | ||
body.a11y-cursor-white, | body.a11y-cursor-white, | ||
body.a11y-cursor-white *{ | body.a11y-cursor-white *{ | ||
| Line 280: | Line 267: | ||
#a11y-ruler[hidden]{ display:none !important; } | #a11y-ruler[hidden]{ display:none !important; } | ||
/* Skip link: visible only when focused */ | /* Skip link: visible only when focused (optional) */ | ||
.skip-link { | .skip-link{ | ||
position: absolute; | position: absolute; | ||
left: 12px; | left: 12px; | ||
| Line 295: | Line 282: | ||
border: 2px solid #FFBF47; | border: 2px solid #FFBF47; | ||
} | } | ||
.skip-link:focus, | .skip-link:focus, | ||
.skip-link:focus-visible { | .skip-link:focus-visible{ | ||
transform: translateY(0); | transform: translateY(0); | ||
outline: none; | outline: none; | ||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
MediaWiki/Timeless: HIGH CONTRAST coverage | MediaWiki/Timeless: HIGH CONTRAST coverage | ||
Timeless sets backgrounds/colours on containers, not body. | |||
========================================================= */ | ========================================================= */ | ||
| Line 437: | Line 302: | ||
body.a11y-contrast .mw-body, | body.a11y-contrast .mw-body, | ||
body.a11y-contrast .mw-parser-output, | body.a11y-contrast .mw-parser-output, | ||
body.a11y-contrast #mw-header-container, | body.a11y-contrast #mw-header-container, | ||
body.a11y-contrast #mw-footer-container{ | body.a11y-contrast #mw-footer-container{ | ||
| Line 445: | Line 309: | ||
} | } | ||
/* Headings ( | /* YOUR REQUESTED IDS: black side areas */ | ||
body.a11y-contrast #site-navigation, | |||
body.a11y-contrast #site-tools, | |||
body.a11y-contrast #page-tools{ | |||
background: #000 !important; | |||
color: #FFD400 !important; | |||
background-image: none !important; | |||
border-color: rgba(255, 212, 0, 0.75) !important; | |||
} | |||
/* Timeless nav containers often used */ | |||
body.a11y-contrast #mw-site-navigation, | |||
body.a11y-contrast #mw-related-navigation, | |||
body.a11y-contrast #mw-navigation, | |||
body.a11y-contrast #mw-panel, | |||
body.a11y-contrast .mw-sidebar, | |||
body.a11y-contrast .sidebar, | |||
body.a11y-contrast .mw-portlet, | |||
body.a11y-contrast .mw-portlet-body{ | |||
background: #000 !important; | |||
color: #FFD400 !important; | |||
background-image: none !important; | |||
border-color: rgba(255, 212, 0, 0.75) !important; | |||
} | |||
/* Headings (Timeless theme sets coloured headings; override) */ | |||
body.a11y-contrast h1, | body.a11y-contrast h1, | ||
body.a11y-contrast h2, | body.a11y-contrast h2, | ||
| Line 457: | Line 346: | ||
color: #FFD400 !important; | color: #FFD400 !important; | ||
border-color: #FFD400 !important; | border-color: #FFD400 !important; | ||
} | } | ||
| Line 475: | Line 358: | ||
color: #FFD400 !important; | color: #FFD400 !important; | ||
border-color: rgba(255, 212, 0, 0.75) !important; | border-color: rgba(255, 212, 0, 0.75) !important; | ||
} | } | ||
Revision as of 19:36, 25 January 2026
/* =========================================================
BHC Accessibility Gadget CSS (MediaWiki)
- Floating launcher + panel
- High contrast (black/yellow) across Timeless containers
- Underline links, spacing presets
- Two large cursors via uploaded wiki files
- Reading ruler overlay
========================================================= */
/* =========================================================
Accessibility launcher + menu (bottom-right icon)
========================================================= */
:root{
--a11y-bg: #111827; /* dark slate */
--a11y-border: #374151;
--a11y-fg: #ffffff;
--a11y-focus: #FFBF47; /* strong focus outline */
--a11y-link-underline: #1D4ED8; /* underline color (non-contrast mode) */
--a11y-menu-width: 340px;
}
/* Floating accessibility icon button */
.a11y-toggle{
position: fixed;
right: 16px;
bottom: 16px;
z-index: 10001;
width: 56px;
height: 56px;
border-radius: 50%;
background: #005FCC; /* accessibility blue */
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: 34px;
height: 34px;
fill: currentColor;
}
/* Menu panel (opens above the button) */
.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; }
/* Panel header row */
.a11y-head{
display:flex;
align-items:center;
justify-content: space-between;
gap: 10px;
margin: 0 0 10px 0;
}
.a11y-head h2{
font-size: 16px;
margin: 0;
color: inherit;
}
.a11y-help{
display:inline-flex;
align-items:center;
justify-content:center;
width: 28px;
height: 28px;
border-radius: 999px;
border: 1px solid #ffffff;
color: #111827;
background: #ffffff;
text-decoration: none;
font-weight: 900;
line-height: 1;
}
.a11y-help:hover{ background:#F3F4F6; }
.a11y-help:focus-visible{
outline: 3px solid var(--a11y-focus);
outline-offset: 2px;
}
/* Button rows */
.a11y-row{
display:flex;
gap: 8px;
flex-wrap: wrap;
align-items:center;
margin-bottom: 10px;
}
.a11y-btn{
appearance:none;
border: 1px solid #D1D5DB;
background:#FFFFFF;
color:#111827;
padding: 8px 10px;
border-radius: 999px;
font-size: 14px;
line-height: 1;
font-weight: 800;
cursor: pointer;
}
.a11y-btn:hover{ background:#F3F4F6; }
.a11y-btn:active{ transform: translateY(1px); }
.a11y-btn:focus-visible{
outline: 3px solid var(--a11y-focus);
outline-offset: 2px;
}
/* Pressed state */
.a11y-btn[aria-pressed="true"]{
background:#111827;
color:#ffffff;
border-color:#ffffff;
}
/* Small explanatory text */
.a11y-hint{
font-size: 14px;
color: #D1D5DB;
margin-top: 6px;
line-height: 1.4;
}
/* Visually hidden helper (for aria-live etc) */
.a11y-sr{
position:absolute !important;
width:1px !important;
height:1px !important;
padding:0 !important;
margin:-1px !important;
overflow:hidden !important;
clip:rect(0,0,0,0) !important;
white-space:nowrap !important;
border:0 !important;
}
/* =========================================================
Features applied to page via classes / inline font sizing
========================================================= */
/* High contrast: black + yellow */
body.a11y-contrast{
background:#000 !important;
color:#FFD400 !important;
/* make the toolbar/panel inherit the same scheme */
--a11y-bg: #000000;
--a11y-border: rgba(255, 212, 0, 0.75);
--a11y-fg: #FFD400;
--a11y-focus: #FFD400;
--a11y-link-underline: #FFD400;
}
/* Links */
body.a11y-contrast a,
body.a11y-contrast a:visited{
color:#FFD400 !important;
}
/* Keep dark surfaces dark */
body.a11y-contrast .a11y-panel,
body.a11y-contrast .a11y-toggle{
background:#000 !important;
border-color: rgba(255, 212, 0, 0.75) !important;
color: #FFD400 !important;
}
/* Panel buttons readable in contrast mode */
body.a11y-contrast .a11y-hint{
color:#FFD400 !important;
}
body.a11y-contrast .a11y-btn{
background:#000000 !important;
color:#FFD400 !important;
border:2px solid rgba(255, 212, 0, 0.85) !important;
}
body.a11y-contrast .a11y-btn:hover{ background:#111111 !important; }
body.a11y-contrast .a11y-btn[aria-pressed="true"]{
background:#000000 !important;
color:#FFD400 !important;
border-color:#FFD400 !important;
}
/* Underline links */
body.a11y-underline-links a{
text-decoration-line: underline !important;
text-decoration-thickness: 3px;
text-underline-offset: 3px;
}
body.a11y-underline-links:not(.a11y-contrast) a{
text-decoration-color: var(--a11y-link-underline) !important;
}
/* Text spacing presets */
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 cursor (two options) — use wiki-uploaded files */
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 overlay — JS positions #a11y-ruler */
#a11y-ruler{
position: fixed;
left: 0;
top: 0;
height: 22px;
width: 100vw;
z-index: 9999;
pointer-events: none;
background: linear-gradient(
to bottom,
#C8FF00 0%,
#C8FF00 40%,
#000000 40%,
#000000 60%,
#C8FF00 60%,
#C8FF00 100%
);
opacity: 0.95;
border-top: 1px solid rgba(0,0,0,0.35);
border-bottom: 1px solid rgba(0,0,0,0.35);
}
#a11y-ruler[hidden]{ display:none !important; }
/* Skip link: visible only when focused (optional) */
.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 0.15s ease;
border: 2px solid #FFBF47;
}
.skip-link:focus,
.skip-link:focus-visible{
transform: translateY(0);
outline: none;
}
/* =========================================================
MediaWiki/Timeless: HIGH CONTRAST coverage
Timeless sets backgrounds/colours on containers, not body.
========================================================= */
html body.a11y-contrast,
body.a11y-contrast #mw-wrapper,
body.a11y-contrast #mw-content-container,
body.a11y-contrast #mw-content-block,
body.a11y-contrast #mw-content-wrapper,
body.a11y-contrast #mw-content,
body.a11y-contrast #content,
body.a11y-contrast .mw-body,
body.a11y-contrast .mw-parser-output,
body.a11y-contrast #mw-header-container,
body.a11y-contrast #mw-footer-container{
background: #000 !important;
color: #FFD400 !important;
background-image: none !important;
}
/* YOUR REQUESTED IDS: black side areas */
body.a11y-contrast #site-navigation,
body.a11y-contrast #site-tools,
body.a11y-contrast #page-tools{
background: #000 !important;
color: #FFD400 !important;
background-image: none !important;
border-color: rgba(255, 212, 0, 0.75) !important;
}
/* Timeless nav containers often used */
body.a11y-contrast #mw-site-navigation,
body.a11y-contrast #mw-related-navigation,
body.a11y-contrast #mw-navigation,
body.a11y-contrast #mw-panel,
body.a11y-contrast .mw-sidebar,
body.a11y-contrast .sidebar,
body.a11y-contrast .mw-portlet,
body.a11y-contrast .mw-portlet-body{
background: #000 !important;
color: #FFD400 !important;
background-image: none !important;
border-color: rgba(255, 212, 0, 0.75) !important;
}
/* Headings (Timeless theme sets coloured headings; override) */
body.a11y-contrast h1,
body.a11y-contrast h2,
body.a11y-contrast h3,
body.a11y-contrast h4,
body.a11y-contrast h5,
body.a11y-contrast h6,
body.a11y-contrast .mw-parser-output h1,
body.a11y-contrast .mw-parser-output h2,
body.a11y-contrast .mw-parser-output h3{
color: #FFD400 !important;
border-color: #FFD400 !important;
}
/* Common “box” surfaces in MW skins */
body.a11y-contrast .infobox,
body.a11y-contrast .thumbinner,
body.a11y-contrast .mw-parser-output .toc,
body.a11y-contrast .toc,
body.a11y-contrast table,
body.a11y-contrast .wikitable{
background: #000 !important;
color: #FFD400 !important;
border-color: rgba(255, 212, 0, 0.75) !important;
}
