Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: switch calendar to dark mode

DarkPhoenix27044253264da467
diff --git a/packages/nc-gui/components/smartsheet/calendar/DateTimeSpanningContainer.vue b/packages/nc-gui/components/smartsheet/calendar/DateTimeSpanningContainer.vue
index 9c2075b9a3..fabcde41ed 100644
--- a/packages/nc-gui/components/smartsheet/calendar/DateTimeSpanningContainer.vue
+++ b/packages/nc-gui/components/smartsheet/calendar/DateTimeSpanningContainer.vue
@@ -463,7 +463,10 @@ defineExpose({
</script>
<template>
- <div style="z-index: 100" class="sticky flex top-0 bg-white border-b-1 border-gray-200 shadow-sm prevent-select">
+ <div
+ style="z-index: 100"
+ class="sticky flex top-0 bg-nc-bg-default border-b-1 border-nc-border-gray-medium shadow-sm prevent-select"
+ >
<div
:style="{
maxWidth: `${activeCalendarView === 'week' ? '64px' : '66px'}`,
@@ -473,13 +476,13 @@ defineExpose({
'p-2': activeCalendarView === 'day',
'py-2 pr-1': activeCalendarView === 'week',
}"
- class="text-xs top-0 text-right z-50 !sticky h-full left-0 text-[#6A7184]"
+ class="text-xs top-0 text-right z-50 !sticky h-full left-0 text-nc-content-gray"
>
All day
<NcButton size="xsmall" class="mt-2" type="text" @click="isExpanded = !isExpanded">
- <GeneralIcon v-if="!isExpanded" class="w-4 h-4 text-gray-800" icon="maximize" />
- <GeneralIcon v-else-if="isExpanded" class="w-4 h-4 text-gray-800" icon="minimize" />
+ <GeneralIcon v-if="!isExpanded" class="w-4 h-4 text-nc-content-gray" icon="maximize" />
+ <GeneralIcon v-else-if="isExpanded" class="w-4 h-4 text-nc-content-gray" icon="minimize" />
</NcButton>
</div>
<div
@@ -488,8 +491,8 @@ defineExpose({
width: `calc(100% - ${activeCalendarView === 'week' ? '64' : '66'}px)`,
}"
:class="{
- 'border-gray-100': activeCalendarView === 'day',
- 'border-gray-200': activeCalendarView === 'week',
+ 'border-nc-border-gray-light': activeCalendarView === 'day',
+ 'border-nc-border-gray-medium': activeCalendarView === 'week',
'min-h-32 max-h-32 ': isExpanded,
'h-20': !isExpanded,
}"
@@ -498,7 +501,7 @@ defineExpose({
<div class="pointer-events-none h-full inset-y-0 relative">
<div
v-if="maxVisibleDays === 7"
- class="absolute !right-0 h-full bg-gray-100 inset-y-0"
+ class="absolute !right-0 h-full bg-nc-bg-gray-light inset-y-0"
:style="{
width: `${(containerWidth / 7) * 2}px`,
}"
diff --git a/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue b/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue
index a458ec2a4e..3f4503491c 100644
--- a/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue
+++ b/packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue
@@ -247,7 +247,7 @@ const newRecord = () => {
<div
v-else
ref="container"
- class="w-full h-full cursor-pointer flex text-md font-bold text-gray-500 items-center justify-center"
+ class="w-full h-full cursor-pointer flex text-md font-bold text-nc-content-gray-muted items-center justify-center"
@drop="dropEvent"
@dblclick="newRecord"
>
diff --git a/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue b/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
index f7bddd2265..7e26eac2f3 100644
--- a/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
+++ b/packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
@@ -1013,7 +1013,7 @@ const expandRecord = (record: Row) => {
<div
v-for="(hour, index) in hours"
:key="index"
- class="flex h-13 relative border-1 group hover:bg-nc-bg-gray-extralight border-nc-base-white"
+ class="flex h-13 relative border-1 group hover:bg-nc-bg-gray-extralight border-nc-white"
data-testid="nc-calendar-day-hour"
@click="selectHour(hour)"
@dblclick="newRecord(hour)"
@@ -1030,7 +1030,7 @@ const expandRecord = (record: Row) => {
:class="{
'selected-hour': hour.isSame(selectedTime),
}"
- class="flex w-full border-l-gray-100 h-13 transition nc-calendar-day-hour relative border-1 group hover:bg-nc-bg-gray-extralight border-nc-base-white border-b-nc-border-gray-light"
+ class="flex w-full border-l-nc-border-gray-light h-13 transition nc-calendar-day-hour relative border-1 group hover:bg-nc-bg-gray-extralight border-nc-white border-b-nc-border-gray-light"
data-testid="nc-calendar-day-hour"
@click="selectHour(hour)"
@dblclick="newRecord(hour)"
diff --git a/packages/nc-gui/components/smartsheet/calendar/VRecordCard.vue b/packages/nc-gui/components/smartsheet/calendar/VRecordCard.vue
index 9fb2d21ea1..a8c8ef1c69 100644
--- a/packages/nc-gui/components/smartsheet/calendar/VRecordCard.vue
+++ b/packages/nc-gui/components/smartsheet/calendar/VRecordCard.vue
@@ -34,13 +34,13 @@ const rowColorInfo = computed(() => {
...rowColorInfo.rowBgColor,
}"
:class="{
- 'bg-maroon-50': color === 'maroon',
- 'bg-blue-50': color === 'blue',
- 'bg-green-50': color === 'green',
- 'bg-yellow-50': color === 'yellow',
- 'bg-pink-50': color === 'pink',
- 'bg-purple-50': color === 'purple',
- 'bg-white border-gray-300': color === 'gray',
+ 'bg-nc-bg-coloured-marooon': color === 'maroon',
+ 'bg-nc-bg-coloured-blue': color === 'blue',
+ 'bg-nc-bg-coloured-green': color === 'green',
+ 'bg-nc-bg-coloured-yellow': color === 'yellow',
+ 'bg-nc-bg-coloured-pink': color === 'pink',
+ 'bg-nc-bg-coloured-purple': color === 'purple',
+ 'bg-nc-bg-default border-nc-border-gray-dark': color === 'gray',
'z-90': hover,
'!bg-nc-bg-gray-light': hover || dragging,
}"
@@ -53,13 +53,13 @@ const rowColorInfo = computed(() => {
></div>
<div
:class="{
- 'bg-maroon-500': color === 'maroon',
- 'bg-blue-500': color === 'blue',
- 'bg-green-500': color === 'green',
- 'bg-yellow-500': color === 'yellow',
- 'bg-pink-500': color === 'pink',
- 'bg-purple-500': color === 'purple',
- 'bg-gray-900': color === 'gray',
+ 'bg-nc-fill-coloured-maroon-medium': props.color === 'maroon',
+ 'bg-nc-fill-coloured-blue-medium': props.color === 'blue',
+ 'bg-nc-fill-coloured-green-medium': props.color === 'green',
+ 'bg-nc-fill-coloured-yellow-medium': props.color === 'yellow',
+ 'bg-nc-fill-coloured-pink-medium': props.color === 'pink',
+ 'bg-nc-fill-coloured-purple-medium': props.color === 'purple',
+ 'bg-nc-gray-900': props.color === 'gray',
}"
class="h-full min-h-3 w-1.25 -ml-0.25"
:style="rowColorInfo.rowLeftBorderColor"
@@ -97,7 +97,7 @@ const rowColorInfo = computed(() => {
.plain-cell {
line-height: 18px;
.bold {
- @apply !text-gray-800 font-bold;
+ @apply !text-nc-content-gray font-bold;
}
}
</style>
diff --git a/packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue b/packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue
index e887c550e2..08c9830bba 100644
--- a/packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue
+++ b/packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue
@@ -530,7 +530,7 @@ const addRecord = (date: dayjs.Dayjs) => {
'w-1/5': maxVisibleDays === 5,
'w-1/7': maxVisibleDays === 7,
}"
- class="cursor-pointer text-center text-[10px] font-semibold leading-4 flex items-center justify-center uppercase text-gray-500 w-full py-1 border-gray-200 border-l-gray-50 border-t-gray-50 last:border-r-0 border-1 bg-gray-50"
+ class="cursor-pointer text-center text-[10px] font-semibold leading-4 flex items-center justify-center uppercase text-nc-content-gray-muted w-full py-1 border-nc-border-gray-medium border-l-nc-border-gray-extra-light border-t-nc-border-gray-extra-light last:border-r-0 border-1 bg-nc-bg-gray-extra-light"
@click="selectDate(date)"
@dblclick="addRecord(date)"
>
@@ -543,7 +543,7 @@ const addRecord = (date: dayjs.Dayjs) => {
:key="dateIndex"
:class="{
'selected-date': dayjs(date).isSame(selectedDate, 'day'),
- '!bg-gray-50': date.get('day') === 0 || date.get('day') === 6,
+ '!bg-nc-bg-gray-extra-light': date.get('day') === 0 || date.get('day') === 6,
'w-1/5': maxVisibleDays === 5,
'w-1/7': maxVisibleDays === 7,
}"
diff --git a/packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue b/packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue
index bc03219cff..ec33799cb0 100644
--- a/packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue
+++ b/packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue
@@ -1035,19 +1035,19 @@ watch(
>
{{ currTime.format('hh:mm A') }}
</span>
- <div class="flex-1 relative ml-1 nc-calendar-border-line border-b-2 border-brand-500"></div>
+ <div class="flex-1 relative ml-1 nc-calendar-border-line border-b-2 border-nc-border-brand"></div>
</div>
</div>
- <div class="flex sticky h-6 z-4 top-0 pl-16 bg-gray-50 w-full">
+ <div class="flex sticky h-6 z-4 top-0 pl-16 bg-nc-bg-gray-extra-light w-full">
<div
v-for="date in datesHours"
:key="date[0].toISOString()"
:class="{
- 'text-brand-500': date[0].isSame(timezoneDayjs.dayjsTz(), 'date'),
+ 'text-nc-content-brand': date[0].isSame(timezoneDayjs.dayjsTz(), 'date'),
'w-1/5': maxVisibleDays === 5,
'w-1/7': maxVisibleDays === 7,
}"
- class="text-center text-[10px] font-semibold leading-4 flex items-center justify-center uppercase text-gray-500 w-full py-1 border-gray-200 last:border-r-0 border-b-1 border-l-1 border-r-0 bg-gray-50"
+ class="text-center text-[10px] font-semibold leading-4 flex items-center justify-center uppercase text-nc-content-gray-muted w-full py-1 border-nc-border-gray-medium last:border-r-0 border-b-1 border-l-1 border-r-0 bg-nc-bg-gray-extra-light"
>
{{ timezoneDayjs.dayjsTz(date[0]).format('DD ddd') }}
</div>
@@ -1058,19 +1058,19 @@ watch(
'top-32': isExpanded && isRangeEnabled,
'!top-0': !recordsAcrossAllRange.spanningRecords?.length,
}"
- class="absolute bg-white w-16 z-1"
+ class="absolute bg-nc-bg-default w-16 z-1"
>
<div
v-for="(hour, index) in datesHours[0]"
:key="index"
- class="h-13 first:mt-0 pt-7.1 nc-calendar-day-hour text-right pr-2 font-semibold text-xs text-gray-500 py-1"
+ class="h-13 first:mt-0 pt-7.1 nc-calendar-day-hour text-right pr-2 font-semibold text-xs text-nc-content-gray-muted py-1"
>
{{ hour.format('hh a') }}
</div>
</div>
<div
v-if="isRangeEnabled && recordsAcrossAllRange.spanningRecords?.length"
- class="sticky top-6 bg-white z-4 inset-x-0 w-full"
+ class="sticky top-6 nc-bg-default z-4 inset-x-0 w-full"
>
<SmartsheetCalendarDateTimeSpanningContainer
ref="spanningRecordsContainer"
@@ -1101,13 +1101,13 @@ watch(
v-for="(hour, hourIndex) in date"
:key="hourIndex"
:class="{
- 'border-1 !border-brand-500 !bg-gray-100':
+ 'border-1 !border-nc-border-brand !bg-nc-bg-gray-light':
hour.isSame(selectedTime, 'hour') && (hour.get('day') === 6 || hour.get('day') === 0),
'selected-hour': hour.isSame(selectedTime, 'hour'),
- 'bg-gray-50 hover:bg-gray-100': hour.get('day') === 0 || hour.get('day') === 6,
- 'hover:bg-gray-50': hour.get('day') !== 0 && hour.get('day') !== 6,
+ 'bg-nc-bg-gray-extra-light hover:nc-bg-gray-light': hour.get('day') === 0 || hour.get('day') === 6,
+ 'hover:bg-nc-bg-gray-extra-light': hour.get('day') !== 0 && hour.get('day') !== 6,
}"
- class="text-center relative transition h-13 text-sm text-gray-500 w-full py-1 border-transparent border-1 border-x-gray-100 border-t-gray-100 border-l-gray-200"
+ class="text-center relative transition h-13 text-sm text-nc-content-gray-muted w-full py-1 border-transparent border-1 border-x-nc-border-gray-light border-t-nc-border-gray-light border-l-nc-border-gray-light"
data-testid="nc-calendar-week-hour"
@dblclick="addRecord(hour)"
@click="
@@ -1121,7 +1121,7 @@ watch(
<NcDropdown v-if="isOverflowAcrossHourRange(hour).isOverflow" :trigger="['click']">
<NcButton
v-e="`['c:calendar:week-view-more']`"
- class="!absolute bottom-1 text-center w-15 ml-auto inset-x-0 z-3 text-gray-500"
+ class="!absolute bottom-1 text-center w-15 ml-auto inset-x-0 z-3 text-nc-content-gray-muted"
size="xxsmall"
type="secondary"
@click="viewMore(hour)"
@@ -1150,7 +1150,7 @@ watch(
<LazySmartsheetPlainCell v-model="record.row[displayField!.title!]" :column="displayField" />
</template>
<template v-else>
- <span class="text-gray-500"> - </span>
+ <span class="text-nc-content-gray-muted"> - </span>
</template>
</LazySmartsheetCalendarSideRecordCard>
</div>
@@ -1209,7 +1209,7 @@ watch(
/>
</template>
<template #time>
- <div class="text-xs font-medium text-gray-400">
+ <div class="text-xs font-medium text-nc-content-gray-disabled">
{{ timezoneDayjs.timezonize(record.row[record.rowMeta.range?.fk_from_col!.title!]).format('h:mm a') }}
</div>
</template>