MediaWiki:BodyCards.css: Difference between revisions

From The Seven Sages of Rome
No edit summary
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* =========================================
/* =========================================
   Manuscript Card System (.ms-*)
   Manuscript Card System (.cc-*)
   Bootstrap 4 + Vanilla CSS only
   Bootstrap 4 + Vanilla CSS only


Line 11: Line 11:


/* ----- Page wrapper ----- */
/* ----- Page wrapper ----- */
.ms-page {
.cc-page {
  max-width: 1400px;
   margin: 2rem auto 4rem;
   margin: 2rem auto 4rem;
}
}


/* ----- Card ----- */
/* ----- Card ----- */
.ms-card {
.cc-card {
   background: #ffffff;
   background: #ffffff;
   border: 1px solid #e8e5e1;
   border: 1px solid #e8e5e1;
Line 27: Line 26:
}
}


.ms-card:hover {
.cc-card:hover {
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}
}


/* ----- Card heading ----- */
/* ----- Card heading ----- */
.ms-card-heading {
.cc-card-heading {
   font-family: Georgia, 'Times New Roman', serif;
   font-family: Georgia, 'Times New Roman', serif;
   font-size: 1.05rem;
   font-size: 1.05rem;
  margin-top: 0 !important;
   font-weight: 400;
   font-weight: 400;
   color: #1a1a1a;
   color: #1a1a1a;
Line 45: Line 45:


/* ----- Card body ----- */
/* ----- Card body ----- */
.ms-card-body {
.cc-card-body {
   padding: 0.25rem 0;
   padding: 0.25rem 0;
}
}


.ms-card-body--table {
.cc-card-body--table {
   padding: 1rem 1.25rem;
   padding: 0;
}
}


/* ----- Attribute row ----- */
/* ----- Attribute row (flex layout) ----- */
.ms-attr-row {
.cc-attr-row {
   display: flex;
   display: flex;
  flex-wrap: nowrap;
   gap: 1rem;
   gap: 1rem;
   padding: 0.625rem 1.25rem;
   padding: 0.625rem 1.25rem;
Line 63: Line 64:
}
}


.ms-attr-row:last-child {
.cc-attr-row:last-child {
   border-bottom: none;
   border-bottom: none;
}
}


.ms-attr-row:hover {
.cc-attr-row:hover {
   background: #faf9f7;
   background: #faf9f7;
}
}


/* ----- Child rows (hierarchy indentation) ----- */
/* ----- Child rows (hierarchy) ----- */
.ms-attr-row--child {
.cc-attr-row--child {
   background: #fdfcfb;
   background: #fdfcfb;
}
}


.ms-attr-row--child:hover {
.cc-attr-row--child:hover {
   background: #f5f3f0;
   background: #f5f3f0;
}
/* Depth-based indentation via data-depth attribute */
.cc-attr-label[data-depth="1"] { padding-left: 20px; }
.cc-attr-label[data-depth="2"] { padding-left: 40px; }
.cc-attr-label[data-depth="3"] { padding-left: 60px; }
.cc-attr-label[data-depth="4"] { padding-left: 80px; }
.cc-attr-row:has(.cc-attr-label[data-depth]) {
  background: #fdfcfb;
}
.cc-attr-row:has(.cc-attr-label[data-depth]):hover {
  background: #f5f3f0;
}
/* Indent marker drawn with CSS border */
.cc-attr-row:has(.cc-attr-label[data-depth]) .cc-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 ----- */
/* ----- Label ----- */
.ms-attr-label {
.cc-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 91: Line 122:
}
}


.ms-attr-label-inner {
.cc-attr-label-inner {
   display: inline;
   display: inline;
}
}


@media (min-width: 1200px) {
@media (min-width: 1200px) {
   .ms-attr-label {
   .cc-attr-label {
     flex: 0 0 260px;
     flex: 0 0 260px;
   }
   }
}
/* ----- Hierarchy indent marker (replaces old "└" character) ----- */
.ms-attr-indent {
  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;
}
}


/* ----- Value ----- */
/* ----- Value ----- */
.ms-attr-value {
.cc-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 124: Line 142:
}
}


.ms-attr-value a {
.cc-attr-value a {
   color: #2c5f8a;
   color: #2c5f8a;
   text-decoration: none;
   text-decoration: none;
Line 131: Line 149:
}
}


.ms-attr-value a:hover {
.cc-attr-value a:hover {
   color: #1a4266;
   color: #1a4266;
   border-bottom-color: #2c5f8a;
   border-bottom-color: #2c5f8a;
Line 137: Line 155:


/* ----- File / thumbnail overrides ----- */
/* ----- File / thumbnail overrides ----- */
.ms-attr-value .thumb {
.cc-attr-value .thumb {
   margin: 0.5rem 0 0;
   margin: 0.5rem 0 0;
}
/* ----- NoteCard ----- */
.cc-card--note {
  border-left: 3px solid #d4a94c;
}
.cc-card--note .cc-card-heading {
  color: #8b6914;
}
.cc-note-content {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  color: #333;
  line-height: 1.65;
}
/* ----- Empty state fallback ----- */
.cc-empty {
  padding: 1rem 1.25rem;
  color: #999;
  font-style: italic;
  font-size: 0.85rem;
}
}


/* ----- Mobile: Bootstrap 4 breakpoint (max-width: 767.98px) ----- */
/* ----- Mobile: Bootstrap 4 breakpoint (max-width: 767.98px) ----- */
@media (max-width: 767.98px) {
@media (max-width: 767.98px) {
   .ms-page {
   .cc-page {
     margin: 1rem auto 2rem;
     margin: 1rem auto 2rem;
   }
   }


   .ms-card {
   .cc-card {
     border-radius: 0.5rem;
     border-radius: 0.5rem;
     margin-bottom: 1rem;
     margin-bottom: 1rem;
   }
   }


   .ms-attr-row {
   .cc-attr-row {
     flex-direction: column;
     flex-direction: column;
     gap: 0.2rem;
     gap: 0.2rem;
Line 158: Line 200:
   }
   }


   .ms-attr-label {
   .cc-attr-label {
     flex: none;
     flex: none;
     font-size: 0.72rem;
     font-size: 0.72rem;
Line 167: Line 209:
   }
   }


   .ms-attr-value {
   .cc-attr-label[data-depth="1"],
  .cc-attr-label[data-depth="2"],
  .cc-attr-label[data-depth="3"],
  .cc-attr-label[data-depth="4"] {
    padding-left: 12px;
  }
 
  .cc-attr-value {
     font-size: 0.85rem;
     font-size: 0.85rem;
   }
   }
}
}


/* ----- DataTable / SMW table inside cards ----- */
/* =========================================
.ms-card-body--table .smw-datatable,
  MediaWiki artifact suppression
.ms-card-body--table table {
  ========================================= */
   border: none;
 
   margin: 0;
.cc-card > p,
   width: 100%;
.cc-card > pre,
.cc-card-body > p,
.cc-card-body > pre,
.cc-page > p,
.cc-page > pre,
.cc-page > .row > p,
.cc-page > .row > pre,
.cc-page > .row > .col-lg-6 > p,
.cc-page > .row > .col-lg-6 > pre,
.cc-attr-row > p,
.cc-attr-row > pre {
   display: none !important;
}
 
.cc-card-body > br,
.cc-attr-row > br {
   display: none !important;
}
 
.cc-card-body--table > * {
   display: block;
}
}


.ms-card-body--table .smw-datatable th,
.cc-card-body--table > p,
.ms-card-body--table table th {
.cc-card-body--table > pre {
   background: #faf9f7;
   display: none !important;
  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,
.cc-page pre {
.ms-card-body--table table td {
   display: none !important;
   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,
.cc-card-body--table pre {
.ms-card-body--table table tr:last-child td {
   display: block !important;
   border-bottom: none;
}
}


/* ----- Empty state fallback ----- */
/* ----- Card heading with actions ----- */
.ms-empty {
.cc-card-heading--flex {
   padding: 1rem 1.25rem;
   display: flex;
   color: #999;
   align-items: center;
   font-style: italic;
   justify-content: space-between;
  font-size: 0.85rem;
}
}


/* =========================================
.cc-card-heading-title {
  MediaWiki artifact suppression
  /* inherits heading styles */
}


  MediaWiki inserts stray <p> tags between
.cc-card-heading-actions {
  block-level elements and wraps lines with
  display: flex;
  leading whitespace in <pre>. These rules
  align-items: center;
  hide those artifacts inside ms-* containers.
  gap: 0.5rem;
  ========================================= */
}


.ms-card > p,
.cc-card-heading-actions a,
.ms-card-body > p,
.cc-card-heading-actions svg {
.ms-page > p,
  color: #555;
.ms-page > .row > p,
  opacity: 0.6;
.ms-attr-row > p {
   transition: opacity 0.15s ease;
   display: none;
}
}


.ms-card > pre,
.cc-card-heading-actions a:hover svg {
.ms-card-body > pre,
  opacity: 1;
.ms-page > pre,
}
.ms-page > .row > pre,
/* ----- Action buttons (cc-card-heading-actions) ----- */
.ms-page > .row > .col-lg-6 > pre {
.cc-btn {
   display: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #555;
  background: #ffffff;
  border: 1px solid #e8e5e1;
  border-radius: 0.375rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
   white-space: nowrap;
}
}


/* Also hide stray <br> tags MediaWiki may inject */
.cc-btn:hover {
.ms-card-body > br,
  background: #faf9f7;
.ms-attr-row > br {
  border-color: #aaa;
   display: none;
   color: #1a1a1a;
}
}


/* Ensure #ask / datatable results don't get hidden */
.cc-btn svg {
.ms-card-body--table > * {
  flex-shrink: 0;
   display: block;
  opacity: 0.6;
   transition: opacity 0.15s ease;
}
}


.ms-card-body--table > p {
.cc-btn:hover svg {
   display: none;
   opacity: 1;
}
}

Latest revision as of 12:10, 26 February 2026

/* =========================================
   Manuscript Card System (.cc-*)
   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 ----- */
.cc-page {
  margin: 2rem auto 4rem;
}

/* ----- Card ----- */
.cc-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;
}

.cc-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

/* ----- Card heading ----- */
.cc-card-heading {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
  margin-top: 0 !important;
  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 ----- */
.cc-card-body {
  padding: 0.25rem 0;
}

.cc-card-body--table {
  padding: 0;
}

/* ----- Attribute row (flex layout) ----- */
.cc-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;
}

.cc-attr-row:last-child {
  border-bottom: none;
}

.cc-attr-row:hover {
  background: #faf9f7;
}

/* ----- Child rows (hierarchy) ----- */
.cc-attr-row--child {
  background: #fdfcfb;
}

.cc-attr-row--child:hover {
  background: #f5f3f0;
}

/* Depth-based indentation via data-depth attribute */
.cc-attr-label[data-depth="1"] { padding-left: 20px; }
.cc-attr-label[data-depth="2"] { padding-left: 40px; }
.cc-attr-label[data-depth="3"] { padding-left: 60px; }
.cc-attr-label[data-depth="4"] { padding-left: 80px; }

.cc-attr-row:has(.cc-attr-label[data-depth]) {
  background: #fdfcfb;
}

.cc-attr-row:has(.cc-attr-label[data-depth]):hover {
  background: #f5f3f0;
}

/* Indent marker drawn with CSS border */
.cc-attr-row:has(.cc-attr-label[data-depth]) .cc-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 ----- */
.cc-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;
}

.cc-attr-label-inner {
  display: inline;
}

@media (min-width: 1200px) {
  .cc-attr-label {
    flex: 0 0 260px;
  }
}

/* ----- Value ----- */
.cc-attr-value {
  flex: 1 1 0%;
  min-width: 0;
  font-size: 0.875rem;
  color: #1a1a1a;
  line-height: 1.6;
  word-break: break-word;
}

.cc-attr-value a {
  color: #2c5f8a;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.cc-attr-value a:hover {
  color: #1a4266;
  border-bottom-color: #2c5f8a;
}

/* ----- File / thumbnail overrides ----- */
.cc-attr-value .thumb {
  margin: 0.5rem 0 0;
}

/* ----- NoteCard ----- */
.cc-card--note {
  border-left: 3px solid #d4a94c;
}

.cc-card--note .cc-card-heading {
  color: #8b6914;
}

.cc-note-content {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  color: #333;
  line-height: 1.65;
}

/* ----- Empty state fallback ----- */
.cc-empty {
  padding: 1rem 1.25rem;
  color: #999;
  font-style: italic;
  font-size: 0.85rem;
}

/* ----- Mobile: Bootstrap 4 breakpoint (max-width: 767.98px) ----- */
@media (max-width: 767.98px) {
  .cc-page {
    margin: 1rem auto 2rem;
  }

  .cc-card {
    border-radius: 0.5rem;
    margin-bottom: 1rem;
  }

  .cc-attr-row {
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.625rem 1rem;
  }

  .cc-attr-label {
    flex: none;
    font-size: 0.72rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
  }

  .cc-attr-label[data-depth="1"],
  .cc-attr-label[data-depth="2"],
  .cc-attr-label[data-depth="3"],
  .cc-attr-label[data-depth="4"] {
    padding-left: 12px;
  }

  .cc-attr-value {
    font-size: 0.85rem;
  }
}

/* =========================================
   MediaWiki artifact suppression
   ========================================= */

.cc-card > p,
.cc-card > pre,
.cc-card-body > p,
.cc-card-body > pre,
.cc-page > p,
.cc-page > pre,
.cc-page > .row > p,
.cc-page > .row > pre,
.cc-page > .row > .col-lg-6 > p,
.cc-page > .row > .col-lg-6 > pre,
.cc-attr-row > p,
.cc-attr-row > pre {
  display: none !important;
}

.cc-card-body > br,
.cc-attr-row > br {
  display: none !important;
}

.cc-card-body--table > * {
  display: block;
}

.cc-card-body--table > p,
.cc-card-body--table > pre {
  display: none !important;
}

.cc-page pre {
  display: none !important;
}

.cc-card-body--table pre {
  display: block !important;
}

/* ----- Card heading with actions ----- */
.cc-card-heading--flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cc-card-heading-title {
  /* inherits heading styles */
}

.cc-card-heading-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cc-card-heading-actions a,
.cc-card-heading-actions svg {
  color: #555;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.cc-card-heading-actions a:hover svg {
  opacity: 1;
}
/* ----- Action buttons (cc-card-heading-actions) ----- */
.cc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #555;
  background: #ffffff;
  border: 1px solid #e8e5e1;
  border-radius: 0.375rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.cc-btn:hover {
  background: #faf9f7;
  border-color: #aaa;
  color: #1a1a1a;
}

.cc-btn svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.cc-btn:hover svg {
  opacity: 1;
}