Skip to content

Commit

Permalink
css: Fix and cleanup calendar rules
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg authored and raviks789 committed Apr 17, 2024
1 parent 734d157 commit c2f0bbd
Showing 1 changed file with 61 additions and 88 deletions.
149 changes: 61 additions & 88 deletions public/css/calendar.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Layout */

.calendar-controls {
display: flex;
justify-content: flex-start;
Expand Down Expand Up @@ -87,48 +88,57 @@
.entry {
overflow: hidden;

.content {
display: flex;
flex-wrap: wrap;
column-gap: .5em;
padding: .125em;
height: 100%;
max-height: 100%;
}

.title {
display: flex;
flex-wrap: wrap;
align-content: flex-start;
flex: 0 1 auto;
column-gap: .5em;
overflow: hidden;

time {
margin-right: .5em;
}

.attendee {
word-break: break-word;
}

.attendee .icon {
vertical-align: baseline;
}
}

.description {
flex: 1 1 auto;
overflow: hidden;

p {
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
.line-clamp(3);
}
}
}
.content {
display: flex;
flex-wrap: wrap;
column-gap: .5em;
padding: .125em;
height: 100%;
max-height: 100%;
}

.title {
display: flex;
flex-wrap: wrap;
flex: 0 1 auto;
column-gap: .5em;
overflow: hidden;

time {
margin-right: .5em;
}

.attendee {
word-break: break-word;
}

.attendee .icon {
vertical-align: baseline;
}
}

.description {
flex: 1 1 auto;
overflow: hidden;

p {
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
.line-clamp(3);
}
}

.ends-at {
align-self: flex-end;
text-align: right;
width: 100%;

.text-ellipsis();
font-size: 11/12em;
line-height: 12/11 * 1.5;
}
}
}

.calendar-grid.month {
Expand All @@ -147,11 +157,6 @@
grid-template-rows: repeat(@weeks * @rowsPerDay, 1fr);
grid-template-columns: repeat(@days * @columnsPerDay, minmax(0, 1fr));
overflow: hidden;

.ends-at {
flex: 1 1 0;
text-align: right;
}
}

.step {
Expand Down Expand Up @@ -188,10 +193,6 @@
.grid,
.overlay {
border-left: none;

.title {
width: 100%;
}
}

.step {
Expand Down Expand Up @@ -229,22 +230,6 @@
}
}

.calendar-grid.week,
.calendar-grid.day {
.entry {
.content {
flex-direction: column;
align-content: flex-start;
justify-content: flex-end;

.ends-at {
text-align: right;
width: 100%;
}
}
}
}

.calendar-grid {
display: grid;

Expand Down Expand Up @@ -283,17 +268,6 @@

.entry {
pointer-events: all;

.starts-at,
.ends-at {
font-weight: normal;
color: @text-color-light;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 11/12em;
line-height: 12/11 * 1.5;
}
}
}
}
Expand Down Expand Up @@ -325,43 +299,43 @@
border-radius: 0;
border-right: none;
border-left: none;
background: linear-gradient(to right, transparent, var(--entry-bg) 0.5em, var(--entry-bg) calc(100% - 0.5em), transparent);
background: linear-gradient(to right, transparent, var(--entry-bg) 0.5em, var(--entry-bg) ~"calc(100% - 0.5em)", transparent);
}

&.opening-gradient {
border-radius: 0 0.25em 0.25em 0;
border-left: none;
background: linear-gradient(to left, var(--entry-bg) calc(100% - 1em), transparent);
background: linear-gradient(to left, var(--entry-bg) ~"calc(100% - 1em)", transparent);
}

&.ending-gradient {
border-radius: 0.25em 0 0 0.25em;
border-right: none;
background: linear-gradient(to right, var(--entry-bg) calc(100% - 1em), transparent);
background: linear-gradient(to right, var(--entry-bg) ~"calc(100% - 1em)", transparent);
}
}
}

.calendar-grid.week,
.calendar-grid.day{
.calendar-grid.day {
.entry {
&.two-way-gradient {
border-radius: 0;
border-top: none;
border-bottom: none;
background: linear-gradient(to bottom, transparent, var(--entry-bg) 0.5em, var(--entry-bg) calc(100% - 0.5em), transparent);
background: linear-gradient(to bottom, transparent, var(--entry-bg) 0.5em, var(--entry-bg) ~"calc(100% - 0.5em)", transparent);
}

&.opening-gradient {
border-radius: 0 0 0.25em 0.25em;
border-top: none;
background: linear-gradient(to top, var(--entry-bg) calc(100% - 1em), transparent);
background: linear-gradient(to top, var(--entry-bg) ~"calc(100% - 1em)", transparent);
}

&.ending-gradient {
border-radius: 0.25em 0.25em 0 0;
border-bottom: none;
background: linear-gradient(to bottom, var(--entry-bg) calc(100% - 1em), transparent);
background: linear-gradient(to bottom, var(--entry-bg) ~"calc(100% - 1em)", transparent);
}
}
}
Expand Down Expand Up @@ -396,7 +370,6 @@
.title {
font-weight: bold;
color: @text-color;
mix-blend-mode: screen;
opacity: .75;

time {
Expand All @@ -409,8 +382,8 @@
}
}

.description {
mix-blend-mode: screen;
.ends-at {
color: @text-color-light;
}
}

Expand Down

0 comments on commit c2f0bbd

Please sign in to comment.