You've already forked AstralRinth
forked from didirus/AstralRinth
b005c1f522
* New project card * no shadow on icons * Remove updated label * reduce tag count to 5 * improve envs * fix: project card bottom row not growing * move actions in grid mode * focus changes + new project list component * Allow more tags in grid mode, deprioritize non-loader tags * fix prod deploy robots.txt * remove unused id * App cards * prepr * publish date + fix router links * fix author hover underline in firefox * perf: preload on search item hover * remove unused filter * remove option for old grid view --------- Co-authored-by: tdgao <mr.trumgao@gmail.com> Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
66 lines
1.6 KiB
Vue
66 lines
1.6 KiB
Vue
<template>
|
|
<div class="smart-clickable" :class="{ 'smart-clickable--has-clickable': !!$slots.clickable }">
|
|
<slot name="clickable" />
|
|
<div v-bind="$attrs" class="smart-clickable__contents pointer-events-none">
|
|
<slot />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
defineOptions({
|
|
inheritAttrs: false,
|
|
})
|
|
</script>
|
|
<style scoped lang="scss">
|
|
.smart-clickable {
|
|
display: grid;
|
|
|
|
> * {
|
|
grid-area: 1 / 1;
|
|
}
|
|
|
|
.smart-clickable__contents {
|
|
// Utility classes for contents
|
|
:deep(.smart-clickable\:allow-pointer-events) {
|
|
pointer-events: all;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Only apply effects when a clickable is present
|
|
.smart-clickable.smart-clickable--has-clickable {
|
|
// Setup base styles for contents
|
|
.smart-clickable__contents {
|
|
transition: scale 0.125s ease-out;
|
|
|
|
// Why? I don't know. It forces the SVGs to render differently, which fixes some shift on hover otherwise.
|
|
//filter: brightness(1.00001);
|
|
}
|
|
|
|
// When clickable is being hovered or focus-visible, give contents an effect
|
|
:first-child:hover + .smart-clickable__contents,
|
|
:first-child:focus-visible + .smart-clickable__contents {
|
|
// Utility classes for contents
|
|
:deep(.smart-clickable\:underline-on-hover) {
|
|
text-decoration: underline;
|
|
}
|
|
:deep(.smart-clickable\:highlight-on-hover) {
|
|
filter: brightness(var(--hover-brightness, 1.25));
|
|
}
|
|
}
|
|
|
|
:first-child:focus-visible + .smart-clickable__contents {
|
|
// Utility classes for contents
|
|
:deep(.smart-clickable\:outline-on-focus) {
|
|
outline: 0.25rem solid var(--color-focus-ring);
|
|
}
|
|
}
|
|
|
|
// When clickable is being clicked, give contents an effect
|
|
:first-child:active + .smart-clickable__contents {
|
|
scale: 0.97;
|
|
}
|
|
}
|
|
</style>
|