Template:Centered headers/styles.css
Template page
More actions
/* hide the edit section button */
h2 .mw-editsection,
h3 .mw-editsection {
display: none;
}
h2 > span:not(.mw-editsection):not(.mw-headline),
h3 > span:not(.mw-editsection):not(.mw-headline) {
position: absolute;
}
/* flex container to allow for the lines on each side */
h2, h3 {
display: flex;
position: relative;
flex-wrap: nowrap;
align-items: center;
justify-content: center;
gap: var(--space-md);
}
h2 .mw-headline,
h3 .mw-headline {
/* typography for header */
text-align: center;
font-weight: bold;
/* no changes */
flex: none;
}
/* solid line around h2 */
h2::before,
h2::after {
content: '';
border-top: 1px solid var(--color-base--emphasized);
}
/* dashed line around h3 */
h3::before,
h3::after {
content: '';
border-top: 1px dashed var(--color-base--emphasized);
}
h2 .mw-headline {
font-size: var(--font-size-xxx-large);
}
h3 .mw-headline {
font-size: var(--font-size-x-large);
}
/* lines around h2, h3 */
h2::before,
h2::after,
h3::before,
h3::after {
/* only grow, minimum 2rem */
flex: 1 0 2rem;
}
h2::before,
h3::before {
margin-right: auto;
}
h2::after,
h3::after {
margin-left: auto;
}