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
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
/* === Scrollable Math Core Container === */
/* ============================================================
  CORE SCROLLABLE MATH CONTAINER
  ============================================================ */
.scrollable-math {
.scrollable-math {
  display: block;
    display: block;
  overflow-x: auto;
    overflow-x: auto;
  max-width: 100%;
    max-width: 100%;
  padding: 4px 0;
    padding: 2px 0 !important; /* tighter */
  margin: 0 !important;
    margin: 0 !important;
  background: transparent !important;
 
  border: none !important;
    /* remove any default styling */
  box-shadow: none !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 */
/* ============================================================
  REMOVE CITIZEN BLOCK/BACKGROUND
  ============================================================ */
.mw-parser-output > .scrollable-math {
.mw-parser-output > .scrollable-math {
  background: none !important;
    background: none !important;
  background-color: transparent !important;
    border: none !important;
  border: none !important;
    box-shadow: none !important;
  box-shadow: none !important;
    padding: 0 !important;
  padding: 0 !important;
}
}
/* === REMOVE ANY INTERNAL BACKGROUNDS/BORDERS (Math Extension Elements) === */
 
/* ============================================================
  REMOVE BACKGROUNDS/BORDERS INSIDE THE MATH BLOCK
  ============================================================ */
.scrollable-math *,
.scrollable-math *,
.scrollable-math *::before,
.scrollable-math *::before,
.scrollable-math *::after {
.scrollable-math *::after {
  background: transparent !important;
    background: transparent !important;
  border: none !important;
    border: none !important;
  box-shadow: none !important;
    box-shadow: none !important;
}
}
/* === FIX MULTILINE MATH WRAPPING === */
 
/* ============================================================
  MULTILINE MATH FORMATTING
  ============================================================ */
.scrollable-math math,
.scrollable-math math,
.scrollable-math .mwe-math-element {
.scrollable-math .mwe-math-element {
  display: block;
    display: block;
  white-space: normal;
    white-space: normal; /* clean line wrapping */
}
}
/* Wide formulas should scroll instead of squishing */
 
/* Wide formulas scroll instead of shrinking */
.scrollable-math .mwe-math-element {
.scrollable-math .mwe-math-element {
  min-width: max-content;
    min-width: max-content;
}
}
/* === REMOVE THE EMPTY <p> BEFORE / AFTER THE TEMPLATE === */
 
/* MediaWiki inserts empty paragraphs around block templates; collapse them */
/* ============================================================
p + .scrollable-math,
  *** REDUCE VERTICAL SPACING (COMPACT MODE) ***
.scrollable-math + p {
   ============================================================ */
  margin: 0 !important;
.scrollable-math .mwe-math-element,
  padding: 0 !important;
.scrollable-math math {
  line-height: 0 !important;
    margin-top: 0.25em !important;
  font-size: 0 !important;
    margin-bottom: 0.25em !important;
}
    line-height: 1.1 !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 {
  SPECIAL FIX: <pre> INSIDE THE MATH BLOCK
  background: none !important;
  (this is where your unwanted margins come from)
  background-color: transparent !important;
  ============================================================ */
  border: none !important;
.scrollable-math pre {
  box-shadow: none !important;
    margin: 0 !important;
  padding: 0 !important;
    padding: 0 !important;
    line-height: 1.1 !important;
    background: transparent !important;
    border: none !important;
}
}
/* === REMOVE ANY INTERNAL BACKGROUNDS/BORDERS (Math Extension Elements) === */
 
.scrollable-math *,
/* If Citizen adds whitespace blocks inside pre, kill them */
.scrollable-math *::before,
.scrollable-math pre * {
.scrollable-math *::after {
    margin: 0 !important;
  background: transparent !important;
    padding: 0 !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 */
/* ============================================================
  COLLAPSE EMPTY PARAGRAPHS BEFORE / AFTER TEMPLATE
  ============================================================ */
p + .scrollable-math,
p + .scrollable-math,
.scrollable-math + p {
.scrollable-math + p {
  margin: 0 !important;
    margin: 0 !important;
  padding: 0 !important;
    padding: 0 !important;
  line-height: 0 !important;
    line-height: 0 !important;
  font-size: 0 !important;
    font-size: 0 !important;
}
}
/* Restore normal text size inside math block */
 
/* restore normal text inside scrollable-math */
.scrollable-math,
.scrollable-math,
.scrollable-math * {
.scrollable-math * {
  font-size: inherit !important;
    font-size: inherit !important;
  line-height: normal !important;
    line-height: normal !important;
}
}

Latest revision as of 09:59, 18 November 2025

/* ============================================================
   CORE SCROLLABLE MATH CONTAINER
   ============================================================ */
.scrollable-math {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    padding: 2px 0 !important; /* tighter */
    margin: 0 !important;

    /* remove any default styling */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ============================================================
   REMOVE CITIZEN BLOCK/BACKGROUND
   ============================================================ */
.mw-parser-output > .scrollable-math {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* ============================================================
   REMOVE BACKGROUNDS/BORDERS INSIDE THE MATH BLOCK
   ============================================================ */
.scrollable-math *,
.scrollable-math *::before,
.scrollable-math *::after {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ============================================================
   MULTILINE MATH FORMATTING
   ============================================================ */
.scrollable-math math,
.scrollable-math .mwe-math-element {
    display: block;
    white-space: normal; /* clean line wrapping */
}

/* Wide formulas scroll instead of shrinking */
.scrollable-math .mwe-math-element {
    min-width: max-content;
}

/* ============================================================
   *** REDUCE VERTICAL SPACING (COMPACT MODE) ***
   ============================================================ */
.scrollable-math .mwe-math-element,
.scrollable-math math {
    margin-top: 0.25em !important;
    margin-bottom: 0.25em !important;
    line-height: 1.1 !important;
}

/* ============================================================
   SPECIAL FIX: <pre> INSIDE THE MATH BLOCK
   (this is where your unwanted margins come from)
   ============================================================ */
.scrollable-math pre {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.1 !important;
    background: transparent !important;
    border: none !important;
}

/* If Citizen adds whitespace blocks inside pre, kill them */
.scrollable-math pre * {
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================================
   COLLAPSE EMPTY PARAGRAPHS BEFORE / AFTER TEMPLATE
   ============================================================ */
p + .scrollable-math,
.scrollable-math + p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

/* restore normal text inside scrollable-math */
.scrollable-math,
.scrollable-math * {
    font-size: inherit !important;
    line-height: normal !important;
}