console
<div class="card">
<div class="card__content">
<label for="css"><input type="checkbox" name="css" id="css" />CSS</label>
<label for="html"><input type="checkbox" name="html" id="html" checked />HTML</label>
<label for="js"><input type="checkbox" name="js" id="js" />JavaScript</label>
<label for="vue"><input type="checkbox" name="vue" id="vue" checked />Vue</label>
<label for="react"><input type="checkbox" name="react" id="react" />React</label>
<label for="php"><input type="checkbox" name="php" id="php" />PHP</label>
<label for="java"><input type="checkbox" name="java" id="java" />Java</label>
<label for="python"><input type="checkbox" name="python" id="python" />Python</label>
</div>
</div>
input[type="checkbox"] {
height: 1px;
overflow: hidden;
width: 1px;
position: absolute;
}
label {
display: flex;
align-items: center;
gap: 0.5em;
padding: 0.5em;
border: 1px solid transparent;
border-radius: var(--radius-tl, 0) var(--radius-tr, 0) var(--radius-br, 0) var(--radius-bl, 0);
}
label::before {
content: "";
display: inline-flex;
justify-content: center;
align-items: center;
border-radius: 4px;
border: 1px solid #c5c5c5;
background: #fff;
color: #c5c5c5;
width: 24px;
aspect-ratio: 1;
transition: all 0.2s ease;
}
label:has(:checked) {
color: #9739e8;
}
label:has(:checked)::before {
content: "✔";
border-color: #9739e8;
background-color: #9739e8;
color: #fff;
font-size: 0.75em;
}
label:has(:checked):not(label:has(:checked) + label) {
border-radius: 5px;
border-block-start-color: black;
}
label:has(:checked):not(label:has(+ label :checked)) {
border-block-end-color: black;
box-shadow: 0 4px 3px -2px rgba(0, 0, 0, 0.35);
}
label:has(:checked):has(~ label :checked),
label:has(:checked):not(label:has(+ label :checked)) {
border-inline-color: black;
background-color: palegreen;
}