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
m Protected "Template:Scrollable Math/styles.css" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
No edit summary
Line 1: Line 1:
/* core scrollable container */
.scrollable-math {
.scrollable-math {
    overflow-x: auto;
  display: block;
    max-width: 100%;
  overflow-x: auto;
    padding: 4px 0;
  max-width: 100%;
  padding: 4px 0;
  margin: 0 !important;
  background: transparent !important;
}
}
 
/* Neutralise paragraph immediately BEFORE or AFTER the template
/* Allow formulas to wrap correctly inside multi-line environments */
  (works without :has() or :empty) */
.scrollable-math math,
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: none !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: 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 {
.scrollable-math .mwe-math-element {
    display: block;     /* Block so multi-line formulas are clean */
  display: block;
    white-space: normal; /* Allow line breaks inside cases/align */
  white-space: normal;
  min-width: max-content;    /* let wide formulas scroll */
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
}
 
/* safety: prevent paragraph margins from reappearing due to skin rules */
/* Optional: prevent extremely wide formulas from breaking layout */
p + .scrollable-math:first-child,
.scrollable-math math > .mwe-math-element {
.scrollable-math + p:last-child {
    min-width: max-content;
  margin: 0 !important;
}
}

Revision as of 09:36, 18 November 2025

/* core scrollable container */
.scrollable-math {
   display: block;
   overflow-x: auto;
   max-width: 100%;
   padding: 4px 0;
   margin: 0 !important;
   background: 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: none !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: 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: none !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;
}