Skip to content

Commit

Permalink
refactor CSS colours
Browse files Browse the repository at this point in the history
  • Loading branch information
Artemis21 committed Feb 13, 2024
1 parent 46334f4 commit fab2e5e
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 32 deletions.
28 changes: 28 additions & 0 deletions web/sass/_variables.sass
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
$body-width: min(500px, calc(100vw - 2rem))

$accent: #643A71
$fg: #000
$card-bg: #eee
$card-fg: #000
$good-bg: #0f04
$good-fg: #040
$bad-bg: #400f
$bad-fg: #400
$input-bg: #fff
$input-fg: #000
$scroll-thumb: #8888
$scroll-thumb-active: #666
$scroll-hint: #0006
$results-bg: #fff
$results-border: #aaa
$results-placeholder: #666
$track-unlocked: #aaa
$track-locked: #eee
$track-played: #5a5
$control-bg: #eee
$control-fg: #444
$control-disabled-fg: #666
$control-active-fg: #000
$primary-input-bg: #282
$primary-input-fg: #fff
$secondary-input-bg: #ccc
$secondary-input-fg: #000
18 changes: 9 additions & 9 deletions web/sass/card.sass
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
padding: 1rem
gap: 0.5rem 1rem
align-items: center
background: #eee
color: #000
background: $card-bg
color: $card-fg
margin: 0 2.5%
position: relative
transition: background 50ms linear
Expand Down Expand Up @@ -54,7 +54,7 @@
left: 0
bottom: 0
right: 0
border: 0px solid black
border: 0px solid $input-fg
border-radius: 1rem
transition: border-width 50ms linear
pointer-events: none
Expand Down Expand Up @@ -103,18 +103,18 @@
text-decoration: underline

.card--active
background: #fff
background: $input-bg

&:after
border-width: 4px

.card--good
background: #0f04
color: #040
background: $good-bg
color: $good-fg

.card--bad
background: #f004
color: #400
background: $bad-bg
color: $bad-fg

.card__progress
position: absolute
Expand All @@ -123,7 +123,7 @@
left: 0
border-radius: 1rem
pointer-events: none
background: #0002
background: $bad-bg

.card__icon
grid-area: thumb
Expand Down
18 changes: 9 additions & 9 deletions web/sass/forms.sass
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
.input
font: inherit
font-size: 1.2rem
border: 4px solid #000
border: 4px solid $input-fg
border-radius: 2rem
padding: 0.5rem 1rem
background: #fff
background: $input-bg
width: 100%

.search__results
Expand All @@ -33,11 +33,11 @@
.search__results__result, .search__results__placeholder
font: inherit
text-align: left
background: #fff
background: $results-bg
width: 100%
box-sizing: border-box
padding: 0.2rem 0.4rem
border: 1px solid #aaa
border: 1px solid $results-border

&:not(:last-child)
border-bottom-width: 0
Expand All @@ -46,7 +46,7 @@
cursor: pointer

.search__results__placeholder
color: #666
color: $results-placeholder
font-style: italic

.submit
Expand All @@ -55,9 +55,9 @@
border-radius: 2rem
padding: 0.5rem 1rem
cursor: pointer
background: #282
color: #fff
background: $primary-input-bg
color: $primary-input-fg

.submit--secondary
background: #ccc
color: #000
background: $secondary-input-bg
color: $secondary-input-fg
6 changes: 3 additions & 3 deletions web/sass/nav.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
align-items: center
gap: 1rem
padding: 0.5rem 1rem
border-bottom: 1px solid black
border-bottom: 1px solid $fg
box-sizing: border-box
width: $body-width

Expand All @@ -13,11 +13,11 @@
.nav__title
font-size: 1.5rem
font-weight: 900
color: black
color: $fg
text-decoration: none
cursor: pointer

.nav__icon
font-size: 1.5rem
cursor: pointer
color: #000
color: $fg
14 changes: 7 additions & 7 deletions web/sass/player.sass
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
height: 2rem

.play_bar__seg--unlocked
background: #aaa
background: $track-unlocked

.play_bar__seg--locked
background: #eee
background: $track-locked

.play_bar__seg__fill
background: #5a5
background: $track-played
height: 2rem

.controls
Expand All @@ -30,8 +30,8 @@
background: inherit
font: inherit
font-size: 2.5rem
background: #eee
color: #444
background: $control-bg
color: $control-fg
width: 2em
height: 2em
border-radius: 1em
Expand All @@ -44,10 +44,10 @@
font-size: 3rem

.control--disabled
color: #666
color: $control-disabled-fg

.control--enabled
cursor: pointer

&:hover
color: #000
color: $control-active-fg
8 changes: 4 additions & 4 deletions web/sass/scrollable.sass
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

&::-webkit-scrollbar-thumb
width: 18px
background: #8888
background: $scroll-thumb
border: 6px solid white
border-radius: 9px
background-clip: padding-box
&:hover
background: #666
background: $scroll-thumb-active

&:before, &:after
content: ""
Expand All @@ -31,11 +31,11 @@

&:before
top: 0
box-shadow: 0 0 20px 10px #0006
box-shadow: 0 0 20px 10px $scroll-hint

&:after
bottom: 0
box-shadow: 0 0 20px 10px #0006
box-shadow: 0 0 20px 10px $scroll-hint

.scrollable--scroll-up:before
opacity: 1
Expand Down

0 comments on commit fab2e5e

Please sign in to comment.