Migrate to bulma-css-variables and introduce dark mode #954
|
@ -82,11 +82,11 @@ export default {
|
|||
font-size: 0.85rem;
|
||||
font-weight: bold;
|
||||
height: $button-height;
|
||||
box-shadow: $shadow-sm;
|
||||
box-shadow: var(--shadow-sm);
|
||||
|
||||
&.is-hovered,
|
||||
&:hover {
|
||||
box-shadow: $shadow-md;
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
&.fullheight {
|
||||
|
@ -99,7 +99,7 @@ export default {
|
|||
&:active,
|
||||
&:focus,
|
||||
&:focus:not(:active) {
|
||||
box-shadow: $shadow-xs !important;
|
||||
box-shadow: var(--shadow-xs) !important;
|
||||
}
|
||||
|
||||
&.is-primary.is-outlined:hover {
|
||||
|
|
|
@ -90,7 +90,7 @@ export default {
|
|||
margin: 0 $list-spacing $list-spacing 0;
|
||||
padding: 1rem;
|
||||
border-radius: $radius;
|
||||
box-shadow: $shadow-sm;
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition: box-shadow $transition;
|
||||
|
||||
display: flex;
|
||||
|
@ -98,13 +98,13 @@ export default {
|
|||
flex-wrap: wrap;
|
||||
|
||||
&:hover {
|
||||
box-shadow: $shadow-md;
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
&:active,
|
||||
&:focus,
|
||||
&:focus:not(:active) {
|
||||
box-shadow: $shadow-xs !important;
|
||||
box-shadow: var(--shadow-xs) !important;
|
||||
}
|
||||
|
||||
@media screen and (min-width: $widescreen) {
|
||||
|
|
|
@ -61,7 +61,7 @@ export default {
|
|||
border-radius: $radius;
|
||||
margin-bottom: 1rem;
|
||||
border: 1px solid var(--grey-200);
|
||||
box-shadow: $shadow-sm;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
|
|
|
@ -162,7 +162,7 @@ export default {
|
|||
max-width: calc(100vw - 2rem);
|
||||
padding: .75rem .25rem;
|
||||
border-radius: $radius;
|
||||
box-shadow: $shadow-sm;
|
||||
box-shadow: var(--shadow-sm);
|
||||
font-size: .85rem;
|
||||
|
||||
@media screen and (max-width: $tablet) {
|
||||
|
|
|
@ -339,14 +339,14 @@ export default {
|
|||
width: 100%;
|
||||
font-size: 5rem;
|
||||
height: auto;
|
||||
text-shadow: $shadow-md;
|
||||
text-shadow: var(--shadow-md);
|
||||
animation: bounce 2s infinite;
|
||||
}
|
||||
|
||||
.hint {
|
||||
margin: .5rem auto 2rem;
|
||||
border-radius: 2px;
|
||||
box-shadow: $shadow-md;
|
||||
box-shadow: var(--shadow-md);
|
||||
background: var(--primary);
|
||||
padding: 1rem;
|
||||
color: var(--white);
|
||||
|
|
|
@ -148,7 +148,7 @@ $defer-task-max-width: 350px + 100px;
|
|||
color: var(--text);
|
||||
cursor: default;
|
||||
z-index: 10;
|
||||
box-shadow: $shadow-lg;
|
||||
box-shadow: var(--shadow-lg);
|
||||
|
||||
@media screen and (max-width: ($defer-task-max-width)) {
|
||||
left: .5rem;
|
||||
|
|
|
@ -123,7 +123,7 @@ $task-background: var(--white);
|
|||
-webkit-touch-callout: none; // iOS Safari
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
box-shadow: $shadow-xs;
|
||||
box-shadow: var(--shadow-xs);
|
||||
display: block;
|
||||
border: 3px solid transparent;
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ button.table {
|
|||
}
|
||||
|
||||
.dropdown-menu .dropdown-content {
|
||||
box-shadow: $shadow-md;
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.is-strikethrough {
|
||||
|
@ -166,5 +166,5 @@ button.table {
|
|||
|
||||
.box {
|
||||
border: 1px solid var(--grey-200);
|
||||
box-shadow: $shadow-sm;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
adrinux marked this conversation as resolved
Outdated
|
||||
:root {
|
||||
/* Light mode colours in reverse order for dark mode */
|
||||
/* Light mode colours reversed for dark mode */
|
||||
--grey-900: hsl(210, 20%, 98%);
|
||||
--grey-800: hsl(220, 14.3%, 95.9%);
|
||||
--grey-700: hsl(220, 13%, 91%);
|
||||
|
@ -81,9 +81,11 @@
|
|||
--grey-500-hsl: 217.9, 10.6%, 64.9%;
|
||||
--grey-500: hsla(var(--grey-500-hsl), 1);
|
||||
--grey-400: hsl(220, 8.9%, 46.1%);
|
||||
--grey-300: hsl(215, 13.8%, 34.1%);
|
||||
--grey-300-hsl: 215, 13.8%, 34.1%;
|
||||
--grey-300: hsla(var(--grey-300-hsl), 1);
|
||||
--grey-200: hsl(216.9, 19.1%, 26.7%);
|
||||
--grey-100: hsl(215, 27.9%, 16.9%);
|
||||
--grey-100-hsl: 215, 27.9%, 16.9%;
|
||||
--grey-100: hsla(var(--grey-100-hsl), 1);
|
||||
--grey-50: hsl(220.9, 39.3%, 11%);
|
||||
|
||||
--white-l: 4% !important;
|
||||
|
|
|
@ -1,9 +1,26 @@
|
|||
$shadow-xs: 0 1px 3px hsla(var(--grey-500-hsl),.12),
|
||||
0 1px 2px hsla(var(--grey-500-hsl), .24);
|
||||
$shadow-sm: 0 3px 6px hsla(var(--grey-500-hsl), .12),
|
||||
0 2px 4px hsla(var(--grey-500-hsl), .10);
|
||||
$shadow-md: 0 10px 20px hsla(var(--grey-500-hsl), .12),
|
||||
0 3px 6px hsla(var(--grey-500-hsl), .08);
|
||||
$shadow-lg: 0 15px 25px hsla(var(--grey-500-hsl), .12),
|
||||
0 5px 10px hsla(var(--grey-500-hsl), .05);
|
||||
$shadow-xl: 0 20px 40px hsla(var(--grey-500-hsl), .2);
|
||||
:root {
|
||||
--shadow-xs: 0 1px 3px hsla(var(--grey-500-hsl),.12),
|
||||
0 1px 2px hsla(var(--grey-500-hsl), .24);
|
||||
--shadow-sm: 0 3px 6px hsla(var(--grey-500-hsl), .12),
|
||||
0 2px 4px hsla(var(--grey-500-hsl), .10);
|
||||
--shadow-md: 0 10px 20px hsla(var(--grey-500-hsl), .12),
|
||||
0 3px 6px hsla(var(--grey-500-hsl), .08);
|
||||
--shadow-lg: 0 15px 25px hsla(var(--grey-500-hsl), .12),
|
||||
0 5px 10px hsla(var(--grey-500-hsl), .05);
|
||||
// unused --shadow-xl: 0 20px 40px hsla(var(--grey-500-hsl), .2);
|
||||
adrinux marked this conversation as resolved
Outdated
dpschen
commented
good catch! good catch!
I think we should either remove it or uncomment it. Like this doesn't make sense (?).
adrinux
commented
The comment was to spark exactly this conversation :) It's not used. It's not overriding something declared by bulma. I vote for remove... The comment was to spark exactly this conversation :)
Should I remove it?
It's not used. It's not overriding something declared by bulma.
I vote for remove...
dpschen
commented
@konrad: do you remember the reason for shadow? @konrad: do you remember the reason for shadow?
konrad
commented
No real reason. When I added the shadows, I added a few variants to have a bit more flexibility. If it's not used anywhere I think it is fine to remove. No real reason. When I added the shadows, I added a few variants to have a bit more flexibility. If it's not used anywhere I think it is fine to remove.
adrinux
commented
Removed shadow-xl Removed shadow-xl https://kolaente.dev/adrinux/frontend/commit/92b2010cdc7912142105a401056ec200dd6356eb
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
adrinux marked this conversation as resolved
Outdated
dpschen
commented
Nest the Nest the `@media` so we don't need to repeat `:root`. (2)
adrinux
commented
Done Done https://kolaente.dev/adrinux/frontend/commit/a258b938fabdb69b30615897b157c37a020b4059
|
||||
/* Even darker shadows for dark mode */
|
||||
--shadow-xs: 0 1px 3px hsla(var(--grey-100-hsl),.12),
|
||||
0 1px 2px hsla(var(--grey-100-hsl), .24);
|
||||
--shadow-sm: 0 3px 6px hsla(var(--grey-100-hsl), .12),
|
||||
0 2px 4px hsla(var(--grey-100-hsl), .10);
|
||||
--shadow-md: 0 10px 20px hsla(var(--grey-100-hsl), .12),
|
||||
0 3px 6px hsla(var(--grey-100-hsl), .08);
|
||||
--shadow-lg: 0 15px 25px hsla(var(--grey-100-hsl), .12),
|
||||
0 5px 10px hsla(var(--grey-100-hsl), .05);
|
||||
// unused --shadow-xl: 0 20px 40px hsla(var(--grey-100-hsl), .2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ export default {
|
|||
display: inline-flex;
|
||||
border-radius: $radius;
|
||||
font-size: .75rem;
|
||||
box-shadow: $shadow-sm;
|
||||
box-shadow: var(--shadow-sm);
|
||||
height: $switch-view-height;
|
||||
margin-bottom: 1rem;
|
||||
padding: .5rem;
|
||||
|
@ -186,7 +186,7 @@ export default {
|
|||
&.is-active {
|
||||
background: var(--primary);
|
||||
font-weight: bold;
|
||||
box-shadow: $shadow-xs;
|
||||
box-shadow: var(--shadow-xs);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
|
Reference in New Issue
Block a user
Nest the
@media
so we don't need to repeat:root
.Good catch. Done
a258b938fa
Maybe it would make sense to group all dark scheme adjustments (and the base light versio) in separate stylesheets instead of seperating by color or shadows?
I think this is fine. Because we might need adjustments deep in components for dark mode either way.
I think it would be wrong to separate those styles from the components.
That's something I didn't think about. Makes sense.