Skip to content

feat: make colors configurable with cookies #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
44f13ae
refactor: replace scss `$primary` with css variable
BGruenberg Mar 28, 2025
a1c1d7e
feat: add `CookieService`
BGruenberg Apr 14, 2025
7ad1614
refactor: move `$colors` declaration to its own file
BGruenberg Apr 14, 2025
eabfd65
refactor: set fallback value for `$primary`
BGruenberg Apr 14, 2025
d9e31f8
refactor: replace `$secondary`
BGruenberg Apr 14, 2025
70ed86a
refactor: replace `$light-gray`
BGruenberg Apr 14, 2025
f214343
refactor: replace `$medium-gray`
BGruenberg Apr 14, 2025
d93fea3
refactor: replace `$dark-gray`
BGruenberg Apr 14, 2025
18b453c
refactor: replace `$s-h-blue`
BGruenberg Apr 14, 2025
da4d8c5
refactor: replace `$s-h-blue-15`
BGruenberg Apr 14, 2025
28a8391
refactor: replace `$danger`
BGruenberg Apr 14, 2025
92ab707
refactor: remove unused colors
BGruenberg Apr 14, 2025
64e4ffb
refactor: replace `$footer-text-color`
BGruenberg Apr 14, 2025
4c88190
refactor: replace `$stepperLine` with `$medium-gray`
BGruenberg Apr 14, 2025
6e81819
refactor: replace `$primary-background-color`
BGruenberg Apr 14, 2025
d26857f
refactor: replace `$toolbar-background-color`
BGruenberg Apr 14, 2025
3c02225
refactor: remove unused bootstrap checkbox variables
BGruenberg Apr 14, 2025
8f20c8d
feat: add colors
BGruenberg Apr 14, 2025
38077e5
refactor: remove logging calls
BGruenberg Apr 14, 2025
70a5e61
refactor: use CSS variables for inheriting colors
BGruenberg Apr 15, 2025
76a8b24
fix: colors not being written to styles
BGruenberg Apr 15, 2025
f792e7a
refactor: rename `s-h-blue` -> `focus-border`
BGruenberg May 2, 2025
f5da7ef
refactor: rename `s-h-blue-15` -> `toolbar-background-color`
BGruenberg May 2, 2025
1669168
refactor: remove unused color `s-h-blue-50`
BGruenberg May 2, 2025
d62a652
refactor: rename `s-h-light-blue` -> `primary-background-color`
BGruenberg May 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/admin-dashboard/admin-dashboard.component.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "src/default";

span {
color: $primary;
color: var(--primary, #{$primary});
text-decoration: underline;
cursor: pointer;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
}

#main {
background-color: $primary-background-color;
background-color: var(--primary-background-color, #{$primary-background-color});
}

#bottom-edge {
height: $spacer*7;
min-height: $spacer*7;
max-height: $spacer*7;
margin-bottom: $spacer;
background: linear-gradient(175deg, $primary-background-color 49.5%, transparent 50.5%) no-repeat bottom;
background: linear-gradient(175deg, var(--primary-background-color, #{$primary-background-color}) 49.5%, transparent 50.5%) no-repeat bottom;
}

@include media-breakpoint-up(lg) {
Expand Down
4 changes: 4 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {Title} from '@angular/platform-browser';
import {LocalStorageService} from './shared/services/data-service/local-storage.service';
import {LocaleService} from './shared/services/locale/locale.service';
import {NullableUtils} from "./shared/utils";
import {CookieService} from "./shared/services/cookie.service";

@Component({
selector: 'app-root',
Expand All @@ -23,6 +24,7 @@ export class AppComponent implements OnInit {
private logger: Logger,
private titleService: Title,
private localStorageService: LocalStorageService,
private cookieService: CookieService,
) {
}

Expand All @@ -40,5 +42,7 @@ export class AppComponent implements OnInit {
this.connectionError = true;
}
});

this.cookieService.replaceCSSColorsFromCookies();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ form {
}

.section-container .input-group .form-control {
border: 1px solid $medium-gray !important;
border: 1px solid var(--medium-gray, #{$medium-gray}) !important;
border-radius: 0.5em !important;
border-top-left-radius: 0 !important;
border-bottom-left-radius: 0 !important;
}

.btn-with-image.btn-add-suggested-date, .btn-with-image.btn-suggested-date-end-at-different-day {
color: $primary;
color: var(--primary, #{$primary});;
background-size: $height-icon * 0.8 $width-icon * 0.8;
@include media-breakpoint-up(lg) {
background-size: $height-icon $width-icon;
Expand Down Expand Up @@ -92,7 +92,7 @@ form {
}
}

$input-background-color: $light-gray;
$input-background-color: var(--light-gray, #{$light-gray});

.input-group-prepend {
background-color: $input-background-color !important;
Expand Down Expand Up @@ -190,7 +190,7 @@ input {
//noinspection CssUnusedSymbol
.suggested-date-timepicker-start button.btn-timepicker:active {
background-origin: border-box;
color: $primary;
color: var(--primary, #{$primary});
font-weight: bold;
border-radius: $border-radius;
border: 1px solid $border-color-input;
Expand Down
2 changes: 1 addition & 1 deletion src/app/home/home.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ label[for="title"] {
#btn-submit {
display: flex;
color: $btn-text;
background: $secondary;
background: var(--secondary, #{$secondary});
background-origin: content-box;
background-size: $form-icon-width * 0.6 $form-icon-height * 0.6;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion src/app/juristic/imprint/imprint.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}

.content h1 > a {
color: $primary;
color: var(--primary, #{$primary});
display: inline;
text-align: center;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/juristic/privacy/privacy.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ content h1 {
}

content h1 > a {
color: $primary;
color: var(--primary, #{$primary});
display: inline;
text-align: center;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ content h1 {
}

content h1 > a {
color: $primary;
color: var(--primary, #{$primary});
display: inline;
text-align: center;
}
Expand Down
8 changes: 4 additions & 4 deletions src/app/links/links.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $icon-height: 30px;
.link-container {
border: 1px solid $circle-tag-border-color;
border-radius: 0.5rem;
background-color: $light-gray;
background-color: var(--light-gray, #{$light-gray});
}

.btn {
Expand All @@ -42,13 +42,13 @@ $icon-height: 30px;
}

.btn-transparent:hover {
background-color: $medium-gray;
border-color: $medium-gray;
background-color: var(--medium-gray, #{$medium-gray});
border-color: var(--medium-gray, #{$medium-gray});
}

a.link-with-image {
display: flex;
color: $primary;
color: var(--primary, #{$primary});
padding-left: 6px;
border: 0;

Expand Down
6 changes: 3 additions & 3 deletions src/app/password/password.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
.input-group button {
background-color: white;
border-radius: 0 .5rem .5rem 0;
border-color: $primary-background-color !important;
border-color: var(--primary-background-color, #{$primary-background-color}) !important;

&:focus {
border-color: $s-h-blue !important;
border-color: var(--focus-border, #{$focus-border}) !important;
}
}

.btn-submit {
display: flex;
color: $btn-text;
background: $secondary;
background: var(--secondary, #{$secondary});
background-origin: content-box;
background-size: $form-icon-width * 0.6 $form-icon-height * 0.6;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion src/app/poll/mobile-poll-table.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ select {
}

.toolbar {
background-color: $s-h-blue-15;
background-color: var(--toolbar-background-color, #{$toolbar-background-color}) ;
min-height: 50px;
}

Expand Down
20 changes: 10 additions & 10 deletions src/app/poll/poll.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ tfoot tr:last-child td {
}

.toolbar {
background-color: $toolbar-background-color;
background-color: var(--toolbar-background-color, #{$toolbar-background-color});
}

.divider {
Expand Down Expand Up @@ -136,8 +136,8 @@ button.btn-trash {
@include focus-outline;

:hover {
background-color: $medium-gray;
border-color: $medium-gray;
background-color: var(--medium-gray, #{$medium-gray});
border-color: var(--medium-gray, #{$medium-gray});
}
}

Expand Down Expand Up @@ -276,13 +276,13 @@ button.btn-with-image {

$poll-data-cell-invalid-message-min-height: 24px;
.poll-add-user-row, .poll-edit-user-row, .table-hover tbody tr.poll-add-user-row:hover {
background-color: $toolbar-background-color !important;
background-color: var(--toolbar-background-color, #{$toolbar-background-color}) !important;

.poll-data-cell {
width: 350px;

&.name {
background: $toolbar-background-color !important;
background: var(--toolbar-background-color, #{$toolbar-background-color}) !important;
}

.invalid-message {
Expand Down Expand Up @@ -311,9 +311,9 @@ $poll-data-cell-invalid-message-min-height: 24px;
}

.form-control {
color: $primary;
border-color: $medium-gray;
background-color: $light-gray;
color: var(--primary, #{$primary});
border-color: var(--medium-gray, #{$medium-gray});
background-color: var(--light-gray, #{$light-gray});
}

}
Expand Down Expand Up @@ -342,8 +342,8 @@ $poll-data-cell-invalid-message-min-height: 24px;
@include media-breakpoint-up(lg) {
font-size: $font-size-medium;
}
color: $danger;
border: 2px solid $danger;
color: var(--danger, #{$danger});
border: 2px solid var(--danger, #{$danger});
background-color: transparent;
border-radius: 0;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "src/default";

* {
color: $danger;
color: var(--danger, #{$danger});
font-weight: $font-weight-normal;
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
@import "src/default";
@import 'bootstrap/scss/mixins';

#url {
color: $primary;
}

#name {
color: $primary;
}

#title {
color: $primary;
}

#url,
#name,
#title,
#location {
color: $primary;
color: var(--primary, #{$primary});
}

img.icon {
Expand All @@ -23,7 +14,7 @@ img.icon {
}

.header {
color: $primary;
color: var(--primary, #{$primary});
font-size: $font-size-small-mobile;
@include media-breakpoint-up(lg) {
font-size: $font-size-small;
Expand All @@ -50,7 +41,7 @@ img.icon {
}

#description {
color: $primary;
color: var(--primary, #{$primary});
position: relative;
text-align: justify;
padding-right: 1em;
Expand Down
6 changes: 3 additions & 3 deletions src/app/shared/components/combobox/combobox.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
overflow-y: auto;

background-color: white;
border: 1px solid $dark-gray;
border: 1px solid var(--dark-gray, #{$dark-gray});
border-radius: .5rem;
}

Expand All @@ -58,13 +58,13 @@
}

&.option-current {
outline: lighten($primary, 10%) solid 0.15rem !important;
outline: var(--primary-lighter-10) solid 0.15rem !important;
outline-offset: -.15rem;
border-radius: .5rem;
}

&[aria-selected="true"] {
background-color: $light-gray;
background-color: var(--light-gray, #{$light-gray});
padding-right: 30px;
position: relative;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "src/default.scss";

.date-time-overview table {
color: $primary;
color: var(--primary, #{$primary});

th {
min-width: $suggested-date-desktop-min-width;
Expand Down
14 changes: 7 additions & 7 deletions src/app/shared/components/footer/footer.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
@import 'bootstrap/scss/mixins';

#email {
color: $secondary;
color: var(--secondary, #{$secondary});
}

#contact {
display: block;
text-align: center;
width: 100%;
color: $footer-text-color;
color: var(--footer-text-color, #{$footer-text-color});
margin-bottom: 8px;
}

Expand All @@ -26,11 +26,11 @@
}

#contact > a {
color: $secondary;
color: var(--secondary, #{$secondary});
}

#contact > a:hover {
color: $secondary;
color: var(--secondary, #{$secondary});
text-decoration: underline;
}

Expand All @@ -39,12 +39,12 @@
text-align: center;
width: 100%;
padding: 0 4px 0 4px;
color: $footer-text-color;
color: var(--footer-text-color, #{$footer-text-color});
margin-bottom: 8px;
font-size: $font-size-small-mobile;

a {
color: $footer-text-color;
color: var(--footer-text-color, #{$footer-text-color});
}

@include media-breakpoint-up(lg) {
Expand Down Expand Up @@ -82,7 +82,7 @@
@include media-breakpoint-up(lg) {
font-size: $font-size-small;
}
color: $dark-gray;
color: var(--dark-gray, #{$dark-gray});
margin: 0 4px 0 4px;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

// better contrast
.mejs__controls:not([style*="display: none"]) {
background: $light-gray;
background: var(--light-gray, #{$light-gray});
}

svg {
Expand Down
Loading
Loading