User:SnorlaxMonster/Infobox/styles.css

From Bulbapedia, the community-driven Pokémon encyclopedia.
< User:SnorlaxMonster‎ | Infobox
Revision as of 08:37, 15 September 2024 by SnorlaxMonster (talk | contribs) (Refactor to not specify infobox style in element names)
Jump to navigationJump to search
.common-infobox {
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 10px;
  border: 3px solid rgba(0, 0, 0, 0.35);
}

/* Width depends on window size */
@media all and (min-width:720px) {
  .common-infobox {
    float: right;
    width: 400px;
  }
}

@media all and (max-width:719px) {
  .common-infobox {
    width: auto;
  }
}

/* Title area */
.common-infobox .infobox-title-tall {
  padding: 3px;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.35);
  border-radius: 10px;
}

.common-infobox .infobox-title-compact {
  padding: 3px;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
}

.common-infobox .infobox-title-en {
  font-size: large;
  font-weight: bold;
  grid-row: span 2;
}

.common-infobox .infobox-title-ja {
  font-weight: bold;
}

.common-infobox .infobox-title-trans {
  font-size: smaller;
  font-style: italic;
}

/* Image area */
.common-infobox .infobox-image {
  text-align: center;
  background-color: #FFF;
  padding-top: 5px;
  padding-bottom: 2px;
  border-radius: 10px;
}

.common-infobox .infobox-image-caption {
  font-size: smaller;
}

/* Tables */
.common-infobox table {
  border-collapse: collapse;

  /* Undo Minerva table styling */
  display: table;
  margin: unset;
}

.common-infobox table caption {
  margin: 0px 20px;
  text-align: center;
  color: #FFF;
  font-weight: bold;
  background-color: rgba(0, 0, 0, 0.35);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.common-infobox table th {
  padding: 2px;
  border: 1px solid black;
  background-color: rgba(255, 255, 255, 0.35);
  text-align: right;
  width: 50%;
}

.common-infobox table td {
  padding: 2px;
  border: 1px solid black;
  background-color: #FFF;
}

/* Hide external table borders */
.common-infobox table tr:first-child th,
.common-infobox table tr:first-child td
{
  border-top: none;
}

.common-infobox table tr:last-child th,
.common-infobox table tr:last-child td {
  border-bottom: none;
}

.common-infobox table tr th:first-child,
.common-infobox table tr td:first-child {
  border-left: none;
}

.common-infobox table tr th:last-child,
.common-infobox table tr td:last-child {
  border-right: none;
}

/* Round corner cells */
.common-infobox table tr:first-child th:first-child {
  border-top-left-radius: 10px;
}

.common-infobox table tr:first-child td:last-child {
  border-top-right-radius: 10px;
}

.common-infobox table tr:last-child th:first-child {
  border-bottom-left-radius: 10px;
}

.common-infobox table tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}