Skip to content

Commit

Permalink
Date / date range (flatpickr) colors customization
Browse files Browse the repository at this point in the history
  • Loading branch information
jibees committed Sep 11, 2023
1 parent 3988da1 commit b8ef919
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/webpacker/css/admin_v3/components/date-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ input.datetimepicker {
.container input[readonly].flatpickr-input,
.container input[readonly].datepicker,
.container input[readonly].datetimepicker {
background-color: $white;
background-color: $lighter-grey;
cursor: pointer;
}

Expand Down
23 changes: 22 additions & 1 deletion app/webpacker/css/admin_v3/plugins/flatpickr-customization.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$background-grey: #eceef1;
$background-grey: $lighter-grey;
$background-blue: $color-3;

// scss-lint:disable SelectorFormat
Expand Down Expand Up @@ -33,6 +33,7 @@ $background-blue: $color-3;

.flatpickr-weekday {
background: $background-blue;
color: white;
}
}

Expand Down Expand Up @@ -66,3 +67,23 @@ $background-blue: $color-3;
justify-content: space-between;
flex-grow: 1;
}

// material-ui colors customization ("~flatpickr/dist/themes/material_blue")
.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n + 1)),
.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n + 1)),
.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n + 1)) {
box-shadow: -10px 0 0 #e2e2e2;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months #admin-menu ul li.selected a.flatpickr-prev-month svg,
#admin-menu ul li.selected .flatpickr-months a.flatpickr-prev-month svg,
.flatpickr-months #sub-menu ul li.selected a.flatpickr-prev-month svg,
#sub-menu ul li.selected .flatpickr-months a.flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month:hover svg,
.flatpickr-months #admin-menu ul li.selected a.flatpickr-next-month svg,
#admin-menu ul li.selected .flatpickr-months a.flatpickr-next-month svg,
.flatpickr-months #sub-menu ul li.selected a.flatpickr-next-month svg,
#sub-menu ul li.selected .flatpickr-months a.flatpickr-next-month svg {
fill: white;
}

0 comments on commit b8ef919

Please sign in to comment.