MediaWiki:BodyCards.css: Difference between revisions
From The Seven Sages of Rome
No edit summary |
No edit summary |
||
| Line 36: | Line 36: | ||
font-weight: 400; | font-weight: 400; | ||
color: #1a1a1a; | color: #1a1a1a; | ||
margin: 0 | margin: 0; | ||
padding: 0.875rem 1.25rem; | padding: 0.875rem 1.25rem; | ||
background: #faf9f7; | background: #faf9f7; | ||
| Line 52: | Line 52: | ||
} | } | ||
/* ----- Attribute row ----- */ | /* ----- Attribute row (flex layout) ----- */ | ||
.ms-attr-row { | .ms-attr-row { | ||
display: flex; | display: flex; | ||
flex-wrap: nowrap; | |||
gap: 1rem; | gap: 1rem; | ||
padding: 0.625rem 1.25rem; | padding: 0.625rem 1.25rem; | ||
| Line 70: | Line 71: | ||
} | } | ||
/* ----- Child rows (hierarchy | /* ----- Child rows (hierarchy) ----- */ | ||
.ms-attr-row--child { | .ms-attr-row--child { | ||
background: #fdfcfb; | background: #fdfcfb; | ||
| Line 77: | Line 78: | ||
.ms-attr-row--child:hover { | .ms-attr-row--child:hover { | ||
background: #f5f3f0; | background: #f5f3f0; | ||
} | |||
/* Depth-based indentation via CSS classes (no inline styles) */ | |||
.ms-depth-1 .ms-attr-label { padding-left: 20px; } | |||
.ms-depth-2 .ms-attr-label { padding-left: 40px; } | |||
.ms-depth-3 .ms-attr-label { padding-left: 60px; } | |||
.ms-depth-4 .ms-attr-label { padding-left: 80px; } | |||
/* Indent marker drawn with CSS border */ | |||
.ms-attr-row--child .ms-attr-label-inner::before { | |||
content: ""; | |||
display: inline-block; | |||
width: 10px; | |||
height: 10px; | |||
margin-right: 6px; | |||
border-left: 1.5px solid #bbb; | |||
border-bottom: 1.5px solid #bbb; | |||
border-radius: 0 0 0 3px; | |||
vertical-align: middle; | |||
position: relative; | |||
top: -2px; | |||
} | } | ||
| Line 82: | Line 104: | ||
.ms-attr-label { | .ms-attr-label { | ||
flex: 0 0 220px; | flex: 0 0 220px; | ||
min-width: 0; | |||
font-size: 0.835rem; | font-size: 0.835rem; | ||
font-weight: 500; | font-weight: 500; | ||
| Line 98: | Line 121: | ||
flex: 0 0 260px; | flex: 0 0 260px; | ||
} | } | ||
} | } | ||
| Line 117: | Line 126: | ||
.ms-attr-value { | .ms-attr-value { | ||
flex: 1 1 0%; | flex: 1 1 0%; | ||
min-width: 0; | |||
font-size: 0.875rem; | font-size: 0.875rem; | ||
color: #1a1a1a; | color: #1a1a1a; | ||
| Line 138: | Line 148: | ||
.ms-attr-value .thumb { | .ms-attr-value .thumb { | ||
margin: 0.5rem 0 0; | margin: 0.5rem 0 0; | ||
} | |||
/* ----- NoteCard ----- */ | |||
.ms-card--note { | |||
border-left: 3px solid #d4a94c; | |||
} | |||
.ms-card--note .ms-card-heading { | |||
color: #8b6914; | |||
} | |||
.ms-note-content { | |||
padding: 0.875rem 1.25rem; | |||
font-size: 0.875rem; | |||
color: #333; | |||
line-height: 1.65; | |||
} | } | ||
| Line 164: | Line 190: | ||
letter-spacing: 0.04em; | letter-spacing: 0.04em; | ||
font-weight: 600; | font-weight: 600; | ||
} | |||
.ms-depth-1 .ms-attr-label, | |||
.ms-depth-2 .ms-attr-label, | |||
.ms-depth-3 .ms-attr-label, | |||
.ms-depth-4 .ms-attr-label { | |||
padding-left: 12px; | |||
} | } | ||
| Line 222: | Line 255: | ||
.ms-card > p, | .ms-card > p, | ||
.ms-card > pre, | |||
.ms-card-body > p, | .ms-card-body > p, | ||
.ms-card-body > pre, | |||
.ms-page > p, | .ms-page > p, | ||
.ms-page > pre, | |||
.ms-page > .row > p, | .ms-page > .row > p, | ||
.ms-page > .row > pre, | .ms-page > .row > pre, | ||
.ms-page > .row > .col-lg-6 > pre { | .ms-page > .row > .col-lg-6 > p, | ||
display: none; | .ms-page > .row > .col-lg-6 > pre, | ||
.ms-attr-row > p, | |||
.ms-attr-row > pre { | |||
display: none !important; | |||
} | } | ||
| Line 240: | Line 272: | ||
.ms-card-body > br, | .ms-card-body > br, | ||
.ms-attr-row > br { | .ms-attr-row > br { | ||
display: none; | display: none !important; | ||
} | } | ||
| Line 248: | Line 280: | ||
} | } | ||
.ms-card-body--table > p { | .ms-card-body--table > p, | ||
display: none; | .ms-card-body--table > pre { | ||
display: none !important; | |||
} | |||
/* Suppress <pre> anywhere inside the ms-page wrapper */ | |||
.ms-page pre { | |||
display: none !important; | |||
} | |||
/* But allow <pre> inside code blocks if explicitly wanted */ | |||
.ms-card-body--table pre { | |||
display: block !important; | |||
} | } | ||
Revision as of 17:31, 25 February 2026
/* =========================================
Manuscript Card System (.ms-*)
Bootstrap 4 + Vanilla CSS only
Add this to MediaWiki:Common.css
NOTE: MediaWiki may inject <p> and <pre>
tags between HTML elements. The rules at
the bottom suppress these artifacts.
========================================= */
/* ----- Page wrapper ----- */
.ms-page {
margin: 2rem auto 4rem;
}
/* ----- Card ----- */
.ms-card {
background: #ffffff;
border: 1px solid #e8e5e1;
border-radius: 0.75rem;
margin-bottom: 1.25rem;
overflow: hidden;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
transition: box-shadow 0.2s ease;
}
.ms-card:hover {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}
/* ----- Card heading ----- */
.ms-card-heading {
font-family: Georgia, 'Times New Roman', serif;
font-size: 1.05rem;
font-weight: 400;
color: #1a1a1a;
margin: 0;
padding: 0.875rem 1.25rem;
background: #faf9f7;
border-bottom: 1px solid #e8e5e1;
letter-spacing: 0.01em;
}
/* ----- Card body ----- */
.ms-card-body {
padding: 0.25rem 0;
}
.ms-card-body--table {
padding: 1rem 1.25rem;
}
/* ----- Attribute row (flex layout) ----- */
.ms-attr-row {
display: flex;
flex-wrap: nowrap;
gap: 1rem;
padding: 0.625rem 1.25rem;
border-bottom: 1px solid #f0eeeb;
align-items: baseline;
transition: background 0.15s ease;
}
.ms-attr-row:last-child {
border-bottom: none;
}
.ms-attr-row:hover {
background: #faf9f7;
}
/* ----- Child rows (hierarchy) ----- */
.ms-attr-row--child {
background: #fdfcfb;
}
.ms-attr-row--child:hover {
background: #f5f3f0;
}
/* Depth-based indentation via CSS classes (no inline styles) */
.ms-depth-1 .ms-attr-label { padding-left: 20px; }
.ms-depth-2 .ms-attr-label { padding-left: 40px; }
.ms-depth-3 .ms-attr-label { padding-left: 60px; }
.ms-depth-4 .ms-attr-label { padding-left: 80px; }
/* Indent marker drawn with CSS border */
.ms-attr-row--child .ms-attr-label-inner::before {
content: "";
display: inline-block;
width: 10px;
height: 10px;
margin-right: 6px;
border-left: 1.5px solid #bbb;
border-bottom: 1.5px solid #bbb;
border-radius: 0 0 0 3px;
vertical-align: middle;
position: relative;
top: -2px;
}
/* ----- Label ----- */
.ms-attr-label {
flex: 0 0 220px;
min-width: 0;
font-size: 0.835rem;
font-weight: 500;
color: #555;
line-height: 1.5;
letter-spacing: 0.01em;
padding-top: 1px;
}
.ms-attr-label-inner {
display: inline;
}
@media (min-width: 1200px) {
.ms-attr-label {
flex: 0 0 260px;
}
}
/* ----- Value ----- */
.ms-attr-value {
flex: 1 1 0%;
min-width: 0;
font-size: 0.875rem;
color: #1a1a1a;
line-height: 1.6;
word-break: break-word;
}
.ms-attr-value a {
color: #2c5f8a;
text-decoration: none;
border-bottom: 1px solid transparent;
transition: border-color 0.15s ease, color 0.15s ease;
}
.ms-attr-value a:hover {
color: #1a4266;
border-bottom-color: #2c5f8a;
}
/* ----- File / thumbnail overrides ----- */
.ms-attr-value .thumb {
margin: 0.5rem 0 0;
}
/* ----- NoteCard ----- */
.ms-card--note {
border-left: 3px solid #d4a94c;
}
.ms-card--note .ms-card-heading {
color: #8b6914;
}
.ms-note-content {
padding: 0.875rem 1.25rem;
font-size: 0.875rem;
color: #333;
line-height: 1.65;
}
/* ----- Mobile: Bootstrap 4 breakpoint (max-width: 767.98px) ----- */
@media (max-width: 767.98px) {
.ms-page {
margin: 1rem auto 2rem;
}
.ms-card {
border-radius: 0.5rem;
margin-bottom: 1rem;
}
.ms-attr-row {
flex-direction: column;
gap: 0.2rem;
padding: 0.625rem 1rem;
}
.ms-attr-label {
flex: none;
font-size: 0.72rem;
color: #777;
text-transform: uppercase;
letter-spacing: 0.04em;
font-weight: 600;
}
.ms-depth-1 .ms-attr-label,
.ms-depth-2 .ms-attr-label,
.ms-depth-3 .ms-attr-label,
.ms-depth-4 .ms-attr-label {
padding-left: 12px;
}
.ms-attr-value {
font-size: 0.85rem;
}
}
/* ----- DataTable / SMW table inside cards ----- */
.ms-card-body--table .smw-datatable,
.ms-card-body--table table {
border: none;
margin: 0;
width: 100%;
}
.ms-card-body--table .smw-datatable th,
.ms-card-body--table table th {
background: #faf9f7;
font-weight: 500;
font-size: 0.82rem;
text-transform: uppercase;
letter-spacing: 0.03em;
color: #555;
border-bottom: 2px solid #e8e5e1;
padding: 0.5rem 0.75rem;
}
.ms-card-body--table .smw-datatable td,
.ms-card-body--table table td {
font-size: 0.875rem;
border-bottom: 1px solid #f0eeeb;
padding: 0.5rem 0.75rem;
color: #1a1a1a;
}
.ms-card-body--table .smw-datatable tr:last-child td,
.ms-card-body--table table tr:last-child td {
border-bottom: none;
}
/* ----- Empty state fallback ----- */
.ms-empty {
padding: 1rem 1.25rem;
color: #999;
font-style: italic;
font-size: 0.85rem;
}
/* =========================================
MediaWiki artifact suppression
MediaWiki inserts stray <p> tags between
block-level elements and wraps lines with
leading whitespace in <pre>. These rules
hide those artifacts inside ms-* containers.
========================================= */
.ms-card > p,
.ms-card > pre,
.ms-card-body > p,
.ms-card-body > pre,
.ms-page > p,
.ms-page > pre,
.ms-page > .row > p,
.ms-page > .row > pre,
.ms-page > .row > .col-lg-6 > p,
.ms-page > .row > .col-lg-6 > pre,
.ms-attr-row > p,
.ms-attr-row > pre {
display: none !important;
}
/* Also hide stray <br> tags MediaWiki may inject */
.ms-card-body > br,
.ms-attr-row > br {
display: none !important;
}
/* Ensure #ask / datatable results don't get hidden */
.ms-card-body--table > * {
display: block;
}
.ms-card-body--table > p,
.ms-card-body--table > pre {
display: none !important;
}
/* Suppress <pre> anywhere inside the ms-page wrapper */
.ms-page pre {
display: none !important;
}
/* But allow <pre> inside code blocks if explicitly wanted */
.ms-card-body--table pre {
display: block !important;
}