Group and nest stylesheets now they are .less files

Change-Id: Iedd9748cf9f38847ef4553459d533a67a0950645
This commit is contained in:
thiemowmde 2024-01-21 15:59:20 +01:00
parent 80c8eaf3ce
commit 16711d681b
6 changed files with 89 additions and 87 deletions

View file

@ -4,10 +4,10 @@
.mw-cite-up-arrow-backlink {
display: none;
}
:target .mw-cite-up-arrow-backlink {
display: inline;
:target & {
display: inline;
}
}
:target .mw-cite-up-arrow {

View file

@ -10,14 +10,16 @@
/* Upstream bug in stylelint makes it complain aboout the case of 'mw-Ref' */
/* With a group set */
.mw-ref a[ data-mw-group ]::after {
content: '[' attr( data-mw-group ) ' ' counter( mw-Ref, decimal ) ']';
}
.mw-ref a {
/* With a group set */
&[ data-mw-group ]::after {
content: '[' attr( data-mw-group ) ' ' counter( mw-Ref, decimal ) ']';
}
/* Without a group */
.mw-ref a::after {
content: '[' counter( mw-Ref, decimal ) ']';
/* Without a group */
&::after {
content: '[' counter( mw-Ref, decimal ) ']';
}
}
/* Hide the default rendering in browsers that support content
@ -44,20 +46,20 @@ ol.mw-references {
* is the one that seems to be winning.
**/
counter-reset: mw-ref-extends-parent mw-references list-item;
}
ol.mw-references > li {
/**
* We have 2 counters for Parsoid HTML for different functionality.
* Make sure both are incremented!
*
* NOTE: This rule is a duplicate of the one present in ext.cite.styles.less
* but duplicating it here ensures no matter how the rules and files are
* refactored and which rule ends up applying on the loaded doc, both
* counters continue to be incremented. As of now, the rule in ext.cite.styles.less
* is the one that seems to be winning.
**/
counter-increment: mw-ref-extends-parent mw-references;
> li {
/**
* We have 2 counters for Parsoid HTML for different functionality.
* Make sure both are incremented!
*
* NOTE: This rule is a duplicate of the one present in ext.cite.styles.less
* but duplicating it here ensures no matter how the rules and files are
* refactored and which rule ends up applying on the loaded doc, both
* counters continue to be incremented. As of now, the rule in ext.cite.styles.less
* is the one that seems to be winning.
**/
counter-increment: mw-ref-extends-parent mw-references;
}
}
[ rel~='mw:referencedBy' ]::before {
@ -66,23 +68,23 @@ ol.mw-references > li {
span[ rel~='mw:referencedBy' ] {
counter-reset: mw-ref-linkback -1;
}
span[ rel~='mw:referencedBy' ] a::before {
counter-increment: mw-ref-linkback;
content: counter( mw-references, decimal ) '.' counter( mw-ref-linkback, decimal );
line-height: 1;
vertical-align: super; /* <sup> use in Cite */
font-size: smaller; /* <sup> use in Cite */
}
a::before {
counter-increment: mw-ref-linkback;
content: counter( mw-references, decimal ) '.' counter( mw-ref-linkback, decimal );
line-height: 1;
vertical-align: super; /* <sup> use in Cite */
font-size: smaller; /* <sup> use in Cite */
}
span[ rel~='mw:referencedBy' ] a::after {
content: ' '; /* default separator outside <sup> */
line-height: 1;
}
a::after {
content: ' '; /* default separator outside <sup> */
line-height: 1;
}
span[ rel~='mw:referencedBy' ] a:last-child::after {
content: '';
a:last-child::after {
content: '';
}
}
/* Hide the default rendering in browsers that support content

View file

@ -11,18 +11,18 @@
-moz-column-width: 30em;
column-width: 30em;
margin-top: 0.3em;
}
/* Lines first column up nicely. */
.mw-parser-output .mw-references-columns .references {
margin-top: 0;
}
/* Lines first column up nicely. */
.mw-parser-output & .references {
margin-top: 0;
}
/* Avoid elements from breaking between columns */
.mw-references-columns li {
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid-column;
/* Avoid elements from breaking between columns */
li {
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid-column;
}
}
ol.references {
@ -34,20 +34,20 @@ ol.references {
* Make sure both are reset!
**/
counter-reset: mw-ref-extends-parent mw-references list-item;
}
ol.references > li {
/**
* We have 2 counters for Parsoid HTML for different functionality.
* Make sure both are incremented!
**/
counter-increment: mw-ref-extends-parent mw-references;
counter-reset: mw-ref-extends-child;
}
> li {
/**
* We have 2 counters for Parsoid HTML for different functionality.
* Make sure both are incremented!
**/
counter-increment: mw-ref-extends-parent mw-references;
counter-reset: mw-ref-extends-child;
}
ol.references .mw-extended-references {
list-style: none;
margin-left: 2em;
.mw-extended-references {
list-style: none;
margin-left: 2em;
}
}
.mw-extended-references > li::before {
@ -81,15 +81,15 @@ sup.reference:target {
font-weight: bold;
/* For the case that the error is embedded in an element with a different direction */
unicode-bidi: embed;
}
.mw-ext-cite-error code {
/* As code is inheriting `#f8f9fa` as background color from `code`,
we need to increase contrast, by setting it to `transparent`. See T247903. */
background-color: transparent;
color: inherit;
/* Reduce inherited `padding` to make code fit in better in Resources list. */
padding: 1px 2px;
code {
/* As code is inheriting `#f8f9fa` as background color from `code`,
we need to increase contrast, by setting it to `transparent`. See T247903. */
background-color: transparent;
color: inherit;
/* Reduce inherited `padding` to make code fit in better in Resources list. */
padding: 1px 2px;
}
}
/* @noflip */

View file

@ -40,12 +40,12 @@
user-select: none;
pointer-events: none;
}
}
.ve-ce-mwReferencesListNode-highlight {
.ve-ce-surface-highlights-focused & {
background: transparent;
pointer-events: none;
box-shadow: inset 0 0 0 1px #4c76ac, 0 0 0 2px #4c76ac;
&-highlight {
.ve-ce-surface-highlights-focused & {
background: transparent;
pointer-events: none;
box-shadow: inset 0 0 0 1px #4c76ac, 0 0 0 2px #4c76ac;
}
}
}

View file

@ -18,7 +18,7 @@
word-wrap: break-word;
overflow-wrap: break-word;
& + .ve-ui-mwReferenceContextItem-muted {
+ .ve-ui-mwReferenceContextItem-muted {
margin-top: 0.5em;
}
}

View file

@ -9,20 +9,20 @@
position: relative;
padding: 1em;
border-bottom: 1px solid #eaecf0;
}
.ve-ui-mwReferenceResultWidget:last-child {
border-bottom: 0;
}
&:last-child {
border-bottom: 0;
}
.ve-ui-mwReferenceResultWidget.oo-ui-labelElement .oo-ui-labelElement-label {
white-space: normal;
}
&.oo-ui-labelElement .oo-ui-labelElement-label {
white-space: normal;
}
.ve-ui-mwReferenceResultWidget-shield {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
&-shield {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
}