Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Create an account below if you want to be able to make edits.

Template:Scrollable Math/styles.css: Difference between revisions

Template page
No edit summary
No edit summary
Line 77: Line 77:
.scrollable-math + p:last-child {
.scrollable-math + p:last-child {
   margin: 0 !important;
   margin: 0 !important;
}
.mw-parser-output .scrollable-math, .mw-parser-output .scrollable-math *{
  background-color: transparent !important;
}
}

Revision as of 09:41, 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 !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;
}/* 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;
}