scrimba
Note at 1:09
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Note at 1:09
AboutCommentsNotes
Note at 1:09
Expand for more info
index.css
run
preview
console
:root {
--wine-red: #c7375f;
--bright-red: #d42d2f;
--dark-green: #344d2f;
--light-green: #77a047;
--gold: #fac57d;
--snow: #f0f4f7;
}

html,
body {
margin: 0;
padding: 0;
}

body {
font-family: 'Roboto', sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
text-align: center;
color: var(--snow);
background-color: var(--bright-red);
background-image: url('background-image.jpg');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}

.checklist {
position: relative;
background: var(--snow);
color: var(--dark-green);
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
min-width: 200px;
min-height: 200px;
max-width: 5ch;
padding: 1em 2em;
border-radius: 5px;
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px,
rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
}

.checklist-item {
margin: 0.5em;
width: 100%;
text-align: left;
letter-spacing: 0.5px;
display: grid;
grid-template-columns: 1em auto;
gap: 0.5em;
}

.checklist-item + .checklist-item {
margin-top: 1em;
}

input[type='checkbox'] {
-webkit-appearance: none;
appearance: none;
background-color: var(--snow);
margin: 0;
color: var(--gold);
width: 1.15em;
height: 1.15em;
border: 0.15em solid var(--gold);
border-radius: 0.15em;
transform: translateY(-0.075em);
display: grid;
place-content: center;
}

input[type='checkbox']::before {
content: '';
width: 0.65em;
height: 0.65em;
transform: scale(0);
transition: 120ms transform ease-in-out;
box-shadow: inset 1em 1em var(--light-green);
transform-origin: bottom left;
clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type='checkbox']:checked::before {
transform: scale(1);
}

input[type='checkbox']:checked + label.strikethrough span {
text-decoration: line-through;
font-weight: 400;
}

/* Task:
- Write the CSS to create custom checkboxes for our shopping list.

Stretch goals:
- Add a different random check for each item.
- Use JavaScript to match the custom check to the item listed, e.g. socks would have socks as the checkmark. */
Console
/index.html
LIVE