Dark Checkbox by codepeek
Zoom
Saved
1 line⌘Z Undo
1<!--2 Author: @codepeek3 License: MIT4 Tags: #checkbox #dark #playful #svg #tactile5-->6<div class="spc">7 <p class="spc__title">QC · Chore jacket #0412</p>8 <div class="spc__grid">9 <label class="spc__item">10 <input class="spc__in" type="checkbox" checked>11 <span class="spc__patch" aria-hidden="true">12 <svg viewBox="0 0 40 40">13 <path d="M9 21l8 8L32 12"/>14 </svg>15 </span>16 <span class="spc__lbl">Hemmed</span>17 </label>18 <label class="spc__item">19 <input class="spc__in" type="checkbox">20 <span class="spc__patch" aria-hidden="true">21 <svg viewBox="0 0 40 40">22 <path d="M9 21l8 8L32 12"/>23 </svg>24 </span>25 <span class="spc__lbl">Pressed</span>26 </label>27 <label class="spc__item">28 <input class="spc__in" type="checkbox">29 <span class="spc__patch" aria-hidden="true">30 <svg viewBox="0 0 40 40">31 <path d="M9 21l8 8L32 12"/>32 </svg>33 </span>34 <span class="spc__lbl">Tagged</span>35 </label>36 </div>37</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!--
Author: @codepeek
License: MIT
Tags: #checkbox #dark #playful #svg #tactile
-->
<div class="spc">
<p class="spc__title">QC · Chore jacket #0412</p>
<div class="spc__grid">
<label class="spc__item">
<input class="spc__in" type="checkbox" checked>
<span class="spc__patch" aria-hidden="true">
<svg viewBox="0 0 40 40">
<path d="M9 21l8 8L32 12"/>
</svg>
</span>
<span class="spc__lbl">Hemmed</span>
</label>
<label class="spc__item">
<input class="spc__in" type="checkbox">
<span class="spc__patch" aria-hidden="true">
<svg viewBox="0 0 40 40">
<path d="M9 21l8 8L32 12"/>
</svg>
</span>
<span class="spc__lbl">Pressed</span>
</label>
<label class="spc__item">
<input class="spc__in" type="checkbox">
<span class="spc__patch" aria-hidden="true">
<svg viewBox="0 0 40 40">
<path d="M9 21l8 8L32 12"/>
</svg>
</span>
<span class="spc__lbl">Tagged</span>
</label>
</div>
</div>1/* * Author: @codepeek * License: MIT * Tags: #checkbox #dark #playful #svg #tactile */2.spc {3 width: 300px;4 font-family: system-ui,-apple-system,"Segoe UI",sans-serif;5 color: #d9d2c4;6}7.spc__title {8 margin: 0 0 16px;9 font: 600 11px ui-monospace,SFMono-Regular,Menlo,monospace;10 letter-spacing: .14em;11 text-transform: uppercase;12 color: #8f887b;13}14.spc__grid {15 display: flex;16 justify-content: space-between;17}18.spc__item {19 position: relative;20 display: flex;21 flex-direction: column;22 align-items: center;23 gap: 10px;24 width: 86px;25 cursor: pointer;26}27.spc__in {28 position: absolute;29 top: 0;30 left: 0;31 width: 1px;32 height: 1px;33 margin: 0;34 opacity: 0;35}36.spc__patch {37 position: relative;38 display: grid;39 place-items: center;40 width: 78px;41 height: 78px;42 border-radius: 10px;43 background: repeating-linear-gradient(45deg,rgba(255,255,255,.07) 0 1px,transparent 1px 3px),repeating-linear-gradient(-45deg,rgba(0,0,0,.2) 0 1px,transparent 1px 4px),linear-gradient(160deg,#3e5a7a,#22344a);44 box-shadow: inset 0 0 0 1px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.12),0 6px 12px -4px rgba(0,0,0,.7);45 transition: transform .35s cubic-bezier(.3,1.6,.5,1),box-shadow .35s;46}47.spc__item:nth-child(2) .spc__patch {48 --spc-r: 2.5deg;49}50.spc__item:nth-child(3) .spc__patch {51 --spc-r: -1.5deg;52}53.spc__patch::before {54 content: "";55 position: absolute;56 inset: 6px;57 border: 2px dashed rgba(233,169,74,.45);58 border-radius: 6px;59 transition: border-color .3s;60}61.spc__patch svg {62 width: 44px;63 height: 44px;64 fill: none;65 stroke: #e9a94a;66 stroke-width: 3;67 stroke-dasharray: 4 3;68 stroke-linecap: round;69 stroke-linejoin: round;70 clip-path: inset(0 100% 0 0);71 transition: clip-path .5s steps(8,end);72 filter: drop-shadow(0 1px 0 rgba(0,0,0,.6));73}74.spc__lbl {75 font-size: 12px;76 font-weight: 600;77 letter-spacing: .02em;78 transition: color .3s;79}80.spc__item:hover .spc__patch {81 transform: rotate(var(--spc-r,-2deg));82}83.spc__in:checked + .spc__patch {84 transform: translateY(-4px) rotate(var(--spc-r,-2deg));85 box-shadow: inset 0 0 0 1px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.12),0 14px 18px -8px rgba(0,0,0,.8);86}87.spc__in:checked + .spc__patch::before {88 border-color: rgba(233,169,74,.95);89}90.spc__in:checked + .spc__patch svg {91 clip-path: inset(0 0 0 0);92}93.spc__in:checked ~ .spc__lbl {94 color: #e9a94a;95}96.spc__in:focus-visible + .spc__patch {97 outline: 2px solid #e9a94a;98 outline-offset: 4px;99}100@media (prefers-reduced-motion:reduce) {101 .spc__patch,.spc__patch svg {102 transition: none;103 }104}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* * Author: @codepeek * License: MIT * Tags: #checkbox #dark #playful #svg #tactile */
.spc {
width: 300px;
font-family: system-ui,-apple-system,"Segoe UI",sans-serif;
color: #d9d2c4;
}
.spc__title {
margin: 0 0 16px;
font: 600 11px ui-monospace,SFMono-Regular,Menlo,monospace;
letter-spacing: .14em;
text-transform: uppercase;
color: #8f887b;
}
.spc__grid {
display: flex;
justify-content: space-between;
}
.spc__item {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
width: 86px;
cursor: pointer;
}
.spc__in {
position: absolute;
top: 0;
left: 0;
width: 1px;
height: 1px;
margin: 0;
opacity: 0;
}
.spc__patch {
position: relative;
display: grid;
place-items: center;
width: 78px;
height: 78px;
border-radius: 10px;
background: repeating-linear-gradient(45deg,rgba(255,255,255,.07) 0 1px,transparent 1px 3px),repeating-linear-gradient(-45deg,rgba(0,0,0,.2) 0 1px,transparent 1px 4px),linear-gradient(160deg,#3e5a7a,#22344a);
box-shadow: inset 0 0 0 1px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.12),0 6px 12px -4px rgba(0,0,0,.7);
transition: transform .35s cubic-bezier(.3,1.6,.5,1),box-shadow .35s;
}
.spc__item:nth-child(2) .spc__patch {
--spc-r: 2.5deg;
}
.spc__item:nth-child(3) .spc__patch {
--spc-r: -1.5deg;
}
.spc__patch::before {
content: "";
position: absolute;
inset: 6px;
border: 2px dashed rgba(233,169,74,.45);
border-radius: 6px;
transition: border-color .3s;
}
.spc__patch svg {
width: 44px;
height: 44px;
fill: none;
stroke: #e9a94a;
stroke-width: 3;
stroke-dasharray: 4 3;
stroke-linecap: round;
stroke-linejoin: round;
clip-path: inset(0 100% 0 0);
transition: clip-path .5s steps(8,end);
filter: drop-shadow(0 1px 0 rgba(0,0,0,.6));
}
.spc__lbl {
font-size: 12px;
font-weight: 600;
letter-spacing: .02em;
transition: color .3s;
}
.spc__item:hover .spc__patch {
transform: rotate(var(--spc-r,-2deg));
}
.spc__in:checked + .spc__patch {
transform: translateY(-4px) rotate(var(--spc-r,-2deg));
box-shadow: inset 0 0 0 1px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.12),0 14px 18px -8px rgba(0,0,0,.8);
}
.spc__in:checked + .spc__patch::before {
border-color: rgba(233,169,74,.95);
}
.spc__in:checked + .spc__patch svg {
clip-path: inset(0 0 0 0);
}
.spc__in:checked ~ .spc__lbl {
color: #e9a94a;
}
.spc__in:focus-visible + .spc__patch {
outline: 2px solid #e9a94a;
outline-offset: 4px;
}
@media (prefers-reduced-motion:reduce) {
.spc__patch,.spc__patch svg {
transition: none;
}
}Changes made here are only a live preview and will not be saved.
Save to GitHub
GitHub opens a new file in your repository with this element filled in. Review it there and press Commit changes. Nothing is sent from codepeek and no GitHub access is needed.
◉ 1 views
Build it with AIA ready prompt with the code, the credit and how to adapt it to your project.
A workshop QC row of stitched denim patches; checking one lifts the patch and sews a dashed amber tick across it stitch by stitch using steps().
Choose where to donate
Select a platform to continue.
Community
Comments 0
Code copied
SUPPORT THE CREATOR
Would you like to donate to the creator to help them keep creating content?
You need to sign in before you can write a comment.