From b0281fa450bac355abb026d7b8711e4a309bdcb0 Mon Sep 17 00:00:00 2001 From: AronDemian Date: Fri, 8 May 2020 16:30:26 +0200 Subject: [PATCH] Add CSS class on body to mark the skin version Adds class 'skin-vector-legacy' for legacy layout. Bug: T251648 Change-Id: I52938689fc7d99a710510349aaa573a87864a367 --- includes/SkinVector.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/includes/SkinVector.php b/includes/SkinVector.php index a64f2b7..1bb556a 100644 --- a/includes/SkinVector.php +++ b/includes/SkinVector.php @@ -62,6 +62,18 @@ class SkinVector extends SkinTemplate { } } + /** + * Called by OutputPage::headElement when it is creating the + * `` tag. Overrides method in Skin class. + * @param OutputPage $out + * @param array &$bodyAttrs + */ + public function addToBodyAttributes( $out, &$bodyAttrs ) { + if ( $this->isLegacy() ) { + $bodyAttrs['class'] .= ' skin-vector-legacy'; + } + } + /** * @inheritDoc * @return array