Remove need for html-class template property

Follow up to 9dcfc1f

This simplifies the template by removing the need for the html-class.
The font-size can be provided to the entire content area meaning we don't
need the link-only class

Change-Id: Id5c49358f6ec007b3205ee390cf68334a1e56de5
This commit is contained in:
jdlrobson 2021-12-10 08:38:51 -08:00
parent 9dcfc1ff27
commit ca501bb581
3 changed files with 14 additions and 13 deletions

View File

@ -445,11 +445,7 @@ class SkinVector extends SkinMustache {
$htmlContent = $htmlData['html-content'];
}
$htmlClasses = array_key_exists( 'html-class', $htmlData )
? [ 'html-class' => $htmlData['html-class'] ]
: [];
return $headingOptions + $htmlClasses + [
return $headingOptions + [
'html-content' => $htmlContent,
];
}
@ -538,7 +534,6 @@ class SkinVector extends SkinMustache {
];
$htmlData = [
'link' => $optOutUrl,
'html-class' => [ 'link-only' ],
];
$commonSkinData['data-emphasized-sidebar-action'][] = $this->makeSidebarActionData(
$htmlData,
@ -556,8 +551,10 @@ class SkinVector extends SkinMustache {
// T295555 Add language switch alert message temporarily (to be removed).
if ( $this->shouldLanguageAlertBeInSidebar() && !$parentData['is-mainpage'] ) {
$languageSwitchAlert = [
'html-content' => $this->msg( 'vector-language-redirect-to-top' )->parse(),
'html-class' => [ 'messagebox' ],
'html-content' => Html::rawElement( 'div',
[ 'class' => 'messagebox' ],
$this->msg( 'vector-language-redirect-to-top' )->parse()
),
];
$headingOptions = [
'heading' => $this->msg( 'vector-languages' )->plain(),

View File

@ -2,7 +2,7 @@
<div class="mw-sidebar-action">
<div class="mw-sidebar-action-item">
{{#heading}}<h3 class="mw-sidebar-action-heading">{{.}}</h3>{{/heading}}
<div class="mw-sidebar-action-content{{#html-class}} {{.}}{{/html-class}}">
<div class="mw-sidebar-action-content">
{{{html-content}}}
</div>
</div>

View File

@ -27,15 +27,19 @@
cursor: default;
}
.link-only a {
font-size: @font-size-portal-list-item;
font-weight: bold;
.mw-sidebar-action-content {
> * {
font-size: @font-size-portal-list-item;
}
> a {
font-weight: bold;
}
}
// T295555 style overrides for temporary language switch alert (can be removed later ).
.messagebox {
padding: 0.75em;
font-size: @font-size-portal-list-item;
}
}
}