Skip to content

Commit

Permalink
[MOV] web, calendar: move common scss into web
Browse files Browse the repository at this point in the history
Prior to this commit, some of the main styles related to event elements
in calendars were set in the Calendar module.
This created layout issues when we installed independent modules without
installing the Calendar module (eg. `planning` or `hr_payroll`).

To fix that, this commit moves the necessary styles into `web`.

task-3617329
Part of task-3575827

X-original-commit: 2b967b5
Part-of: odoo#159317
  • Loading branch information
Brieuc-brd committed Mar 27, 2024
1 parent 992b113 commit 5b22e1d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 35 deletions.
36 changes: 1 addition & 35 deletions addons/calendar/static/src/scss/calendar.scss
Expand Up @@ -26,13 +26,11 @@

.o_calendar_renderer .fc-event {
&:not(.o_event_dot) {
--o-overlay-opacity: .5;

&.o_attendee_status_active {
--o-bg-opacity: 1;
}

&.o_attendee_status_tentative, &.o_event_hatched {
&.o_attendee_status_tentative {
--o-bg-opacity: .5;
}

Expand All @@ -47,22 +45,6 @@
}

&.o_event_dot {
--o-overlay-opacity: .25;

display: flex;
align-items: center;
gap: map-get($spacers, 1 );
border: none;
background-color: rgba(var(--o-event-bg--subtle-rgb), var(--o-bg-opacity));

&:before {
z-index: 2;
display: inline-block;
font-family: Fontawesome;
color: var(--o-event-bg, #{$info});
content: '\f111'; // fa-circle
}

&.o_attendee_status_needsAction, &.o_event_hatched {
&:before {
content: "\f1db"; // fa-circle-thin
Expand All @@ -80,10 +62,6 @@
&.o_attendee_status_alone {
content: "\f06a"; // fa-exclamation-circle
}

&:hover {
--o-bg-opacity: 1;
}
}

&.o_attendee_status_declined, &.o_event_striked {
Expand All @@ -92,15 +70,3 @@
}
}
}

@for $-i from 1 through length($o-colors-complete) {
$-color: nth($o-colors-complete, $-i);
$-color-subtle: mix($o-white, $-color, 85%);

.o_calendar_renderer .fc-event.o_calendar_color_#{$-i - 1} {
--o-event-bg: #{$-color};
--o-event-bg-rgb: #{to-rgb($-color)};
--o-event-bg--subtle: #{$-color-subtle};
--o-event-bg--subtle-rgb: #{to-rgb($-color-subtle)};
}
}
39 changes: 39 additions & 0 deletions addons/web/static/src/views/calendar/calendar_renderer.scss
Expand Up @@ -89,6 +89,34 @@
}
}
}

&:not(.o_event_dot) {
--o-overlay-opacity: .5;

&.o_event_hatched {
--o-bg-opacity: .5;
}
}

&.o_event_dot {
--o-overlay-opacity: .25;

display: flex;
align-items: center;
gap: map-get($spacers, 1);
border: none;

&:before {
z-index: 2;
display: inline-block;
font-family: Fontawesome;
content: '\f111'; // fa-circle
}

&:hover {
--o-bg-opacity: 1;
}
}
}

// Reset all link (A tag) the normal color (to override Bootstrap rule)
Expand Down Expand Up @@ -602,6 +630,9 @@
.o_calendar_renderer .fc-view {
.o_calendar_color_#{$i - 1} {
--fc-event-bg-color: #{$color-subtle};
--o-event-bg: #{$color};
--o-event-bg--subtle-rgb: #{to-rgb($color-subtle)};

&.fc-bg-event {
--fc-bg-event-color: #{$color-subtle};
}
Expand All @@ -627,6 +658,14 @@
--fc-event-text-color: #{color-contrast($color-subtle)};
--fc-event-border-color: #{tint-color($color, 50%)};
}

&.o_event_dot {
background-color: rgba(var(--o-event-bg--subtle-rgb), var(--o-bg-opacity));

&:before {
color: var(--o-event-bg, #{$info});
}
}
}
}

Expand Down

0 comments on commit 5b22e1d

Please sign in to comment.