<section>
<p>Default paint-order</p>
<h1>
<span>Super</span>
<div>
<span>CSS</span>
<span>World</span>
</div>
</h1>
</section>
<section>
<p>paint-order: stroke fill</p>
<h1 class="paint-order">
<span>Super</span>
<div>
<span>CSS</span>
<span>World</span>
</div>
</h1>
</section>
.paint-order {
paint-order: stroke fill;
/* https://caniuse.com/mdn-css_properties_paint-order */
/* default is paint-order: fill stroke */
/* mdn: https://developer.mozilla.org/en-US/docs/Web/CSS/paint-order */
}
@layer demo.support {
h1 {
display: flex;
flex-direction: column;
align-items: center;
text-transform: uppercase;
font-size: calc(1rem + min(90px, 15vw));
font-weight: 900;
letter-spacing: -.175ch;
line-height: 0.9;
color: white;
text-stroke: 5px black;
text-shadow: 8px 8px black;
> span:first-of-type {
font-size: .75em;
}
> div {
display: flex;
gap: .5ch;
}
}
* {
box-sizing: border-box;
margin: 0;
}
html {
block-size: 100%;
}
body {
min-block-size: 100%;
font-family: system-ui, sans-serif;
display: grid;
place-content: center;
gap: 15vmin;
}
section {
display: grid;
place-items: center;
gap: 2vmin;
> p {
border: 2px solid #aaa;
border-radius: 1e3px;
padding-inline: 1.5ch;
line-height: 1.75;
}
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.