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 1: Line 1:
/* core scrollable container */
/* === Scrollable Math Core Container === */
.scrollable-math {
.scrollable-math {
   display: block;
   display: block;
Line 6: Line 6:
   padding: 4px 0;
   padding: 4px 0;
   margin: 0 !important;
   margin: 0 !important;
   background-color: transparent;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
/* === REMOVE Citizen Card/Block Styling === */
/* Citizen applies backgrounds/borders to all direct child DIVs of mw-parser-output */
.mw-parser-output > .scrollable-math {
  background: none !important;
   background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
/* === REMOVE ANY INTERNAL BACKGROUNDS/BORDERS (Math Extension Elements) === */
.scrollable-math *,
.scrollable-math *::before,
.scrollable-math *::after {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
/* === FIX MULTILINE MATH WRAPPING === */
.scrollable-math math,
.scrollable-math .mwe-math-element {
  display: block;
  white-space: normal;
}
/* Wide formulas should scroll instead of squishing */
.scrollable-math .mwe-math-element {
  min-width: max-content;
}
}
/* Neutralise paragraph immediately BEFORE or AFTER the template
/* === REMOVE THE EMPTY <p> BEFORE / AFTER THE TEMPLATE === */
  (works without :has() or :empty) */
/* MediaWiki inserts empty paragraphs around block templates; collapse them */
p + .scrollable-math,
p + .scrollable-math,
.scrollable-math + p {
.scrollable-math + p {
   margin: 0 !important;
   margin: 0 !important;
   padding: 0 !important;
   padding: 0 !important;
  /* collapse any whitespace-only paragraph that was created */
   line-height: 0 !important;
   line-height: 0 !important;
   font-size: 0 !important;
   font-size: 0 !important;
}
}
/* restore readable text inside the math block (undo the zeroing) */
/* Restore normal text size inside math block */
.scrollable-math,
.scrollable-math,
.scrollable-math * {
.scrollable-math * {
   font-size: initial !important;
   font-size: inherit !important;
   line-height: normal !important;
   line-height: normal !important;
}
}/* === Scrollable Math Core Container === */
/* 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 {
.scrollable-math {
   display: block;
   display: block;
Line 45: Line 58:
   padding: 4px 0;
   padding: 4px 0;
   margin: 0 !important;
   margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
/* === REMOVE Citizen Card/Block Styling === */
/* Citizen applies backgrounds/borders to all direct child DIVs of mw-parser-output */
.mw-parser-output > .scrollable-math {
  background: none !important;
   background-color: transparent !important;
   background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
}
/* Neutralise paragraph immediately BEFORE or AFTER the template
/* === REMOVE ANY INTERNAL BACKGROUNDS/BORDERS (Math Extension Elements) === */
  (works without :has() or :empty) */
.scrollable-math *,
.scrollable-math *::before,
.scrollable-math *::after {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
/* === FIX MULTILINE MATH WRAPPING === */
.scrollable-math math,
.scrollable-math .mwe-math-element {
  display: block;
  white-space: normal;
}
/* Wide formulas should scroll instead of squishing */
.scrollable-math .mwe-math-element {
  min-width: max-content;
}
/* === REMOVE THE EMPTY <p> BEFORE / AFTER THE TEMPLATE === */
/* MediaWiki inserts empty paragraphs around block templates; collapse them */
p + .scrollable-math,
p + .scrollable-math,
.scrollable-math + p {
.scrollable-math + p {
   margin: 0 !important;
   margin: 0 !important;
   padding: 0 !important;
   padding: 0 !important;
  /* collapse any whitespace-only paragraph that was created */
   line-height: 0 !important;
   line-height: 0 !important;
   font-size: 0 !important;
   font-size: 0 !important;
}
}
/* restore readable text inside the math block (undo the zeroing) */
/* Restore normal text size inside math block */
.scrollable-math,
.scrollable-math,
.scrollable-math * {
.scrollable-math * {
   font-size: initial !important;
   font-size: inherit !important;
   line-height: normal !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;
}
}

Revision as of 09:46, 18 November 2025

/* === Scrollable Math Core Container === */
.scrollable-math {
   display: block;
   overflow-x: auto;
   max-width: 100%;
   padding: 4px 0;
   margin: 0 !important;
   background: transparent !important;
   border: none !important;
   box-shadow: none !important;
}
/* === REMOVE Citizen Card/Block Styling === */
/* Citizen applies backgrounds/borders to all direct child DIVs of mw-parser-output */
.mw-parser-output > .scrollable-math {
   background: none !important;
   background-color: transparent !important;
   border: none !important;
   box-shadow: none !important;
   padding: 0 !important;
}
/* === REMOVE ANY INTERNAL BACKGROUNDS/BORDERS (Math Extension Elements) === */
.scrollable-math *,
.scrollable-math *::before,
.scrollable-math *::after {
   background: transparent !important;
   border: none !important;
   box-shadow: none !important;
}
/* === FIX MULTILINE MATH WRAPPING === */
.scrollable-math math,
.scrollable-math .mwe-math-element {
   display: block;
   white-space: normal;
}
/* Wide formulas should scroll instead of squishing */
.scrollable-math .mwe-math-element {
   min-width: max-content;
}
/* === REMOVE THE EMPTY <p> BEFORE / AFTER THE TEMPLATE === */
/* MediaWiki inserts empty paragraphs around block templates; collapse them */
p + .scrollable-math,
.scrollable-math + p {
   margin: 0 !important;
   padding: 0 !important;
   line-height: 0 !important;
   font-size: 0 !important;
}
/* Restore normal text size inside math block */
.scrollable-math,
.scrollable-math * {
   font-size: inherit !important;
   line-height: normal !important;
}/* === Scrollable Math Core Container === */
.scrollable-math {
   display: block;
   overflow-x: auto;
   max-width: 100%;
   padding: 4px 0;
   margin: 0 !important;
   background: transparent !important;
   border: none !important;
   box-shadow: none !important;
}
/* === REMOVE Citizen Card/Block Styling === */
/* Citizen applies backgrounds/borders to all direct child DIVs of mw-parser-output */
.mw-parser-output > .scrollable-math {
   background: none !important;
   background-color: transparent !important;
   border: none !important;
   box-shadow: none !important;
   padding: 0 !important;
}
/* === REMOVE ANY INTERNAL BACKGROUNDS/BORDERS (Math Extension Elements) === */
.scrollable-math *,
.scrollable-math *::before,
.scrollable-math *::after {
   background: transparent !important;
   border: none !important;
   box-shadow: none !important;
}
/* === FIX MULTILINE MATH WRAPPING === */
.scrollable-math math,
.scrollable-math .mwe-math-element {
   display: block;
   white-space: normal;
}
/* Wide formulas should scroll instead of squishing */
.scrollable-math .mwe-math-element {
   min-width: max-content;
}
/* === REMOVE THE EMPTY <p> BEFORE / AFTER THE TEMPLATE === */
/* MediaWiki inserts empty paragraphs around block templates; collapse them */
p + .scrollable-math,
.scrollable-math + p {
   margin: 0 !important;
   padding: 0 !important;
   line-height: 0 !important;
   font-size: 0 !important;
}
/* Restore normal text size inside math block */
.scrollable-math,
.scrollable-math * {
   font-size: inherit !important;
   line-height: normal !important;
}