User:SnorlaxMonster/Infobox/styles.css: Difference between revisions
From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
m (Balance padding around images, but use less if there is a caption. (I had intended to do this using the has() selector, but seemingly that selector is not permitted in Sanitized CSS.)) |
m (Better way to do this) |
||
Line 62: | Line 62: | ||
} | } | ||
.common-infobox .infobox-image > * { | .common-infobox .infobox-image > *:not(.infobox-image-caption) { | ||
margin: 0.5rem; | margin: 0.5rem; | ||
} | } | ||
Line 68: | Line 68: | ||
.common-infobox .infobox-image-caption { | .common-infobox .infobox-image-caption { | ||
font-size:smaller; | font-size:smaller; | ||
margin-top: -0.4rem; | margin-top: -0.4rem; | ||
} | } |
Revision as of 09:19, 15 September 2024
.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; border-radius: 10px; } .common-infobox .infobox-image > *:not(.infobox-image-caption) { margin: 0.5rem; } .common-infobox .infobox-image-caption { font-size:smaller; margin-top: -0.4rem; } /* 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; }