|
1 | 1 | <script setup lang="ts"> |
2 | 2 | import type { ThemeProps } from '~~/types/theme' |
3 | 3 |
|
4 | | -const props = defineProps<{ |
| 4 | +defineProps<{ |
5 | 5 | content?: string |
6 | 6 | } & ThemeProps>() |
7 | 7 |
|
8 | | -const { themeClass } = useTheme({ props }) |
9 | | -
|
10 | 8 | const id = useId() |
11 | 9 |
|
12 | 10 | const isExpanded = ref(false) |
@@ -34,7 +32,7 @@ function onTouchEnd() { |
34 | 32 |
|
35 | 33 | <template> |
36 | 34 | <div |
37 | | - :class="[$style.root, themeClass]" |
| 35 | + :class="$style.root" |
38 | 36 | :aria-label="$t('copyright.aria_label')" |
39 | 37 | aria-live="polite" |
40 | 38 | @mouseleave="onMouseLeave" |
@@ -65,55 +63,43 @@ function onTouchEnd() { |
65 | 63 | </template> |
66 | 64 |
|
67 | 65 | <style lang="scss" module> |
68 | | -@use 'assets/scss/mixins/theme' as *; |
69 | | -
|
70 | | -$leave-delay: 0.1s; |
71 | | -
|
72 | 66 | .root { |
73 | | - position: absolute; |
74 | | - right: var(--v-copyright-right, 16px); |
75 | | - bottom: var(--v-copyright-bottom, 16px); |
76 | | - display: flex; |
77 | | - max-width: 276px; |
78 | | - flex-direction: column-reverse; |
79 | | - border: 1px solid var(--v-copyright-border-color, transparent); |
80 | | - border-radius: 4px; |
81 | | - transition-delay: $leave-delay; |
82 | | - transition-duration: 0.2s; |
83 | | - transition-property: border-color, background-color; |
84 | | -
|
85 | | - @include theme-variants('copyright' 'colors-surface-primary'); |
86 | | -
|
87 | | - &:has(.button[aria-expanded="false"]) { |
88 | | - pointer-events: none; |
89 | | - } |
90 | | -
|
91 | | - &:has(.button[aria-expanded="true"]) { |
92 | | - --v-copyright-border-color: var(--colors-copyright-border-dialog, rgb(1, 1, 1, 15%)); |
93 | | -
|
94 | | - background-color: var(--colors-surface-primary, #FFF); |
95 | | - transition-delay: initial; |
96 | | - } |
| 67 | + display: grid; |
| 68 | + justify-content: end; |
| 69 | + row-gap: 6px; |
97 | 70 | } |
98 | 71 |
|
99 | 72 | .button { |
100 | | - align-self: flex-end; |
101 | | - pointer-events: all; |
102 | | -
|
103 | | - &:focus { |
104 | | - outline-offset: 0; |
105 | | - } |
| 73 | + grid-column: 1; |
| 74 | + grid-row: 2; |
| 75 | + justify-self: end; |
106 | 76 | } |
107 | 77 |
|
108 | 78 | .content { |
| 79 | + max-width: 276px; |
| 80 | + padding: var(--spacing-2xs); |
| 81 | + border: 1PX solid #ccc; |
| 82 | + border-radius: 4PX; |
| 83 | + background: #fff; |
| 84 | + color: #000; |
| 85 | + grid-column: 1; |
| 86 | + grid-row: 1; |
109 | 87 | opacity: 0; |
110 | | - transition-delay: $leave-delay; |
111 | | - transition-duration: 0.2s; |
112 | | - transition-property: opacity; |
| 88 | + transition-delay: 0s, 0.2s; |
| 89 | + transition-duration: 0.2s, 0s; |
| 90 | + transition-property: opacity, visibility; |
| 91 | + visibility: hidden; |
| 92 | +
|
| 93 | + p { |
| 94 | + &:first-child { |
| 95 | + margin: 0; |
| 96 | + } |
| 97 | + } |
113 | 98 |
|
114 | 99 | .button[aria-expanded="true"] + & { |
115 | 100 | opacity: 1; |
116 | | - transition-delay: initial; |
| 101 | + transition-delay: 0s, 0s; |
| 102 | + visibility: inherit; |
117 | 103 | } |
118 | 104 | } |
119 | 105 | </style> |
0 commit comments