mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-23 23:43:54 +00:00
Merge "Fix CSS styling of the HTML rendering broken since 2016"
This commit is contained in:
commit
bc064ce8a2
|
@ -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()
|
||||
)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1464,14 +1464,14 @@ HTML
|
|||
<tr>
|
||||
<th>foo</th>
|
||||
<td class="mw-templatedata-doc-param-name"><code>foo</code></td>
|
||||
<td class="mw-templatedata-doc-muted"><p>(templatedata-doc-param-desc-empty)</p><dl></dl></td>
|
||||
<td><p class="mw-templatedata-doc-muted">(templatedata-doc-param-desc-empty)</p><dl></dl></td>
|
||||
<td class="mw-templatedata-doc-param-type mw-templatedata-doc-muted">(templatedata-doc-param-type-unknown)</td>
|
||||
<td class="mw-templatedata-doc-param-status-optional" data-sort-value="0">(templatedata-doc-param-status-optional)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>bar</th>
|
||||
<td class="mw-templatedata-doc-param-name"><code>bar</code></td>
|
||||
<td class="mw-templatedata-doc-muted"><p>(templatedata-doc-param-desc-empty)</p><dl></dl></td>
|
||||
<td><p class="mw-templatedata-doc-muted">(templatedata-doc-param-desc-empty)</p><dl></dl></td>
|
||||
<td class="mw-templatedata-doc-param-type mw-templatedata-doc-muted">(templatedata-doc-param-type-unknown)</td>
|
||||
<td class="mw-templatedata-doc-param-status-required" data-sort-value="2">(templatedata-doc-param-status-required)</td>
|
||||
</tr>
|
||||
|
@ -1504,10 +1504,10 @@ HTML
|
|||
<tr>
|
||||
<th>Label</th>
|
||||
<td class="mw-templatedata-doc-param-name"><code>suggestedParam</code>(word-separator)<code class="mw-templatedata-doc-param-alias">Alias1</code>(word-separator)<code class="mw-templatedata-doc-param-alias">Alias2</code></td>
|
||||
<td class="">
|
||||
<td>
|
||||
<p>Param docs</p>
|
||||
<dl>
|
||||
<dt>(templatedata-doc-param-suggestedvalues)</dt><dd><code class="mw-templatedata-doc-param-alias">Suggested1</code>(word-separator)<code class="mw-templatedata-doc-param-alias">Suggested2</code></dd>
|
||||
<dt>(templatedata-doc-param-suggestedvalues)</dt><dd><code>Suggested1</code>(word-separator)<code>Suggested2</code></dd>
|
||||
<dt>(templatedata-doc-param-default)</dt><dd>Default docs</dd>
|
||||
<dt>(templatedata-doc-param-example)</dt><dd>Example docs</dd>
|
||||
<dt>(templatedata-doc-param-autovalue)</dt><dd><code>Auto value</code></dd>
|
||||
|
@ -1519,7 +1519,7 @@ HTML
|
|||
<tr>
|
||||
<th>deprecatedParam</th>
|
||||
<td class="mw-templatedata-doc-param-name"><code>deprecatedParam</code></td>
|
||||
<td class="mw-templatedata-doc-muted"><p>(templatedata-doc-param-desc-empty)</p><dl></dl></td>
|
||||
<td><p class="mw-templatedata-doc-muted">(templatedata-doc-param-desc-empty)</p><dl></dl></td>
|
||||
<td class="mw-templatedata-doc-param-type">(templatedata-doc-param-type-date)</td>
|
||||
<td class="mw-templatedata-doc-param-status-deprecated" data-sort-value="-1">(templatedata-doc-param-status-deprecated)</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in a new issue