MediaWiki:Gadget-bhc-accessibility.css: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/* ========================================================= | /* ========================================================= | ||
BHC Accessibility Gadget | BHC Accessibility Gadget – MediaWiki / Timeless | ||
========================================================= */ | ========================================================= */ | ||
/* | /* --------------------------------------------------------- | ||
Variables | |||
--------------------------------------------------------- */ | |||
:root{ | :root{ | ||
--a11y-bg: #111827; | --a11y-bg: #111827; | ||
--a11y-border: #374151; | --a11y-border: #374151; | ||
--a11y-fg: #ffffff; | --a11y-fg: #ffffff; | ||
--a11y-focus: #FFBF47; | --a11y-focus: #FFBF47; | ||
--a11y-link-underline: #1D4ED8; | --a11y-link-underline: #1D4ED8; | ||
--a11y-menu-width: 340px; | --a11y-menu-width: 340px; | ||
} | } | ||
/* Floating accessibility | /* --------------------------------------------------------- | ||
Floating accessibility toggle | |||
--------------------------------------------------------- */ | |||
.a11y-toggle{ | .a11y-toggle{ | ||
position: fixed; | position: fixed; | ||
| Line 31: | Line 28: | ||
border-radius: 50%; | border-radius: 50%; | ||
background: #005FCC; | background: #005FCC; | ||
border: 2px solid #ffffff; | border: 2px solid #ffffff; | ||
color: #ffffff; | color: #ffffff; | ||
| Line 48: | Line 45: | ||
} | } | ||
.a11y-toggle svg{ | .a11y-toggle svg{ | ||
width: | width: 44px; | ||
height: | height: 44px; | ||
fill: currentColor; | fill: currentColor; | ||
} | } | ||
/* | /* --------------------------------------------------------- | ||
Panel | |||
--------------------------------------------------------- */ | |||
.a11y-panel{ | .a11y-panel{ | ||
position: fixed; | position: fixed; | ||
| Line 73: | Line 72: | ||
.a11y-panel[hidden]{ display:none !important; } | .a11y-panel[hidden]{ display:none !important; } | ||
/* | /* Header */ | ||
.a11y-head{ | .a11y-head{ | ||
display:flex; | display:flex; | ||
align-items:center; | align-items:center; | ||
justify-content: space-between; | justify-content: space-between; | ||
margin-bottom: 10px; | |||
margin: | |||
} | } | ||
.a11y-head h2{ | .a11y-head h2{ | ||
font-size: 16px; | font-size: 16px; | ||
margin: 0; | margin: 0; | ||
} | } | ||
.a11y-help{ | .a11y-help{ | ||
width: 28px; | width: 28px; | ||
height: 28px; | height: 28px; | ||
border-radius: | border-radius: 50%; | ||
background: #fff; | |||
color: #111827; | color: #111827; | ||
font-weight: 900; | |||
text-decoration: none; | text-decoration: none; | ||
display:flex; | |||
align-items:center; | |||
justify-content:center; | |||
} | } | ||
/* | /* Buttons */ | ||
.a11y-row{ | .a11y-row{ | ||
display:flex; | display:flex; | ||
gap: 8px; | gap: 8px; | ||
flex-wrap: wrap; | flex-wrap: wrap; | ||
margin-bottom: 10px; | margin-bottom: 10px; | ||
} | } | ||
.a11y-btn{ | .a11y-btn{ | ||
border: 1px solid #D1D5DB; | border: 1px solid #D1D5DB; | ||
background:# | background:#fff; | ||
color:#111827; | color:#111827; | ||
padding: 8px 10px; | padding: 8px 10px; | ||
border-radius: 999px; | border-radius: 999px; | ||
font-size: 14px; | font-size: 14px; | ||
font-weight: 800; | font-weight: 800; | ||
cursor: pointer; | cursor: pointer; | ||
} | } | ||
.a11y-btn | .a11y-btn[aria-pressed="true"]{ | ||
background:#111827; | |||
color:#fff; | |||
} | |||
.a11y-btn:focus-visible{ | .a11y-btn:focus-visible{ | ||
outline: 3px solid var(--a11y-focus); | outline: 3px solid var(--a11y-focus); | ||
outline-offset: 2px; | outline-offset: 2px; | ||
} | } | ||
.a11y-hint{ | .a11y-hint{ | ||
font-size: | font-size: 13px; | ||
color: #D1D5DB; | color: #D1D5DB; | ||
line-height: 1.4; | line-height: 1.4; | ||
} | } | ||
/* | /* Screen reader only */ | ||
.a11y-sr{ | .a11y-sr{ | ||
position:absolute | position:absolute; | ||
width:1px | width:1px; | ||
height:1px | height:1px; | ||
overflow:hidden; | |||
clip:rect(0,0,0,0); | |||
overflow:hidden | |||
clip:rect(0,0,0,0) | |||
} | } | ||
/* ========================================================= | /* ========================================================= | ||
Feature classes | |||
========================================================= */ | ========================================================= */ | ||
/* High contrast | /* ------------------------------ | ||
High contrast (black/yellow) | |||
------------------------------ */ | |||
body.a11y-contrast{ | body.a11y-contrast{ | ||
background:#000 !important; | background:#000 !important; | ||
color:#FFD400 !important; | color:#FFD400 !important; | ||
--a11y-bg: #000; | |||
--a11y-bg: # | --a11y-border: rgba(255,212,0,.7); | ||
--a11y-border: rgba(255, 212, 0, | |||
--a11y-fg: #FFD400; | --a11y-fg: #FFD400; | ||
--a11y-focus: #FFD400; | --a11y-focus: #FFD400; | ||
| Line 179: | Line 155: | ||
} | } | ||
body.a11y-contrast a, | body.a11y-contrast a, | ||
body.a11y-contrast a:visited{ | body.a11y-contrast a:visited{ | ||
| Line 185: | Line 160: | ||
} | } | ||
/* | /* Headings */ | ||
body.a11y-contrast .a11y- | body.a11y-contrast h1, | ||
body.a11y-contrast .a11y- | 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 (Timeless needs explicit coverage) */ | |||
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; | background:#000 !important; | ||
color:#FFD400 !important; | |||
color: #FFD400 !important; | |||
} | } | ||
/* | /* Sidebars / tools */ | ||
body.a11y-contrast .a11y- | 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; | color:#FFD400 !important; | ||
border-color: rgba(255,212,0,.7) !important; | |||
} | } | ||
body.a11y-contrast .a11y- | |||
/* Ensure links inside toolboxes */ | |||
body.a11y-contrast #site-navigation a, | |||
body.a11y-contrast #site-tools a, | |||
body.a11y-contrast #page-tools a{ | |||
color:#FFD400 !important; | color:#FFD400 !important; | ||
} | } | ||
body.a11y-contrast .a11y- | |||
body.a11y-contrast .a11y-btn | /* A11y UI in contrast */ | ||
background:# | body.a11y-contrast .a11y-panel, | ||
body.a11y-contrast .a11y-toggle{ | |||
background:#000 !important; | |||
} | |||
body.a11y-contrast .a11y-btn{ | |||
background:#000 !important; | |||
color:#FFD400 !important; | color:#FFD400 !important; | ||
border | border:2px solid rgba(255,212,0,.85) !important; | ||
} | } | ||
/* Underline links */ | /* ------------------------------ | ||
Underline links | |||
------------------------------ */ | |||
body.a11y-underline-links a{ | body.a11y-underline-links a{ | ||
text-decoration-line: underline !important; | text-decoration-line: underline !important; | ||
| Line 216: | Line 219: | ||
} | } | ||
body.a11y-underline-links:not(.a11y-contrast) a{ | body.a11y-underline-links:not(.a11y-contrast) a{ | ||
text-decoration-color: var(--a11y-link-underline) | text-decoration-color: var(--a11y-link-underline); | ||
} | } | ||
/* Text spacing | /* ------------------------------ | ||
Text spacing | |||
------------------------------ */ | |||
body.a11y-spacing-plus{ | body.a11y-spacing-plus{ | ||
line-height: 1.8 !important; | line-height: 1.8 !important; | ||
| Line 231: | Line 236: | ||
} | } | ||
/* Large | /* ------------------------------ | ||
Large cursors (wiki-hosted) | |||
------------------------------ */ | |||
body.a11y-cursor-white, | body.a11y-cursor-white, | ||
body.a11y-cursor-white *{ | body.a11y-cursor-white *{ | ||
| Line 241: | Line 248: | ||
} | } | ||
/* Reading ruler | /* ------------------------------ | ||
Reading ruler | |||
------------------------------ */ | |||
#a11y-ruler{ | #a11y-ruler{ | ||
position: fixed; | position: fixed; | ||
| Line 253: | Line 262: | ||
background: linear-gradient( | background: linear-gradient( | ||
to bottom, | to bottom, | ||
# | #FFD400 0%, | ||
# | #FFD400 40%, | ||
#000000 40%, | #000000 40%, | ||
#000000 60%, | #000000 60%, | ||
# | #FFD400 60%, | ||
# | #FFD400 100% | ||
); | ); | ||
} | } | ||
#a11y-ruler[hidden]{ display:none !important; } | #a11y-ruler[hidden]{ display:none !important; } | ||
Revision as of 19:51, 25 January 2026
/* =========================================================
BHC Accessibility Gadget – MediaWiki / Timeless
========================================================= */
/* ---------------------------------------------------------
Variables
--------------------------------------------------------- */
:root{
--a11y-bg: #111827;
--a11y-border: #374151;
--a11y-fg: #ffffff;
--a11y-focus: #FFBF47;
--a11y-link-underline: #1D4ED8;
--a11y-menu-width: 340px;
}
/* ---------------------------------------------------------
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-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; }
/* Header */
.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;
}
/* Buttons */
.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: #D1D5DB;
line-height: 1.4;
}
/* Screen reader only */
.a11y-sr{
position:absolute;
width:1px;
height:1px;
overflow:hidden;
clip:rect(0,0,0,0);
}
/* =========================================================
Feature classes
========================================================= */
/* ------------------------------
High contrast (black/yellow)
------------------------------ */
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: #FFD400;
}
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 (Timeless needs explicit coverage) */
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;
}
/* Sidebars / tools */
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;
}
/* Ensure links inside toolboxes */
body.a11y-contrast #site-navigation a,
body.a11y-contrast #site-tools a,
body.a11y-contrast #page-tools a{
color:#FFD400 !important;
}
/* A11y UI in contrast */
body.a11y-contrast .a11y-panel,
body.a11y-contrast .a11y-toggle{
background:#000 !important;
}
body.a11y-contrast .a11y-btn{
background:#000 !important;
color:#FFD400 !important;
border:2px solid rgba(255,212,0,.85) !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);
}
/* ------------------------------
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; }
