Hide empty OOUI FieldsetLayout headers
authorVolker E <volker.e@wikimedia.org>
Tue, 14 Nov 2017 23:00:46 +0000 (15:00 -0800)
committerVolker E <volker.e@wikimedia.org>
Tue, 14 Nov 2017 23:14:30 +0000 (15:14 -0800)
In cases where the label or the icon are unset the header shouldn't take
up space, nor should it be visible to screenreaders.
That's a workaround, it should not be in the markup. T180535 is the place
to address the unnecessary markup further.

Bug: T177668
Bug: T180535
Change-Id: I39088107e6ab07399f9826dd925df9e1b8dda006

resources/src/mediawiki/htmlform/ooui.styles.less

index 1607489..e78a4ca 100644 (file)
@@ -1,4 +1,4 @@
-/* OOUIHTMLForm styles */
+// OOUIHTMLForm styles
 .mw-htmlform-ooui-wrapper.oo-ui-panelLayout-padded {
        padding: 1em 1.25em 1.25em;
 }
        }
 }
 
-/* Flatlist styling for PHP widgets... */
+// HACK: Hide empty fieldsetLayoutHeaders, until T180535 isn't resolved
+.oo-ui-fieldsetLayout:not( .oo-ui-labelElement ):not( .oo-ui-iconElement ) > .oo-ui-fieldsetLayout-header {
+       display: none;
+}
+
+// Flatlist styling for PHP widgets...
 .mw-htmlform-flatlist .oo-ui-fieldLayout-align-inline,
-/* ...and for JS widgets */
+// ...and for JS widgets
 .mw-htmlform-flatlist .oo-ui-radioOptionWidget,
 .mw-htmlform-flatlist .oo-ui-checkboxMultioptionWidget {
        display: inline-block;