Lessy-fying OutlinePartWidget and OutlineButtonWidget rules

Using a certain amount of depth to make sure to override OOUI
specificity.

More can be done in follow ups.

Change-Id: I1edc5db98d16a4c0de8abd7f705776fb9eb65b97
This commit is contained in:
WMDE-Fisch 2022-07-07 22:37:44 +02:00
parent 83c30099ec
commit ab7bc03b18
2 changed files with 83 additions and 77 deletions

View file

@ -17,11 +17,11 @@
font-style: italic;
}
.ve-ui-mwTransclusionDialog-single-transclusion .ve-ui-mwTransclusionOutlineButtonWidget {
.ve-ui-mwTransclusionDialog-single-transclusion .ve-ui-mwTransclusionOutlineWidget .ve-ui-mwTransclusionOutlinePartWidget .ve-ui-mwTransclusionOutlineButtonWidget {
display: none;
}
.ve-ui-mwTransclusionDialog-single-transclusion .ve-ui-mwTransclusionOutlineTemplateWidget-sticky {
.ve-ui-mwTransclusionDialog-single-transclusion .ve-ui-mwTransclusionOutlineWidget .ve-ui-mwTransclusionOutlinePartWidget .ve-ui-mwTransclusionOutlineTemplateWidget-sticky {
margin-top: -8px;
margin-bottom: 8px;
padding-top: 8px;

View file

@ -1,3 +1,79 @@
.ve-ui-mwTransclusionOutlineWidget {
/* .oo-ui-window-head uses a 1px outline which overlaps the top pixel of the sidebar */
padding-top: 1px;
.ve-ui-mwTransclusionOutline-ariaHidden {
display: none;
}
.ve-ui-mwTransclusionOutlinePartWidget {
margin-top: 24px;
margin-bottom: 24px;
&:first-child .ve-ui-mwTransclusionOutlineButtonWidget {
margin-top: -24px;
}
/* no margin for labels and wikitext */
&:last-child {
margin-bottom: -24px;
/* margin for last text */
.ve-ui-mwTransclusionOutline-no-template-parameters {
margin-bottom: 48px;
}
}
.ve-ui-mwTransclusionOutlineButtonWidget {
display: block;
margin-top: -10px;
&:first-child {
margin-left: 0;
}
> .oo-ui-buttonElement-button {
display: block;
overflow: hidden;
padding: 8px 0 8px 36px;
text-overflow: ellipsis;
&:hover {
background-color: #eaecf0;
}
/* click */
&:active {
/* Same as .oo-ui-optionWidget-pressed, a.k.a. @background-color-primary--hover */
background-color: rgba( 41, 98, 204, 0.1 );
color: #36c;
}
> .oo-ui-iconElement-icon {
left: 10px;
}
}
/* selected */
&.oo-ui-optionWidget-selected > .oo-ui-buttonElement-button {
background-color: #eaf3ff;
&:hover {
background-color: #eaf3ff;
color: #36c;
}
}
}
}
}
/* click */
.ve-ui-mwTransclusionOutlineParameterWidget:active {
/* Same as .oo-ui-optionWidget-pressed, a.k.a. @background-color-primary--hover */
background-color: rgba( 41, 98, 204, 0.1 );
color: #36c;
}
.ve-ui-mwTransclusionOutlineTemplateWidget-sticky {
background-color: #fff;
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
@ -6,39 +82,6 @@
z-index: 1;
}
.ve-ui-mwTransclusionOutlinePartWidget {
margin-top: 24px;
margin-bottom: 24px;
}
.ve-ui-mwTransclusionOutlineButtonWidget {
margin-top: -10px;
}
.ve-ui-mwTransclusionOutlinePartWidget:first-child .ve-ui-mwTransclusionOutlineButtonWidget {
margin-top: -24px;
}
/* no margin for labels and wikitext */
.ve-ui-mwTransclusionOutlinePartWidget:last-child {
margin-bottom: -24px;
}
/* margin for last checkbox or text */
.ve-ui-mwTransclusionOutlinePartWidget:last-child .ve-ui-mwTransclusionOutlineParameterWidget:last-child,
.ve-ui-mwTransclusionOutlinePartWidget:last-child .ve-ui-mwTransclusionOutline-no-template-parameters {
margin-bottom: 48px;
}
.ve-ui-mwTransclusionOutlineWidget {
/* .oo-ui-window-head uses a 1px outline which overlaps the top pixel of the sidebar */
padding-top: 1px;
}
.ve-ui-mwTransclusionOutline-ariaHidden {
display: none;
}
.ve-ui-mwTransclusionOutline-no-template-parameters {
font-style: italic;
color: #72777d;
@ -60,6 +103,11 @@
white-space: nowrap;
}
/* margin for last checkbox */
.ve-ui-mwTransclusionOutlineParameterWidget:last-child {
margin-bottom: 48px;
}
.ve-ui-mwTransclusionOutlineParameterWidget.oo-ui-labelElement > .oo-ui-labelElement-label {
cursor: pointer;
display: inline;
@ -87,48 +135,6 @@
font-weight: bold;
}
.ve-ui-mwTransclusionOutlineButtonWidget,
.ve-ui-mwTransclusionOutlineButtonWidget > .oo-ui-buttonElement-button {
display: block;
}
.ve-ui-mwTransclusionOutlineButtonWidget.oo-ui-buttonElement-frameless.oo-ui-labelElement.oo-ui-iconElement > .oo-ui-buttonElement-button {
overflow: hidden;
padding: 8px 0 8px 36px;
text-overflow: ellipsis;
}
/* selected */
.ve-ui-mwTransclusionOutlineButtonWidget.oo-ui-optionWidget-selected .oo-ui-buttonElement-button {
background-color: #eaf3ff;
}
/* hover */
.ve-ui-mwTransclusionOutlineButtonWidget.oo-ui-buttonElement-frameless.oo-ui-widget-enabled > .oo-ui-buttonElement-button:hover {
background-color: #eaecf0;
}
/* selected + hover */
.ve-ui-mwTransclusionOutlineButtonWidget.oo-ui-buttonElement-frameless.oo-ui-optionWidget-selected > .oo-ui-buttonElement-button:hover {
background-color: #eaf3ff;
color: #36c;
}
/* click */
.ve-ui-mwTransclusionOutlineButtonWidget.oo-ui-buttonElement-frameless.oo-ui-widget-enabled > .oo-ui-buttonElement-button:active,
.ve-ui-mwTransclusionOutlineParameterWidget:active {
/* Same as .oo-ui-optionWidget-pressed, a.k.a. @background-color-primary--hover */
background-color: rgba( 41, 98, 204, 0.1 );
color: #36c;
}
.ve-ui-mwTransclusionOutlineButtonWidget.oo-ui-buttonElement-frameless.oo-ui-iconElement:first-child {
margin-left: 0;
}
.ve-ui-mwTransclusionOutlineButtonWidget.oo-ui-buttonElement-frameless.oo-ui-iconElement > .oo-ui-buttonElement-button > .oo-ui-iconElement-icon {
left: 10px;
}
.ve-ui-mwTransclusionOutlineTemplateWidget-searchWidget {
margin: 8px 24px;
width: auto;