From ac0a57c82664a18befa26b16e51f8ffe2be31bb8 Mon Sep 17 00:00:00 2001 From: raviks789 Date: Wed, 26 Jun 2024 13:53:27 +0200 Subject: [PATCH] Change css class of .header to .time-grid-header in .timeline --- .../Notifications/Widget/Calendar/DayGrid.php | 2 +- .../Widget/Calendar/MonthGrid.php | 2 +- .../Widget/Calendar/WeekGrid.php | 2 +- .../Widget/TimeGrid/DaysHeader.php | 2 +- public/css/calendar.less | 11 ++------ public/css/common.less | 28 +++++++++++-------- public/css/timeline.less | 8 ++---- 7 files changed, 25 insertions(+), 30 deletions(-) diff --git a/library/Notifications/Widget/Calendar/DayGrid.php b/library/Notifications/Widget/Calendar/DayGrid.php index 4323c942..94a9e149 100644 --- a/library/Notifications/Widget/Calendar/DayGrid.php +++ b/library/Notifications/Widget/Calendar/DayGrid.php @@ -63,7 +63,7 @@ protected function createGridSteps(): Traversable protected function createHeader(): BaseHtmlElement { - $header = new HtmlElement('div', Attributes::create(['class' => 'header'])); + $header = new HtmlElement('div', Attributes::create(['class' => 'time-grid-header'])); $dayNames = [ 'Mon' => t('Mon', 'monday'), 'Tue' => t('Tue', 'tuesday'), diff --git a/library/Notifications/Widget/Calendar/MonthGrid.php b/library/Notifications/Widget/Calendar/MonthGrid.php index 3e395880..780930b5 100644 --- a/library/Notifications/Widget/Calendar/MonthGrid.php +++ b/library/Notifications/Widget/Calendar/MonthGrid.php @@ -80,7 +80,7 @@ protected function createHeader(): BaseHtmlElement $this->translate('Sun', 'sunday') ]; - $header = new HtmlElement('div', Attributes::create(['class' => 'header'])); + $header = new HtmlElement('div', Attributes::create(['class' => 'time-grid-header'])); foreach ($dayNames as $dayName) { $header->addHtml(new HtmlElement( 'div', diff --git a/library/Notifications/Widget/Calendar/WeekGrid.php b/library/Notifications/Widget/Calendar/WeekGrid.php index a059c041..1faab02b 100644 --- a/library/Notifications/Widget/Calendar/WeekGrid.php +++ b/library/Notifications/Widget/Calendar/WeekGrid.php @@ -76,7 +76,7 @@ protected function createHeader(): BaseHtmlElement t('Sun', 'sunday') ]; - $header = new HtmlElement('div', Attributes::create(['class' => 'header'])); + $header = new HtmlElement('div', Attributes::create(['class' => 'time-grid-header'])); $currentDay = clone $this->getGridStart(); $interval = new DateInterval('P1D'); diff --git a/library/Notifications/Widget/TimeGrid/DaysHeader.php b/library/Notifications/Widget/TimeGrid/DaysHeader.php index d2b371d2..0633fbfa 100644 --- a/library/Notifications/Widget/TimeGrid/DaysHeader.php +++ b/library/Notifications/Widget/TimeGrid/DaysHeader.php @@ -23,7 +23,7 @@ class DaysHeader extends BaseHtmlElement protected $tag = 'div'; - protected $defaultAttributes = ['class' => 'header']; + protected $defaultAttributes = ['class' => ['days-header', 'time-grid-header']]; /** @var DateTime Starting day */ protected $startDay; diff --git a/public/css/calendar.less b/public/css/calendar.less index 9d1dabb3..cf687dbf 100644 --- a/public/css/calendar.less +++ b/public/css/calendar.less @@ -42,14 +42,12 @@ --primaryRowHeight: 1fr; --stepRowHeight: 1fr; - .header { - display: grid; + .time-grid-header { align-items: flex-end; border-left: 1px solid transparent; grid-template-columns: repeat(var(--primaryColumns), minmax(var(--minimumPrimaryColumnWidth), 1fr)); .column-title { - text-align: center; border-right: 1px solid transparent; } } @@ -233,7 +231,7 @@ grid-template-columns: var(--sidebarWidth) minmax(0, 1fr); grid-template-rows: var(--headerHeight) minmax(0, 1fr); - .header { + .time-grid-header { grid-area: ~"1 / 2 / 3 / 3"; } @@ -365,11 +363,6 @@ } .column-title { - .day-name { - color: @text-color-light; - text-transform: uppercase; - } - .day-number { font-weight: bold; font-size: 1.5em; diff --git a/public/css/common.less b/public/css/common.less index 215bda33..2896834c 100644 --- a/public/css/common.less +++ b/public/css/common.less @@ -12,25 +12,31 @@ } } +.days-header { + display: grid; + + .column-title { + text-align: center; + .date { + font-size: 0.75em; + } + + .day-name { + color: @text-color-light; + text-transform: uppercase; + } + } +} + .schedules-header { margin-left: 12em; width: ~"calc(100% - 12em)"; - .header { - display: grid; + .days-header { grid-template-columns: repeat(7, minmax(2em, 1fr)); - text-transform: uppercase; .column-title { - text-align: center; border-right: 1px solid @gray-lighter; - .date { - font-size: 0.75em; - } - - .day-name { - color: @text-color-light; - } } .column-title:first-of-type { diff --git a/public/css/timeline.less b/public/css/timeline.less index ce00a165..d390ade5 100644 --- a/public/css/timeline.less +++ b/public/css/timeline.less @@ -10,7 +10,7 @@ --primaryRowHeight: 4em; position: relative; - .header { + .time-grid-header { box-sizing: border-box; position: sticky; z-index: 1; @@ -73,14 +73,10 @@ /* Design */ .timeline { - .header { + .time-grid-header { background: @body-bg-color; } - .column-title .date { - font-size: .75em; - } - .rotation-name { font-size: 1.25em; font-weight: bold;