Fix a11y icon, FAB label colors, add high-contrast stylesheet, sync theme vars
- Fix faIcon() to use <i> elements (FA7 compatibility) - Fix #mokoThemeFab .label and button colors to white (visible on both light and dark themes) - Fix font-weight typo (600px → 600) - Add --footer-padding-* variables to all 6 theme files - Create a11y-high-contrast.css with WCAG AAA contrast ratios for both light and dark modes - Register high-contrast stylesheet in joomla.asset.json - Lazy-load high-contrast CSS when a11y contrast toggle is activated Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -229,6 +229,18 @@
|
||||
|
||||
function applyContrast(on) {
|
||||
root.classList.toggle("a11y-high-contrast", on);
|
||||
// Lazy-load the high-contrast stylesheet
|
||||
var hcId = "mokoA11yHcSheet";
|
||||
var existing = doc.getElementById(hcId);
|
||||
if (on && !existing) {
|
||||
var link = doc.createElement("link");
|
||||
link.id = hcId;
|
||||
link.rel = "stylesheet";
|
||||
link.href = (doc.querySelector('link[href*="mokocassiopeia/css/template"]') || {}).href
|
||||
? (doc.querySelector('link[href*="mokocassiopeia/css/template"]').href.replace(/\/css\/template[^/]*$/, "/css/a11y-high-contrast.css"))
|
||||
: "media/templates/site/mokocassiopeia/css/a11y-high-contrast.css";
|
||||
doc.head.appendChild(link);
|
||||
}
|
||||
}
|
||||
|
||||
function applyLinks(on) {
|
||||
@@ -245,10 +257,10 @@
|
||||
|
||||
/** Create a Font Awesome icon element (safe DOM, no innerHTML). */
|
||||
function faIcon(classes) {
|
||||
var span = doc.createElement("span");
|
||||
span.className = classes;
|
||||
span.setAttribute("aria-hidden", "true");
|
||||
return span;
|
||||
var i = doc.createElement("i");
|
||||
i.className = classes;
|
||||
i.setAttribute("aria-hidden", "true");
|
||||
return i;
|
||||
}
|
||||
|
||||
function buildA11yToolbar() {
|
||||
|
||||
Reference in New Issue
Block a user