MediaWiki:Gadget-bhc-accessibility.css: Difference between revisions

No edit summary
No edit summary
Tag: Reverted
Line 1: Line 1:
/* =========================================================
/* =========================================================
   BHC Accessibility Gadget – MediaWiki / Timeless
   BHC Accessibility Gadget – FINAL
   ========================================================= */
   ========================================================= */


/* ---------------------------------------------------------
  Variables
  --------------------------------------------------------- */
:root{
:root{
   --a11y-bg: #111827;
   --a11y-yellow: #FFD400;
   --a11y-border: #374151;
   --a11y-blue: #36C;
  --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{
  High Contrast Mode
  font-size: 16px !important;
  --------------------------------------------------------- */
  line-height: 1 !important;
}


body.skin-timeless .a11y-toggle svg{
body.a11y-contrast{
   display: block !important;
   background: #000 !important;
   width: 36px !important;
   color: var(--a11y-yellow) !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: none !important;
  max-height: none !important;
 
  /* If the glyph still looks small, keep this: */
  transform: scale(1.15) !important;
  transform-origin: 50% 50% !important;
}
}


/* Make sure fill isn’t being altered by skin rules */
/* Global text */
body.skin-timeless .a11y-toggle svg path{
body.a11y-contrast *{
   fill: currentColor !important;
   color: var(--a11y-yellow) !important;
}
}


/* ---------------------------------------------------------
/* Links */
  Floating accessibility toggle
body.a11y-contrast a,
  --------------------------------------------------------- */
body.a11y-contrast a:visited{
.a11y-toggle{
   color: var(--a11y-yellow) !important;
  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
   Header (contrast)
   --------------------------------------------------------- */
   --------------------------------------------------------- */
.a11y-panel{
  position: fixed;
  right: 14px;
  bottom: 76px;
  z-index: 10000;


  width: var(--a11y-menu-width);
body.a11y-contrast #mw-header-container,
  max-width: calc(100vw - 28px);
body.a11y-contrast #mw-header{
 
   background: #000 !important;
  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 */
body.a11y-contrast #p-banner,
.a11y-head{
body.a11y-contrast .bhc-strapline{
  display:flex;
   color: var(--a11y-yellow) !important;
  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 */
/* Search */
.a11y-row{
body.a11y-contrast #searchInput,
  display:flex;
body.a11y-contrast input[type="search"]{
  gap: 8px;
   background: #000 !important;
  flex-wrap: wrap;
   color: var(--a11y-yellow) !important;
  margin-bottom: 10px;
   border: 2px solid var(--a11y-yellow) !important;
}
.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;
  User tools dropdown
  color: #D1D5DB;
  --------------------------------------------------------- */
  line-height: 1.4;
}


/* Screen reader only */
body.a11y-contrast #personal,
.a11y-sr{
body.a11y-contrast #personal *{
   position:absolute;
   background: #000 !important;
  width:1px;
   color: var(--a11y-yellow) !important;
  height:1px;
   overflow:hidden;
  clip:rect(0,0,0,0);
}
}


/* =========================================================
/* ---------------------------------------------------------
   Feature classes
   TOC, tables, categories
   ========================================================= */
   --------------------------------------------------------- */


/* ------------------------------
body.a11y-contrast .toc,
  High contrast (black/yellow/blue)
body.a11y-contrast .wikitable,
  ------------------------------ */
body.a11y-contrast .mw-normal-catlinks,
body.a11y-contrast{
body.a11y-contrast figure,
   background:#000 !important;
body.a11y-contrast pre{
   color:#FFD400 !important;
   background: #000 !important;
 
   border-color: var(--a11y-yellow) !important;
  --a11y-bg: #000;
  --a11y-border: rgba(255,212,0,.7);
  --a11y-fg: #FFD400;
  --a11y-focus: #FFD400;
  --a11y-link-underline: #36C;
}
}


body.a11y-contrast a,
/* ---------------------------------------------------------
body.a11y-contrast a:visited{
  Underlined links (wiki style)
  color:#FFD400 !important;
  --------------------------------------------------------- */
}


/* Headings */
body.a11y-underline-links a{
body.a11y-contrast h1,
   text-decoration: none !important;
body.a11y-contrast h2,
   border-bottom: 2px solid var(--a11y-blue);
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,
  Text size (Timeless-safe)
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-text-plus{
body.a11y-contrast #site-navigation,
   font-size: 120% !important;
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-text-minus{
body.a11y-contrast #site-navigation a,
   font-size: 90% !important;
body.a11y-contrast #site-tools a,
body.a11y-contrast #page-tools a{
   color:#FFD400 !important;
}
}


/* A11y UI in contrast */
/* ---------------------------------------------------------
body.a11y-contrast .a11y-panel,
   Text spacing
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
   ------------------------------ */
/* Underline links – MediaWiki-style */
body.a11y-underline-links a{
  text-decoration: none !important;
  border-bottom: 2px solid var(--a11y-link-underline);
  padding-bottom: 0.05em;
}
 
/* Contrast mode keeps yellow */
body.a11y-underline-links.a11y-contrast a{
  border-bottom-color: #36C !important;
}


/* ------------------------------
  Text spacing
  ------------------------------ */
body.a11y-spacing-plus{
body.a11y-spacing-plus{
   line-height: 1.8 !important;
   line-height: 1.8 !important;
   letter-spacing: 0.06em !important;
   letter-spacing: .06em !important;
   word-spacing: 0.16em !important;
   word-spacing: .16em !important;
}
}
body.a11y-spacing-minus{
body.a11y-spacing-minus{
   line-height: 1.45 !important;
   line-height: 1.45 !important;
  letter-spacing: 0.01em !important;
  word-spacing: 0.02em !important;
}
}


/* ------------------------------
/* ---------------------------------------------------------
   Large cursors (wiki-hosted)
   Cursors
   ------------------------------ */
   --------------------------------------------------------- */
 
body.a11y-cursor-white,
body.a11y-cursor-white,
body.a11y-cursor-white *{
body.a11y-cursor-white *{
   cursor: url("/index.php/Special:FilePath/large-arrow-white-64.png") 8 8, auto !important;
   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-yellow *{
body.a11y-cursor-yellow *{
Line 276: Line 122:
}
}


/* ------------------------------
/* ---------------------------------------------------------
   Reading ruler
   Reading ruler
   ------------------------------ */
   --------------------------------------------------------- */
 
#a11y-ruler{
#a11y-ruler{
   position: fixed;
   position: fixed;
  top: 0;
   left: 0;
   left: 0;
   top: 0;
   width: 100vw;
   height: 22px;
   height: 22px;
  width: 100vw;
  z-index: 9999;
   pointer-events: none;
   pointer-events: none;
   background: linear-gradient(
   background: linear-gradient(
     to bottom,
     to bottom,
     #FFD400 0%,
     var(--a11y-yellow) 0 40%,
    #FFD400 40%,
     #000 40% 60%,
     #000000 40%,
     var(--a11y-yellow) 60% 100%
    #000000 60%,
     #FFD400 60%,
    #FFD400 100%
   );
   );
  z-index: 9999;
}
}
#a11y-ruler[hidden]{ display:none !important; }
#a11y-ruler[hidden]{ display:none !important; }
/* =========================================================
  MediaWiki: extra HIGH CONTRAST coverage (Timeless + Vector)
  Add at END of Gadget CSS so it wins.
  ========================================================= */
/* TOC (Timeless/Vector both use variants) */
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;
}
/* Wikitables (and common table elements that retain dark text) */
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;
}
/* Table headers sometimes have their own background */
body.a11y-contrast .wikitable th,
body.a11y-contrast table th{
  background: #000 !important;
  color: #FFD400 !important;
}
/* Figures/captions (centre aligned or otherwise) */
body.a11y-contrast figure,
body.a11y-contrast figure *,
body.a11y-contrast .mw-halign-center,
body.a11y-contrast .mw-halign-centre,
body.a11y-contrast .mw-halign-center *,
body.a11y-contrast .mw-halign-centre *{
  background: #000 !important;
  color: #FFD400 !important;
}
/* Thumb frames / image captions often keep grey/black text */
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 sometimes use dark text */
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;
}
/* Safety: ensure visited links don’t revert to purple/blue */
body.a11y-contrast a:visited,
body.a11y-contrast .mw-parser-output a:visited{
  color: #FFD400 !important;
}
/* =========================================================
  HIGH CONTRAST: Footer (Vector + Timeless)
  ========================================================= */
/* Footer container */
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;
}
/* Footer inner lists / columns */
body.a11y-contrast #footer-list,
body.a11y-contrast #footer-list *,
body.a11y-contrast #footer-icons,
body.a11y-contrast #footer-icons *{
  background: #000 !important;
  color: #FFD400 !important;
}
/* Footer links */
body.a11y-contrast #mw-footer a,
body.a11y-contrast #mw-footer a:visited{
  color: #FFD400 !important;
  text-decoration-color: #FFD400 !important;
}
/* Footer portlets / lists (Vector sometimes uses these) */
body.a11y-contrast #mw-footer .mw-portlet,
body.a11y-contrast #mw-footer .mw-portlet-body{
  background: #000 !important;
  color: #FFD400 !important;
  border-color: rgba(255, 212, 0, 0.75) !important;
}
/* Remove any lingering grey rules/dividers */
body.a11y-contrast #mw-footer hr{
  border-color: #FFD400 !important;
}
/* =========================================================
  Underline links: ensure TOC wins over table border-color rules
  ========================================================= */
body.a11y-underline-links #toc a,
body.a11y-underline-links .toc a{
  border-bottom-color: var(--a11y-link-underline) !important;
}
/* In contrast mode you currently want blue (#36c) */
body.a11y-underline-links.a11y-contrast #toc a,
body.a11y-underline-links.a11y-contrast .toc a{
  border-bottom-color: #36C !important;
}
/* =========================================================
  HIGH CONTRAST: Header coverage (Timeless + Vector)
  Ignoring logo image itself; covers title/strapline, search, user tools.
  Paste at END of Gadget CSS.
  ========================================================= */
/* --- Timeless header containers --- */
body.a11y-contrast #mw-header-container,
body.a11y-contrast #mw-header,
body.a11y-contrast #mw-header-container .ts-inner,
body.a11y-contrast #mw-header-container .mw-body,
body.a11y-contrast #mw-header-container .mw-portlet,
body.a11y-contrast #mw-header-container .mw-portlet-body{
  background: #000 !important;
  color: #FFD400 !important;
  background-image: none !important;
  border-color: #FFD400 !important;
}
/* Title + strapline text (but not the logo image) */
body.a11y-contrast #p-logo-text,
body.a11y-contrast #p-logo-text *{
  color: #FFD400 !important;
}
body.a11y-contrast #p-logo-text #p-banner{
  color: #FFD400 !important;              /* title text */
  background-image: inherit !important;  /* keep your logo graphic */
}
body.a11y-contrast #bhc-strapline,
body.a11y-contrast .bhc-strapline{
  color: #FFD400 !important;
}
/* --- Search box in header (Timeless + Vector) --- */
body.a11y-contrast #p-search,
body.a11y-contrast #simpleSearch{
  background: #000 !important;
  color: #FFD400 !important;
}
body.a11y-contrast #searchInput,
body.a11y-contrast input[type="search"]#searchInput{
  background: #000 !important;
  color: #FFD400 !important;
  border: 2px solid rgba(255,212,0,.85) !important;
  box-shadow: none !important;
}
body.a11y-contrast #searchInput::placeholder{
  color: rgba(255,212,0,.75) !important;
}
/* Search submit button/icon */
body.a11y-contrast input#mw-searchButton,
body.a11y-contrast input#searchButton,
body.a11y-contrast #mw-searchButton{
  background-color: #000 !important;
  border: 2px solid rgba(255,212,0,.85) !important;
  filter: none !important;
}
/* --- User tools ("Steve") area --- */
body.a11y-contrast #user-tools,
body.a11y-contrast #user-tools *,
body.a11y-contrast #personal,
body.a11y-contrast #personal *{
  background: #000 !important;
  color: #FFD400 !important;
  border-color: rgba(255,212,0,.85) !important;
}
/* Dropdown panel surface */
body.a11y-contrast #personal .dropdown,
body.a11y-contrast #personal-inner.dropdown,
body.a11y-contrast #personal .mw-portlet-body{
  background: #000 !important;
  color: #FFD400 !important;
  border: 2px solid rgba(255,212,0,.85) !important;
}
/* --- Vector header (extra safety) --- */
body.a11y-contrast #mw-head,
body.a11y-contrast #mw-head * ,
body.a11y-contrast #mw-head-base,
body.a11y-contrast #mw-head-base * ,
body.a11y-contrast #mw-head .vector-menu,
body.a11y-contrast #mw-head .vector-menu *{
  background: #000 !important;
  color: #FFD400 !important;
  border-color: rgba(255,212,0,.85) !important;
}
/* Keep any header links yellow (incl visited) */
body.a11y-contrast #mw-header a,
body.a11y-contrast #mw-header a:visited,
body.a11y-contrast #mw-head a,
body.a11y-contrast #mw-head a:visited{
  color: #FFD400 !important;
}
/* === HIGH CONTRAST FIX: Search input (Timeless + Vector) === */
body.a11y-contrast #p-search,
body.a11y-contrast #simpleSearch{
  background: #000 !important;
}
body.a11y-contrast #searchInput,
body.a11y-contrast input[type="search"],
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;
}
body.a11y-contrast #searchInput::placeholder{
  color: rgba(255,212,0,0.75) !important;
}
/* === HIGH CONTRAST FIX: User tools dropdown text === */
body.a11y-contrast #personal .mw-portlet-body,
body.a11y-contrast #personal .mw-portlet-body *,
body.a11y-contrast #personal-inner.dropdown,
body.a11y-contrast #personal-inner.dropdown *{
  background: #000 !important;
  color: #FFD400 !important;
  border-color: rgba(255,212,0,0.85) !important;
}

Revision as of 19:38, 26 January 2026

/* =========================================================
   BHC Accessibility Gadget – FINAL
   ========================================================= */

:root{
  --a11y-yellow: #FFD400;
  --a11y-blue: #36C;
}

/* ---------------------------------------------------------
   High Contrast Mode
   --------------------------------------------------------- */

body.a11y-contrast{
  background: #000 !important;
  color: var(--a11y-yellow) !important;
}

/* Global text */
body.a11y-contrast *{
  color: var(--a11y-yellow) !important;
}

/* Links */
body.a11y-contrast a,
body.a11y-contrast a:visited{
  color: var(--a11y-yellow) !important;
}

/* ---------------------------------------------------------
   Header (contrast)
   --------------------------------------------------------- */

body.a11y-contrast #mw-header-container,
body.a11y-contrast #mw-header{
  background: #000 !important;
}

body.a11y-contrast #p-banner,
body.a11y-contrast .bhc-strapline{
  color: var(--a11y-yellow) !important;
}

/* Search */
body.a11y-contrast #searchInput,
body.a11y-contrast input[type="search"]{
  background: #000 !important;
  color: var(--a11y-yellow) !important;
  border: 2px solid var(--a11y-yellow) !important;
}

/* ---------------------------------------------------------
   User tools dropdown
   --------------------------------------------------------- */

body.a11y-contrast #personal,
body.a11y-contrast #personal *{
  background: #000 !important;
  color: var(--a11y-yellow) !important;
}

/* ---------------------------------------------------------
   TOC, tables, categories
   --------------------------------------------------------- */

body.a11y-contrast .toc,
body.a11y-contrast .wikitable,
body.a11y-contrast .mw-normal-catlinks,
body.a11y-contrast figure,
body.a11y-contrast pre{
  background: #000 !important;
  border-color: var(--a11y-yellow) !important;
}

/* ---------------------------------------------------------
   Underlined links (wiki style)
   --------------------------------------------------------- */

body.a11y-underline-links a{
  text-decoration: none !important;
  border-bottom: 2px solid var(--a11y-blue);
}

/* ---------------------------------------------------------
   Text size (Timeless-safe)
   --------------------------------------------------------- */

body.a11y-text-plus{
  font-size: 120% !important;
}

body.a11y-text-minus{
  font-size: 90% !important;
}

/* ---------------------------------------------------------
   Text spacing
   --------------------------------------------------------- */

body.a11y-spacing-plus{
  line-height: 1.8 !important;
  letter-spacing: .06em !important;
  word-spacing: .16em !important;
}

body.a11y-spacing-minus{
  line-height: 1.45 !important;
}

/* ---------------------------------------------------------
   Cursors
   --------------------------------------------------------- */

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;
  top: 0;
  left: 0;
  width: 100vw;
  height: 22px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    var(--a11y-yellow) 0 40%,
    #000 40% 60%,
    var(--a11y-yellow) 60% 100%
  );
  z-index: 9999;
}

#a11y-ruler[hidden]{ display:none !important; }