fix(accessibility): Make darkmode have sufficient contrast

This commit is contained in:
2025-06-24 13:47:24 +02:00
parent 2330542a85
commit ae2ac5c462

View File

@@ -2,7 +2,7 @@ $primary: #6CD4FF;
$link: #292a2c; $link: #292a2c;
$grey-light: #c4c6ce; $grey-light: #c4c6ce;
$grey-dark: #262728; $grey-dark: #262728;
$confirm: hsl(133deg ,100%,calc(41% + 0%)); $confirm: hsl(133deg, 100%, calc(41% + 0%));
// Path to Bulma's sass folder // Path to Bulma's sass folder
@use "bulma/sass" with ( @use "bulma/sass" with (
@@ -15,21 +15,37 @@ $confirm: hsl(133deg ,100%,calc(41% + 0%));
$input-shadow: none $input-shadow: none
); );
@use "bulma/sass/utilities/css-variables" as cv;
@include cv.system-theme($name: "dark") {
.navbar-item > img {
background-color: $grey-light !important;
border-radius: 5px;
}
.card-header {
background-color: $grey-dark;
}
.tag {
color: $grey-dark;
background-color: $grey-light;
}
}
// General Styles // General Styles
.content { .content {
margin: auto; margin: auto;
max-width: 80em; max-width: 80em;
padding: 10px; padding: 10px;
} }
p > a { p > a {
text-decoration: underline; text-decoration: underline;
} }
p > a.button { p > a.button {
text-decoration: none; text-decoration: none;
} }
// Cards // Cards
@@ -42,70 +58,70 @@ p > a.button {
// Search form suggestion dropdown // Search form suggestion dropdown
#location-result-list { #location-result-list {
display: inline; //ensures that the dropdown is not restricted in width WTF display: inline; //ensures that the dropdown is not restricted in width WTF
} }
.result-item { .result-item {
cursor: pointer; cursor: pointer;
} }
.result-item:hover { .result-item:hover {
background-color: #b2aaaa; background-color: #b2aaaa;
} }
// Toggle switch // Toggle switch
.toggle-switch { .toggle-switch {
display: inline-block; display: inline-block;
background: #ccc; background: #ccc;
border-radius: 16px; border-radius: 16px;
width: 58px; width: 58px;
height: 32px; height: 32px;
position: relative; position: relative;
vertical-align: middle; vertical-align: middle;
transition: background 0.25s; transition: background 0.25s;
} }
.toggle-switch:before, .toggle-switch:after { .toggle-switch:before, .toggle-switch:after {
content: ""; content: "";
} }
.toggle-switch:before { .toggle-switch:before {
display: block; display: block;
background: linear-gradient(to bottom, #fff 0%, #eee 100%); background: linear-gradient(to bottom, #fff 0%, #eee 100%);
border-radius: 50%; border-radius: 50%;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
width: 24px; width: 24px;
height: 24px; height: 24px;
position: absolute; position: absolute;
top: 4px; top: 4px;
left: 4px; left: 4px;
transition: left 0.25s; transition: left 0.25s;
} }
.toggle:hover .toggle-switch:before { .toggle:hover .toggle-switch:before {
background: linear-gradient(to bottom, #fff 0%, #fff 100%); background: linear-gradient(to bottom, #fff 0%, #fff 100%);
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
} }
.checked + .toggle-switch { .checked + .toggle-switch {
background: #56c080; background: #56c080;
} }
.checked + .toggle-switch:before { .checked + .toggle-switch:before {
left: 30px; left: 30px;
} }
.toggle-checkbox { .toggle-checkbox {
position: absolute; position: absolute;
visibility: hidden; visibility: hidden;
} }
.slider-label { .slider-label {
margin-left: 5px; margin-left: 5px;
position: relative; position: relative;
top: 2px; top: 2px;
} }
@@ -113,18 +129,21 @@ p > a.button {
.card-footer { .card-footer {
overflow: hidden; overflow: hidden;
} }
.card-footer .card-footer-item.is-confirm { .card-footer .card-footer-item.is-confirm {
background-color: $confirm; background-color: $confirm;
} }
.card-footer .card-footer-item.is-confirm:hover { .card-footer .card-footer-item.is-confirm:hover {
filter: brightness(0.9); filter: brightness(0.9);
} }
.card-footer .card-footer-item.is-danger { .card-footer .card-footer-item.is-danger {
background-color: sass.$danger; background-color: sass.$danger;
} }
.card-footer .card-footer-item.is-danger:hover { .card-footer .card-footer-item.is-danger:hover {
filter: brightness(0.9); filter: brightness(0.9);
} }
/*******/ /*******/
@@ -132,55 +151,55 @@ p > a.button {
/*******/ /*******/
.map { .map {
border-radius: 8px; border-radius: 8px;
width: 100%; width: 100%;
height: 100% height: 100%
} }
.marker { .marker {
background-image: url('../img/logo_transparent.png'); background-image: url('../img/logo_transparent.png');
background-size: cover; background-size: cover;
width: 50px; width: 50px;
height: 50px; height: 50px;
cursor: pointer; cursor: pointer;
} }
.animal-shelter-marker { .animal-shelter-marker {
background-image: url('../img/animal_shelter.png'); background-image: url('../img/animal_shelter.png');
} }
.map-in-content #map { .map-in-content #map {
max-height: 500px; max-height: 500px;
width: 90%; width: 90%;
} }
@media only screen and (min-width: 768px) { @media only screen and (min-width: 768px) {
.maplibregl-popup { .maplibregl-popup {
max-width: 280px !important; max-width: 280px !important;
} }
} }
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {
.maplibregl-popup { .maplibregl-popup {
max-width: 150px !important; max-width: 150px !important;
} }
} }
.maplibregl-popup-close-button { .maplibregl-popup-close-button {
all: unset; /* Remove all inherited styles */ all: unset; /* Remove all inherited styles */
font-size: 1.2rem; font-size: 1.2rem;
background: none; background: none;
border: none; border: none;
color: black; color: black;
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
top: 0.25rem; top: 0.25rem;
right: 0.5rem; right: 0.5rem;
padding: 0.25rem; padding: 0.25rem;
} }
.popup-content { .popup-content {
line-height: 1.4; line-height: 1.4;
} }
@@ -189,28 +208,28 @@ IMAGES
*****/ *****/
.gallery .main-photo img { .gallery .main-photo img {
width: 100%; width: 100%;
height: 150px; height: 150px;
object-fit: cover; /* Crops the images */ object-fit: cover; /* Crops the images */
border-radius: 6px; border-radius: 6px;
} }
.thumbnail-row { .thumbnail-row {
display: flex; display: flex;
gap: 10px; gap: 10px;
margin-top: 10px; margin-top: 10px;
} }
.thumbnail img { .thumbnail img {
width: 100%; width: 100%;
height: 50px; height: 50px;
object-fit: cover; /* Crops the images */ object-fit: cover; /* Crops the images */
border-radius: 4px; border-radius: 4px;
} }
/* Ensure each thumbnail takes equal width */ /* Ensure each thumbnail takes equal width */
.thumbnail { .thumbnail {
flex: 1; flex: 1;
} }
@@ -219,8 +238,8 @@ AN Cards
*/ */
.an-card { .an-card {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }