Skip to content

Commit

Permalink
Change css class of .header to .time-grid-header in .timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
raviks789 committed Jul 2, 2024
1 parent f9413e3 commit ac0a57c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 30 deletions.
2 changes: 1 addition & 1 deletion library/Notifications/Widget/Calendar/DayGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion library/Notifications/Widget/Calendar/MonthGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion library/Notifications/Widget/Calendar/WeekGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion library/Notifications/Widget/TimeGrid/DaysHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 2 additions & 9 deletions public/css/calendar.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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";
}

Expand Down Expand Up @@ -365,11 +363,6 @@
}

.column-title {
.day-name {
color: @text-color-light;
text-transform: uppercase;
}

.day-number {
font-weight: bold;
font-size: 1.5em;
Expand Down
28 changes: 17 additions & 11 deletions public/css/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 2 additions & 6 deletions public/css/timeline.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
--primaryRowHeight: 4em;
position: relative;

.header {
.time-grid-header {
box-sizing: border-box;
position: sticky;
z-index: 1;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ac0a57c

Please sign in to comment.