From 9652d4f8ed1ceb943e57b6f0577c1d697619bf7f Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Thu, 24 Nov 2022 21:46:23 -0500 Subject: [PATCH] =?UTF-8?q?refactor(core):=20=E2=99=BB=EF=B8=8F=20prepare?= =?UTF-8?q?=20for=20heading=20structure=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skins.citizen.scripts.sections.js | 3 ++- resources/skins.citizen.scripts/tableOfContents.js | 3 ++- .../skins.citizen.styles.sections.less | 10 ++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/resources/skins.citizen.scripts.sections/skins.citizen.scripts.sections.js b/resources/skins.citizen.scripts.sections/skins.citizen.scripts.sections.js index 5e4390cf..d3189682 100644 --- a/resources/skins.citizen.scripts.sections/skins.citizen.scripts.sections.js +++ b/resources/skins.citizen.scripts.sections/skins.citizen.scripts.sections.js @@ -10,7 +10,8 @@ function initCollapsibleSections( document ) { for ( let i = 0; i < headings.length; i++ ) { const j = i + 1, collapsibleID = prefix + 'collapsible-' + j, - headline = headings[ i ].querySelector( '.mw-headline' ); + /* T13555 */ + headline = headings[ i ].querySelector( '.mw-headline' ) ?? headings[ i ].querySelector( '.mw-heading' ); // Set up ARIA headline.setAttribute( 'tabindex', 0 ); diff --git a/resources/skins.citizen.scripts/tableOfContents.js b/resources/skins.citizen.scripts/tableOfContents.js index 9ceab4ea..dbb42f5e 100644 --- a/resources/skins.citizen.scripts/tableOfContents.js +++ b/resources/skins.citizen.scripts/tableOfContents.js @@ -56,7 +56,8 @@ function initToC() { const initSectionObserver = require( './sectionObserver.js' ).init; const sectionObserver = initSectionObserver( { - elements: bodyContent.querySelectorAll( '.mw-headline' ), + /* T13555 */ + elements: bodyContent.querySelectorAll( '.mw-headline' ) ?? bodyContent.querySelectorAll( '.mw-heading' ), topMargin: getTopMargin(), onIntersection: ( section ) => { changeActiveSection( section.id ); } } ); diff --git a/resources/skins.citizen.styles.sections/skins.citizen.styles.sections.less b/resources/skins.citizen.styles.sections/skins.citizen.styles.sections.less index fe153bc7..0792176e 100644 --- a/resources/skins.citizen.styles.sections/skins.citizen.styles.sections.less +++ b/resources/skins.citizen.styles.sections/skins.citizen.styles.sections.less @@ -12,12 +12,18 @@ transform: rotate3d( 1, 0, 0, 180deg ); } - .mw-headline { + .mw-headline, + /* T13555 */ + .mw-heading h1, + .mw-heading h2 { opacity: var( --opacity-icon-base ); } } - .mw-headline { + .mw-headline, + /* T13555 */ + .mw-heading h1, + .mw-heading h2 { transition: @transition-opacity; &:hover {