From 9bf3eea22122f8b412500eb44876a24ff6e3ac9a Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Fri, 19 Apr 2024 22:40:44 +0200 Subject: [PATCH] Added background blend effect on calendar details --- .../calendar/CalendarEventDetails.vue | 60 ++++++++++++++++++- tailwind.config.js | 22 ++++++- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/src/components/calendar/CalendarEventDetails.vue b/src/components/calendar/CalendarEventDetails.vue index dc4bf49..ca1e9ec 100644 --- a/src/components/calendar/CalendarEventDetails.vue +++ b/src/components/calendar/CalendarEventDetails.vue @@ -16,7 +16,26 @@ const dateDifference = computed(() => getRelativeString(defaultDate, props.event + + diff --git a/tailwind.config.js b/tailwind.config.js index 09d66fc..ebda8b9 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -89,5 +89,25 @@ module.exports = { } } }, - plugins: [animate] + plugins: [ + animate, + function ({ addBase, theme }) { + function extractColorVars(colorObj, colorGroup = '') { + return Object.keys(colorObj).reduce((vars, colorKey) => { + const value = colorObj[colorKey] + + const newVars = + typeof value === 'string' + ? { [`--color${colorGroup}-${colorKey}`]: value } + : extractColorVars(value, `-${colorKey}`) + + return { ...vars, ...newVars } + }, {}) + } + + addBase({ + ':root': extractColorVars(theme('colors')) + }) + } + ] }