diff --git a/includes/TemplateDataHtmlFormatter.php b/includes/TemplateDataHtmlFormatter.php index 2a2fead6..54cade8d 100644 --- a/includes/TemplateDataHtmlFormatter.php +++ b/includes/TemplateDataHtmlFormatter.php @@ -138,9 +138,7 @@ class TemplateDataHtmlFormatter { $suggestedValues = []; foreach ( $param->suggestedvalues as $suggestedValue ) { - $suggestedValues[] = Html::element( 'code', [ 'class' => 'mw-templatedata-doc-param-alias' ], - $suggestedValue - ); + $suggestedValues[] = Html::element( 'code', [], $suggestedValue ); } if ( $param->deprecated ) { @@ -161,12 +159,11 @@ class TemplateDataHtmlFormatter { implode( $this->localizer->msg( 'word-separator' )->escaped(), $allParamNames ) ) // Description - . Html::rawElement( 'td', [ - 'class' => [ - 'mw-templatedata-doc-muted' => ( $param->description === null ) - ] - ], - Html::element( 'p', [], + . Html::rawElement( 'td', [], + Html::element( 'p', + [ + 'class' => $param->description ? null : 'mw-templatedata-doc-muted', + ], $param->description ?? $this->localizer->msg( 'templatedata-doc-param-desc-empty' )->text() ) diff --git a/modules/ext.templateData/templateData.css b/modules/ext.templateData/templateData.css index 4b9ea676..c4023d9d 100644 --- a/modules/ext.templateData/templateData.css +++ b/modules/ext.templateData/templateData.css @@ -1,33 +1,26 @@ -.mw-templateData-doc-params tbody > tr > th { +.mw-templatedata-doc-params tbody > tr > th { text-align: left; font-weight: normal; } -.mw-templateData-doc-param-alias { - color: #777; - display: block; - margin-left: 1em; +.mw-templatedata-doc-param-alias { + color: #555; /* required to pass WCAG AAA */ } -.mw-templateData-doc-muted { +.mw-templatedata-doc-muted { font-style: italic; - color: #777; + color: #555; /* required to pass WCAG AAA */ } .mw-templatedata-doc-param-status-required { font-weight: bold; } -.mw-templateData-format { +.mw-templatedata-format { font-weight: normal; font-size: 0.85em; } -.mw-templateData-doc-param-name, -.mw-templateData-doc-param-type { - white-space: nowrap; -} - .mw-templateData-maps-panel-button { margin-bottom: 0.5em; } diff --git a/tests/phpunit/TemplateDataBlobTest.php b/tests/phpunit/TemplateDataBlobTest.php index 2121ea3e..d5c94e8f 100644 --- a/tests/phpunit/TemplateDataBlobTest.php +++ b/tests/phpunit/TemplateDataBlobTest.php @@ -1464,14 +1464,14 @@ HTML
foo
(templatedata-doc-param-desc-empty)
(templatedata-doc-param-desc-empty)
bar
(templatedata-doc-param-desc-empty)
(templatedata-doc-param-desc-empty)
suggestedParam
(word-separator)Alias1
(word-separator)Alias2
Param docs
Suggested1
(word-separator)Suggested2
Suggested1
(word-separator)Suggested2
Auto value
deprecatedParam
(templatedata-doc-param-desc-empty)
(templatedata-doc-param-desc-empty)