Template:Scrollable Math/styles.css: Difference between revisions
Template page
More actions
No edit summary |
No edit summary |
||
| Line 6: | Line 6: | ||
padding: 4px 0; | padding: 4px 0; | ||
margin: 0 !important; | margin: 0 !important; | ||
background-color: transparent | background-color: transparent; | ||
} | } | ||
/* Neutralise paragraph immediately BEFORE or AFTER the template | /* Neutralise paragraph immediately BEFORE or AFTER the template | ||
| Line 29: | Line 29: | ||
white-space: normal; | white-space: normal; | ||
min-width: max-content; /* let wide formulas scroll */ | min-width: max-content; /* let wide formulas scroll */ | ||
background-color: transparent | background-color: transparent; | ||
border: none !important; | border: none !important; | ||
box-shadow: none !important; | box-shadow: none !important; | ||
Revision as of 09:43, 18 November 2025
/* core scrollable container */
.scrollable-math {
display: block;
overflow-x: auto;
max-width: 100%;
padding: 4px 0;
margin: 0 !important;
background-color: transparent;
}
/* Neutralise paragraph immediately BEFORE or AFTER the template
(works without :has() or :empty) */
p + .scrollable-math,
.scrollable-math + p {
margin: 0 !important;
padding: 0 !important;
/* collapse any whitespace-only paragraph that was created */
line-height: 0 !important;
font-size: 0 !important;
}
/* restore readable text inside the math block (undo the zeroing) */
.scrollable-math,
.scrollable-math * {
font-size: initial !important;
line-height: normal !important;
}
/* Make Math extension elements behave and avoid boxed look */
.scrollable-math .mwe-math-element {
display: block;
white-space: normal;
min-width: max-content; /* let wide formulas scroll */
background-color: transparent;
border: none !important;
box-shadow: none !important;
padding: 0 !important;
}
/* safety: prevent paragraph margins from reappearing due to skin rules */
p + .scrollable-math:first-child,
.scrollable-math + p:last-child {
margin: 0 !important;
}/* core scrollable container */
.scrollable-math {
display: block;
overflow-x: auto;
max-width: 100%;
padding: 4px 0;
margin: 0 !important;
background-color: transparent !important;
}
/* Neutralise paragraph immediately BEFORE or AFTER the template
(works without :has() or :empty) */
p + .scrollable-math,
.scrollable-math + p {
margin: 0 !important;
padding: 0 !important;
/* collapse any whitespace-only paragraph that was created */
line-height: 0 !important;
font-size: 0 !important;
}
/* restore readable text inside the math block (undo the zeroing) */
.scrollable-math,
.scrollable-math * {
font-size: initial !important;
line-height: normal !important;
}
/* Make Math extension elements behave and avoid boxed look */
.scrollable-math .mwe-math-element {
display: block;
white-space: normal;
min-width: max-content; /* let wide formulas scroll */
background-color: transparent !important;
border: none !important;
box-shadow: none !important;
padding: 0 !important;
}
/* safety: prevent paragraph margins from reappearing due to skin rules */
p + .scrollable-math:first-child,
.scrollable-math + p:last-child {
margin: 0 !important;
}
.mw-parser-output .scrollable-math, .mw-parser-output .scrollable-math *{
background-color: transparent !important;
}