From 50a513d144760d38b326ed3dad4fcc0ec429f5c0 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 22 Oct 2019 20:19:13 +0100 Subject: [PATCH] Add custom checkbox styles --- src/styles/_base.scss | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/src/styles/_base.scss b/src/styles/_base.scss index 5183339..eb0a79a 100644 --- a/src/styles/_base.scss +++ b/src/styles/_base.scss @@ -31,6 +31,43 @@ ul { list-style: inside; } +input[type="checkbox"] { + appearance: none; + cursor: pointer; + position: relative; + vertical-align: bottom; + + &::before { + border: 2px solid var(--color-primary); + border-radius: 4px; + content: ""; + display: block; + height: 16px; + width: 16px; + } + + &:checked::before { + background: var(--color-primary); + } + + &:checked::after { + border-bottom: 2px solid var(--color-primary-text); + border-right: 2px solid var(--color-primary-text); + content: ""; + display: inline-block; + height: 10px; + left: 7px; + position: absolute; + top: 3px; + transform: rotate(45deg); + width: 4px; + } + + & + label { + cursor: pointer; + } +} + pre { background: #000; border-radius: 3px; @@ -215,11 +252,6 @@ pre { &:hover { background: rgba(0, 0, 0, 0.1); } - - input[type=checkbox] { - position: relative; - top: 2px; - } } }