vanilla-vue-ui 0.0.20 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@
9
9
  </template>
10
10
 
11
11
  <script setup lang="ts">
12
- import { computed } from 'vue'
12
+ import { computed, onMounted } from 'vue'
13
13
 
14
14
  type ScrollbarWidth = 'auto' | 'thin' | 'none'
15
15
 
@@ -39,22 +39,29 @@ const cssVars = computed(() => {
39
39
  })
40
40
 
41
41
  const scrollbarWidth = props.scrollbarWidth
42
- </script>
43
42
 
44
- <style scoped>
45
- .custom-scrollbar {
46
- /* Firefox */
47
- scrollbar-width: var(--scrollbar-width);
48
- }
49
-
50
- /* Chromium / Safari */
51
- .custom-scrollbar::-webkit-scrollbar {
52
- width: var(--webkit-scrollbar-size);
53
- height: var(--webkit-scrollbar-size);
54
- }
55
-
56
- /* 完全に非表示(スクロール自体は可能) */
57
- .no-scrollbar::-webkit-scrollbar {
58
- display: none;
59
- }
60
- </style>
43
+ onMounted(() => {
44
+ if (!document.getElementById('scrollbar-style')) {
45
+ const style = document.createElement('style')
46
+ style.id = 'scrollbar-style'
47
+ style.textContent = `
48
+ .custom-scrollbar {
49
+ /* Firefox */
50
+ scrollbar-width: var(--scrollbar-width);
51
+ }
52
+
53
+ /* Chromium / Safari */
54
+ .custom-scrollbar::-webkit-scrollbar {
55
+ width: var(--webkit-scrollbar-size);
56
+ height: var(--webkit-scrollbar-size);
57
+ }
58
+
59
+ /* 完全に非表示(スクロール自体は可能) */
60
+ .no-scrollbar::-webkit-scrollbar {
61
+ display: none;
62
+ }
63
+ `
64
+ document.head.appendChild(style)
65
+ }
66
+ })
67
+ </script>
@@ -116,6 +116,30 @@ onMounted(() => {
116
116
  updateSliderBg({ value: Number(modelValue.value), max: props.max, min: props.min })
117
117
  })
118
118
  }
119
+
120
+ if (!document.getElementById('range-thumb-style')) {
121
+ const style = document.createElement('style')
122
+ style.id = 'range-thumb-style'
123
+ style.textContent = `
124
+ input[type="range"]::-webkit-slider-thumb {
125
+ background-color: white;
126
+ appearance: none;
127
+ width: 20px;
128
+ height: 20px;
129
+ border-radius: 50%;
130
+ border: 2px solid rgb(251, 191, 36);
131
+ }
132
+ input[type="range"]::-moz-range-thumb {
133
+ background-color: white;
134
+ appearance: none;
135
+ width: 20px;
136
+ height: 20px;
137
+ border-radius: 50%;
138
+ border: 2px solid rgb(251, 191, 36);
139
+ }
140
+ `
141
+ document.head.appendChild(style)
142
+ }
119
143
  })
120
144
 
121
145
  // props.classesが渡されていない場合、defaultClassesを使用する
@@ -168,23 +192,3 @@ function emitCustomEvent(value: string) {
168
192
  emit('customInput', event)
169
193
  }
170
194
  </script>
171
-
172
- <style>
173
- input[type="range"]::-webkit-slider-thumb {
174
- background-color: white;
175
- appearance: none;
176
- width: 20px;
177
- height: 20px;
178
- border-radius: 50%;
179
- border: 2px solid rgb(251, 191, 36);
180
- }
181
-
182
- input[type="range"]::-moz-range-thumb {
183
- background-color: white;
184
- appearance: none;
185
- width: 20px;
186
- height: 20px;
187
- border-radius: 50%;
188
- border: 2px solid rgb(251, 191, 36);
189
- }
190
- </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vanilla-vue-ui",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [