Skip to content

Commit 2d761e2

Browse files
committed
fix: convert styles to unscoped for Vue2 support
1 parent 2bd67c2 commit 2d761e2

File tree

11 files changed

+78
-44
lines changed

11 files changed

+78
-44
lines changed

src/devtools/Devtools.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ export default defineComponent({
9292
const devtoolsPanel = h(DevtoolsPanel, {
9393
class: {
9494
"devtools-panel": true,
95-
resizing: this.isResizing,
96-
open: this.isOpen,
95+
"devtools-resizing": this.isResizing,
96+
"devtools-open": this.isOpen,
9797
},
9898
style: {
9999
height: this.devtoolsHeight,
@@ -151,7 +151,7 @@ export default defineComponent({
151151
});
152152
</script>
153153

154-
<style scoped>
154+
<style>
155155
.devtools-panel {
156156
bottom: 0;
157157
box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
@@ -167,11 +167,11 @@ export default defineComponent({
167167
z-index: 99999;
168168
}
169169
170-
.resizing {
170+
.devtools-resizing {
171171
transition: none;
172172
}
173173
174-
.open {
174+
.devtools-open {
175175
opacity: 1;
176176
pointer-events: all;
177177
transform: translateY(0) scale(1);

src/devtools/DevtoolsPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export default defineComponent({
205205
});
206206
</script>
207207

208-
<style scoped>
208+
<style>
209209
.VueQueryDevtoolsPanel {
210210
display: flex;
211211
font-family: sans-serif;

src/devtools/active-query-panel/ActiveQueryPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default defineComponent({
9595
});
9696
</script>
9797

98-
<style scoped>
98+
<style>
9999
.active-query-panel {
100100
display: flex;
101101
flex-direction: column;

src/devtools/active-query-panel/ExpandableNode.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default defineComponent({
3232
? h(
3333
"span",
3434
{
35-
class: "subtitle",
35+
class: "expandable-subtitle",
3636
},
3737
this.subtitle
3838
)
@@ -53,7 +53,7 @@ export default defineComponent({
5353
h(
5454
"span",
5555
{
56-
class: "arrow",
56+
class: "expandable-arrow",
5757
style: {
5858
transform: `rotate(${this.$props.isExpanded ? 90 : 0}deg)`,
5959
},
@@ -68,19 +68,19 @@ export default defineComponent({
6868
});
6969
</script>
7070

71-
<style scoped>
71+
<style>
7272
.expandable {
7373
cursor: pointer;
7474
color: white;
7575
}
7676
77-
.arrow {
77+
.expandable-arrow {
7878
display: inline-block;
7979
margin-right: 10px;
8080
transition: all 0.1s ease;
8181
}
8282
83-
.subtitle {
83+
.expandable-subtitle {
8484
color: grey;
8585
font-size: 0.7rem;
8686
margin-left: 10px;

src/devtools/active-query-panel/Explorer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export default defineComponent({
276276
});
277277
</script>
278278

279-
<style scoped>
279+
<style>
280280
.explorer-tree {
281281
font-family: Menlo, monospace;
282282
font-size: 0.9rem;

src/devtools/active-query-panel/InfoPanel.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,28 @@ export default defineComponent({
2929
h(
3030
"div",
3131
{
32-
class: "title",
32+
class: "info-title",
3333
style: {
3434
background: this.theme.backgroundAlt,
3535
},
3636
},
3737
this.$props.title
3838
),
39-
h("div", { class: "panel" }, slot),
39+
h("div", { class: "info-panel" }, slot),
4040
]);
4141
},
4242
});
4343
</script>
4444

45-
<style scoped>
46-
.title {
45+
<style>
46+
.info-title {
4747
padding: 0.5rem;
4848
position: sticky;
4949
top: 0;
5050
z-index: 1;
5151
}
5252
53-
.panel {
53+
.info-panel {
5454
padding: 0.5rem;
5555
}
5656
</style>

src/devtools/active-query-panel/QueryActions.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default defineComponent({
5858
h(
5959
"button",
6060
{
61+
class: "action-button",
6162
style: {
6263
background: this.isFetching
6364
? this.theme.grayAlt
@@ -82,6 +83,7 @@ export default defineComponent({
8283
h(
8384
"button",
8485
{
86+
class: "action-button",
8587
style: {
8688
background: this.theme.warning,
8789
color: this.theme.inputTextColor,
@@ -102,6 +104,7 @@ export default defineComponent({
102104
h(
103105
"button",
104106
{
107+
class: "action-button",
105108
style: {
106109
background: this.theme.gray,
107110
},
@@ -121,6 +124,7 @@ export default defineComponent({
121124
h(
122125
"button",
123126
{
127+
class: "action-button",
124128
style: {
125129
background: this.theme.danger,
126130
},
@@ -143,8 +147,8 @@ export default defineComponent({
143147
});
144148
</script>
145149

146-
<style scoped>
147-
button {
150+
<style>
151+
.action-button {
148152
appearance: none;
149153
border-radius: 0.3em;
150154
border: 0;
@@ -155,7 +159,7 @@ button {
155159
padding: 0.5em;
156160
}
157161
158-
button:not(:last-of-type) {
162+
.action-button:not(:last-of-type) {
159163
margin-right: 5px;
160164
}
161165
</style>

src/devtools/active-query-panel/QueryDetails.vue

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,51 +50,72 @@ export default defineComponent({
5050
},
5151
},
5252
[
53-
h("div", { class: "info-line" }, [
54-
h("code", [h("pre", this.formattedQueryKey)]),
53+
h("div", { class: "details-info-line" }, [
54+
h(
55+
"code",
56+
{
57+
class: "details-code",
58+
},
59+
[h("pre", { class: "details-pre" }, this.formattedQueryKey)]
60+
),
5561
h(
5662
"span",
57-
{ style: { background: this.statusBackground } },
63+
{
64+
class: "details-span",
65+
style: { background: this.statusBackground },
66+
},
5867
this.queryStatusLabel
5968
),
6069
]),
61-
h("div", { class: "info-line" }, [
70+
h("div", { class: "details-info-line" }, [
6271
"Observers:",
63-
h("code", this.observersCount),
72+
h(
73+
"code",
74+
{
75+
class: "details-code",
76+
},
77+
this.observersCount
78+
),
6479
]),
65-
h("div", { class: "info-line" }, [
80+
h("div", { class: "details-info-line" }, [
6681
"Last Updated:",
67-
h("code", this.updateDate),
82+
h(
83+
"code",
84+
{
85+
class: "details-code",
86+
},
87+
this.updateDate
88+
),
6889
]),
6990
]
7091
);
7192
},
7293
});
7394
</script>
7495

75-
<style scoped>
76-
.info-line {
96+
<style>
97+
.details-info-line {
7798
align-items: stretch;
7899
display: flex;
79100
justify-content: space-between;
80101
}
81102
82-
.info-line:not(:last-of-type) {
103+
.details-info-line:not(:last-of-type) {
83104
margin-bottom: 0.5rem;
84105
}
85106
86-
code {
107+
.details-code {
87108
font-size: 0.9em;
88109
line-height: 1.8rem;
89110
}
90111
91-
pre {
112+
.details-pre {
92113
margin: 0;
93114
overflow: auto;
94115
padding: 0;
95116
}
96117
97-
span {
118+
.details-span {
98119
border-radius: 0.4rem;
99120
flex-shrink: 0;
100121
font-weight: bold;

src/devtools/components/QueryItem.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default defineComponent({
5555
h(
5656
"div",
5757
{
58-
class: "query-state",
58+
class: "query-item-state",
5959
style: {
6060
background: this.stateColor,
6161
textShadow: this.isStale ? "0" : "0 0 10px black",
@@ -64,15 +64,21 @@ export default defineComponent({
6464
},
6565
this.observerCount
6666
),
67-
h("code", this.$props.query.queryHash),
67+
h(
68+
"code",
69+
{
70+
class: "query-item-code",
71+
},
72+
this.$props.query.queryHash
73+
),
6874
]
6975
);
7076
},
7177
});
7278
</script>
7379

74-
<style scoped>
75-
.query-state {
80+
<style>
81+
.query-item-state {
7682
align-items: center;
7783
display: flex;
7884
flex: 0 0 auto;
@@ -82,7 +88,7 @@ export default defineComponent({
8288
width: 2rem;
8389
}
8490
85-
code {
91+
.query-item-code {
8692
font-size: 0.9em;
8793
padding: 0.5rem;
8894
}

src/devtools/components/QueryOptions.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export default defineComponent({
6161
},
6262
render() {
6363
const input = h("input", {
64+
class: "options-input",
6465
style: {
6566
backgroundColor: this.theme.inputBackgroundColor,
6667
color: this.theme.inputTextColor,
@@ -85,6 +86,7 @@ export default defineComponent({
8586
? h(
8687
"select",
8788
{
89+
class: "options-select",
8890
style: {
8991
backgroundColor: this.theme.inputBackgroundColor,
9092
color: this.theme.inputTextColor,
@@ -122,6 +124,7 @@ export default defineComponent({
122124
? h(
123125
"button",
124126
{
127+
class: "options-button",
125128
style: {
126129
background: this.theme.gray,
127130
},
@@ -151,13 +154,13 @@ export default defineComponent({
151154
});
152155
</script>
153156

154-
<style scoped>
157+
<style>
155158
.options-wrapper {
156159
align-items: center;
157160
display: flex;
158161
}
159162
160-
input {
163+
.options-input {
161164
border-radius: 0.2em;
162165
border: 0;
163166
flex: 1;
@@ -167,7 +170,7 @@ input {
167170
padding: 0.3em 0.4em;
168171
}
169172
170-
button {
173+
.options-button {
171174
appearance: none;
172175
background: #3f4e60;
173176
border-radius: 0.3em;
@@ -179,7 +182,7 @@ button {
179182
padding: 0.3rem 0.4rem;
180183
}
181184
182-
select {
185+
.options-select {
183186
--webkit-appearance: none;
184187
appearance: none;
185188
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>");

0 commit comments

Comments
 (0)