<div class="shapes">
<div class="shape">L</div>
<div class="shape shape--medium">M</div>
<div class="shape shape--small">S</div>
</div>
body {
padding: 40px;
}
.shapes {
display: flex;
flex-direction: column;
gap: 20px;
}
.shape {
--width: 90px;
--height: 60px;
--font-size: 30px;
--color: white;
--background-color: red;
width: var(--width);
height: var(--height);
font-size: var(--font-size);
font-weight: 700;
line-height: 1;
color: var(--color);
background: var(--background-color);
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.shape--medium {
--width: 60px;
--height: 40px;
--font-size: 20px;
--background-color: orange;
}
.shape--small {
--width: 30px;
--height: 20px;
--font-size: 10px;
--background-color: green;
}
.shape::before {
--size: calc(var(--height) / 2);
content: "";
position: absolute;
top: 0;
right: calc(var(--size) * -1);
width: 0;
height: 0;
border-left: var(--size) solid var(--background-color);
border-top: var(--size) solid transparent;
border-bottom: var(--size) solid transparent;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.