<div class="container">
<div class="order-list" data-element="div">
<h1 data-element="h1">Heading...</h1>
<div class="list-item" data-element="div">
list item (div)
<div class="order-list" data-element="div">
<div class="list-item" data-element="div">
list item (div)
<div class="order-list" data-element="div">
<div class="list-item" data-element="div">list item (div)</div>
<div class="list-item" data-element="div">list item (div)</div>
</div>
</div>
<div class="list-item" data-element="div">list item (div)</div>
</div>
</div>
<div class="list-item" data-element="div">list item (div)</div>
</div>
</div>
<div class="form">
<label for="counter-reset">counter-reset(<integer> = n = <span id="counter-reset-n">0</span>):</label>
<input type="range" name="n" value="0" id="counter-reset" min="-5" max="5" step="1" />
<label for="counter-increment">counter-increment(<integer> = m = <span id="counter-increment-m">1</span>):</label>
<input type="range" name="m" value="1" id="counter-increment" min="-5" max="5" step="1" />
</div>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
box-sizing: border-box;
}
body {
inline-size: 100vw;
min-block-size: 100vh;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
/* align-items: center; */
gap: 10px;
font-family: "Exo", Arial, sans-serif;
background-color: #f7f7f7;
line-height: 2;
padding: 20px;
}
.container {
padding: 10px 20px;
background: #fff;
box-sizing: border-box;
box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
min-width: 50vw;
border-radius: 5px;
position: relative;
width: 80%;
max-width: 60vw;
flex: 1;
}
.order-list * {
margin: 10px 0;
}
.order-list {
border: 2px solid #ffcc00;
box-shadow: 0 0 1px rgb(0 0 0 / 0.85), inset 1px 1px 1px rgb(0 0 0 / 0.35);
padding: 10px;
border-radius: 5px;
}
.list-item {
border: 1px solid #5ac8fa;
padding: 5px 10px;
border-radius: 5px;
box-shadow: 0 0 1px rgb(0 0 0 / 0.85), inset 1px 1px 1px rgb(0 0 0 / 0.35);
}
.order-list *::before {
display: inline-flex;
color: #fff;
background-color: #f36;
padding: 10px;
line-height: 1;
font-size: 2rem;
margin-right: 20px;
aspect-ratio: 1 / 1;
justify-content: center;
align-items: center;
clip-path: polygon(
0% 0%,
89% 0,
89% 40%,
100% 50%,
89% 61%,
88% 100%,
0 100%
);
border-radius: 50%;
}
.order-list *::after {
content: "(" attr(data-element) " Element)";
font-size: 85%;
line-height: 1;
color: #5c2;
margin-left: 5px;
}
.form {
background: rgb(0 0 0 / 0.8);
color: #fff;
padding: 10px;
display: flex;
flex-direction: column;
justify-content: flex-start;
/* align-items: center; */
gap: 10px;
text-shadow: 1px 1px 0 rgb(255 125 125 / 0.8);
}
label {
display: inline-flex;
align-items: center;
gap: 5px;
cursor: pointer;
}
.order-list {
counter-reset: order;
}
.list-item {
counter-increment: order;
}
.list-item::before {
content: counters(order, ".");
/* content: counter(order); */
}
const rootElement = document.documentElement;
const inputs = document.querySelectorAll('input[type="range"]');
inputs.forEach((input) => {
input.addEventListener("change", (etv) => {
rootElement.style.setProperty(`--${etv.target.name}`, etv.target.value);
document.getElementById(`${etv.target.id}-${etv.target.name}`).textContent =
etv.target.value;
});
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.