Skip to content

Commit 5f2e159

Browse files
committed
DEV-438: update styling to match website design; revert previous commit; DEV-435: Add Save button
1 parent f95903c commit 5f2e159

File tree

11 files changed

+319
-54
lines changed

11 files changed

+319
-54
lines changed

src/background.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ async function detectVue (tabId, url, force = false) {
8888
})
8989
}
9090
} else if (hasVue) {
91-
browser.browserAction.setIcon({
92-
tabId,
93-
path: 'icons/icon-128.png'
94-
})
9591
await analyze(tabId, url)
9692
} else {
9793
store.commit('SET_SHOWCASE', 'noVue')

src/components/AppButton.vue

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<template>
2+
<component
3+
:is="tag"
4+
:href="href"
5+
:class="[
6+
sizing.height,
7+
sizing.fontSize,
8+
sizing.rounded,
9+
sizing.padding,
10+
color.bg,
11+
color.text,
12+
color.outline,
13+
color.hoverState
14+
]"
15+
class="inline-flex items-center font-bold-body-weight focus:outline-none border-2 border-transparent"
16+
>
17+
<slot></slot>
18+
</component>
19+
</template>
20+
21+
<script>
22+
export default {
23+
props: {
24+
size: {
25+
type: String,
26+
default: 'base'
27+
},
28+
appearance: {
29+
type: String,
30+
default: ''
31+
},
32+
tag: {
33+
type: String,
34+
default: 'button'
35+
},
36+
outlined: {
37+
type: Boolean,
38+
default: false
39+
},
40+
href: {
41+
type: String,
42+
default: null
43+
}
44+
},
45+
computed: {
46+
sizing () {
47+
if (this.size === 'small') {
48+
return {
49+
height: 'h-8',
50+
fontSize: 'text-sm',
51+
rounded: 'rounded-md',
52+
padding: 'px-4'
53+
}
54+
} else if (this.size === 'large') {
55+
return {
56+
height: 'h-12',
57+
fontSize: 'text-eight',
58+
rounded: 'rounded-3lg',
59+
padding: 'px-6'
60+
}
61+
} else {
62+
return {
63+
height: 'h-10',
64+
fontSize: 'text-base',
65+
rounded: 'rounded-2lg',
66+
padding: 'px-4'
67+
}
68+
}
69+
},
70+
color () {
71+
if (this.appearance === 'transparent') {
72+
return {
73+
bg: '',
74+
text: '',
75+
outline: '',
76+
hoverState: 'hover:text-primary-500'
77+
}
78+
} else if (this.appearance === 'primary') {
79+
if (this.outlined) {
80+
return {
81+
// bg: 'bg-primary-500',
82+
text: 'text-primary-500',
83+
outline: 'border-primary-500',
84+
hoverState: 'hover:bg-primary-50 hover:border-primary-300'
85+
}
86+
} else {
87+
return {
88+
bg: 'bg-primary-500',
89+
text: 'text-white',
90+
outline: 'focus:border-primary-700',
91+
hoverState: 'hover:bg-primary-400'
92+
}
93+
}
94+
} else if (this.appearance === 'danger') {
95+
return {
96+
bg: 'bg-red-500',
97+
text: 'text-white'
98+
}
99+
} else if (this.appearance === 'warning') {
100+
return {
101+
bg: 'bg-yellow-500',
102+
text: 'text-grey-900'
103+
}
104+
} else if (this.appearance === 'success') {
105+
return {
106+
bg: 'bg-green-500',
107+
text: 'text-white'
108+
}
109+
} else if (this.appearance === 'info') {
110+
if (this.outlined) {
111+
return {
112+
// bg: 'bg-blue-500',
113+
text: 'text-blue-900',
114+
outline: 'border-blue-900'
115+
}
116+
} else {
117+
return {
118+
bg: 'bg-blue-500',
119+
text: 'text-white',
120+
outline: 'focus:border-blue-900',
121+
hoverState: 'hover:bg-blue-400'
122+
}
123+
}
124+
} else {
125+
return {
126+
bg: 'bg-grey-200',
127+
text: 'text-grey-900',
128+
outline: 'focus:border-grey-700'
129+
}
130+
}
131+
}
132+
}
133+
}
134+
</script>
135+
136+
<style></style>

src/components/ListBlock.vue renamed to src/components/ExploreDataItem.vue

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
<template>
2-
<component :is="href ? 'a' : 'div'" :href="href" target="_blank" class="flex items-center">
3-
<div class="relative w-full h-full">
2+
<component
3+
:is="tag"
4+
class="w-full sm:w-1/2 md:w-1/3 max-w-sm m-auto sm:m-0"
5+
>
6+
<div class="relative w-full h-full pt-0">
47
<div
5-
class="flex flex-col items-center justify-between bg-grey-50 rounded-xl border-2 border-grey-200"
8+
:class="[tag === 'a' && 'hover:bg-grey-100']"
9+
class="flex flex-col items-center justify-between bg-grey-50 rounded-xl pb-2 pr-2 w-full h-full border-2 border-grey-200"
610
>
711
<div
812
style="
913
border-radius: 0.75rem;
1014
border-bottom-left-radius: 0;
1115
border-top-right-radius: 0;
1216
"
13-
class="self-start bg-grey-200 px-3 rounded-xl rounded-bl-none rounded-tr-none text-xs uppercase leading-4 font-medium mb-2"
14-
>{{ label }}</div>
15-
<div class="flex items-center mb-2">
17+
class="self-start bg-grey-200 px-3 rounded-xl rounded-bl-none rounded-tr-none text-xs tracking-4 uppercase leading-sm font-bold-body-weight mb-2"
18+
>
19+
{{ label }}
20+
</div>
21+
<div class="flex items-center">
1622
<slot />
1723
</div>
1824
</div>
@@ -27,9 +33,9 @@ export default {
2733
type: String,
2834
default: ''
2935
},
30-
href: {
36+
tag: {
3137
type: String,
32-
default: null
38+
default: 'div'
3339
}
3440
}
3541
}
File renamed without changes.

src/manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
]
3434
},
3535
"permissions": [
36+
"tabs",
3637
"background",
3738
"storage",
3839
"https://*/*"

0 commit comments

Comments
 (0)