Skip to content

Commit c2e6390

Browse files
committed
feat(select): drop sass for styling, use scoped css
1 parent 300a9a0 commit c2e6390

File tree

4 files changed

+74
-60
lines changed

4 files changed

+74
-60
lines changed

package-lock.json

+22-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"happy-dom": "17.1.1",
5858
"npm-run-all2": "7.0.2",
5959
"postcss": "8.5.2",
60-
"sass": "1.85.0",
6160
"typescript": "5.7.3",
6261
"vite": "6.1.0",
6362
"vite-plugin-css-injected-by-js": "3.5.2",

playground/PlaygroundLayout.vue

+15-15
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ body {
5454
}
5555
</style>
5656

57-
<style lang="scss" scoped>
57+
<style lang="css" scoped>
5858
.navigation-container {
5959
display: flex;
6060
align-items: center;
@@ -65,21 +65,21 @@ body {
6565
6666
.container {
6767
padding: 2rem;
68+
}
6869
69-
.form-container {
70-
display: flex;
71-
flex-direction: column;
72-
max-width: 400px;
73-
padding: 2rem;
74-
margin: 0 auto;
75-
border-radius: 6px;
76-
background-color: #fff;
70+
.form-container {
71+
display: flex;
72+
flex-direction: column;
73+
max-width: 400px;
74+
padding: 2rem;
75+
margin: 0 auto;
76+
border-radius: 6px;
77+
background-color: #fff;
78+
}
7779
78-
.selected-value {
79-
font-size: 14px;
80-
font-weight: 500;
81-
font-family: "IBM Plex Mono", monospace;
82-
}
83-
}
80+
.selected-value {
81+
font-size: 14px;
82+
font-weight: 500;
83+
font-family: "IBM Plex Mono", monospace;
8484
}
8585
</style>

src/Select.vue

+37-41
Original file line numberDiff line numberDiff line change
@@ -574,27 +574,15 @@ onBeforeUnmount(() => {
574574
}
575575
</style>
576576

577-
<style lang="scss" scoped>
577+
<style lang="css" scoped>
578+
* {
579+
box-sizing: border-box;
580+
}
581+
578582
.vue-select {
579583
position: relative;
580584
box-sizing: border-box;
581585
width: var(--vs-width);
582-
583-
* {
584-
box-sizing: border-box;
585-
}
586-
587-
&.open {
588-
.single-value {
589-
opacity: var(--vs-option-opacity-menu-open);
590-
}
591-
}
592-
593-
&.typing {
594-
.single-value {
595-
opacity: 0;
596-
}
597-
}
598586
}
599587
600588
.control {
@@ -606,15 +594,15 @@ onBeforeUnmount(() => {
606594
border: var(--vs-border);
607595
border-radius: var(--vs-border-radius);
608596
background-color: var(--vs-background-color);
597+
}
609598
610-
&.focused {
611-
box-shadow: 0 0 0 var(--vs-outline-width) var(--vs-outline-color);
612-
border-color: var(--vs-outline-color);
613-
}
599+
.control.focused {
600+
box-shadow: 0 0 0 var(--vs-outline-width) var(--vs-outline-color);
601+
border-color: var(--vs-outline-color);
602+
}
614603
615-
&.disabled {
616-
background-color: var(--vs-disabled-background-color);
617-
}
604+
.control.disabled {
605+
background-color: var(--vs-disabled-background-color);
618606
}
619607
620608
.value-container {
@@ -624,11 +612,11 @@ onBeforeUnmount(() => {
624612
align-items: center;
625613
flex: 1 1 0%;
626614
padding: var(--vs-padding);
615+
}
627616
628-
&.multi.has-value {
629-
display: flex;
630-
flex-wrap: wrap;
631-
}
617+
.value-container.multi.has-value {
618+
display: flex;
619+
flex-wrap: wrap;
632620
}
633621
634622
.single-value {
@@ -645,26 +633,34 @@ onBeforeUnmount(() => {
645633
color: var(--vs-text-color);
646634
}
647635
636+
.vue-select[data-state="open"] .single-value {
637+
opacity: var(--vs-option-opacity-menu-open);
638+
}
639+
640+
.vue-select.typing .single-value {
641+
opacity: 0;
642+
}
643+
648644
.input-container {
649645
visibility: visible;
650646
display: inline-grid;
651647
grid-area: 1 / 1 / 2 / 3;
652648
grid-template-columns: 0px min-content;
649+
}
653650
654-
&.typing {
655-
transform: translateZ(0px);
656-
}
651+
.input-container.typing {
652+
transform: translateZ(0px);
653+
}
657654
658-
&.typing::after {
659-
content: attr(data-value) " ";
660-
visibility: hidden;
661-
white-space: pre;
662-
grid-area: 1 / 2;
663-
min-width: 2px;
664-
padding: 0;
665-
margin: 0;
666-
border: 0;
667-
}
655+
.input-container.typing::after {
656+
content: attr(data-value) " ";
657+
visibility: hidden;
658+
white-space: pre;
659+
grid-area: 1 / 2;
660+
min-width: 2px;
661+
padding: 0;
662+
margin: 0;
663+
border: 0;
668664
}
669665
670666
.search-input {

0 commit comments

Comments
 (0)