Skip to content

Commit f0f8392

Browse files
authored
feat: align better with ESLint's design system (#16)
1 parent 258c2b5 commit f0f8392

File tree

7 files changed

+113
-20
lines changed

7 files changed

+113
-20
lines changed

app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ await ensureDataFetch()
1515
</script>
1616

1717
<template>
18-
<div v-if="errorInfo" grid h-full w-full place-content-center whitespace-pre-line>
18+
<div v-if="errorInfo" bg-base color-base grid h-full w-full place-content-center whitespace-pre-line>
1919
<div font-200 text-xl mb6>
2020
<a
2121
href="https://github.com/eslint/config-inspector" target="_blank"

components/NavBar.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ function toggleRuleView() {
3636
>
3737
<img src="/favicon.svg" inline-block h-1em> ESLint Config Inspector
3838
</a>
39-
<div op50 font-mono text-base inline-block translate-y--5 ml1>
39+
<a
40+
op50 font-mono text-base inline-block translate-y--5 ml1
41+
:href="`https://github.com/eslint/config-inspector/releases/tag/v${version}`" target="_blank"
42+
>
4043
v{{ version }}
41-
</div>
44+
</a>
4245
</div>
4346
<div v-if="payload.meta.configPath" flex="~ gap-1 items-center" text-sm my1>
4447
<span font-mono op35>{{ payload.meta.configPath }}</span>

components/RuleItem.vue

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { useClipboard } from '@vueuse/core'
3+
import { vTooltip } from 'floating-vue'
34
import { getRuleLevel } from '~/composables/rules'
45
import type { RuleConfigStates, RuleInfo, RuleLevel } from '~/composables/types'
56
@@ -93,11 +94,20 @@ function capitalize(str?: string) {
9394
</VDropdown>
9495
</div>
9596

96-
<div v-if="!gridView" grid="~ cols-2 items-center gap2" mx1>
97-
<div v-if="rule.fixable" title="Fixable" i-ph-hammer-duotone op35 />
97+
<div v-if="!gridView" grid="~ cols-2 items-center gap1" mx2>
98+
<div
99+
v-if="rule.docs?.recommended"
100+
v-tooltip="'✅ Recommended'"
101+
i-ph-check-square-duotone op50
102+
/>
98103
<div v-else />
99104

100-
<div v-if="rule.docs?.recommended" title="Recommended" i-ph-thumbs-up-duotone op35 />
105+
<div
106+
v-if="rule.fixable"
107+
v-tooltip="'🔧 Fixable'"
108+
i-ph-wrench-duotone op50
109+
/>
110+
<div v-else />
101111
</div>
102112

103113
<div :class="props.class" flex="~ gap-2 items-center">
@@ -122,8 +132,16 @@ function capitalize(str?: string) {
122132
<div v-if="rule.deprecated" border="~ red/25 rounded" bg-red:5 px1 text-xs text-red>
123133
DEPRECATED
124134
</div>
125-
<div v-if="rule.fixable" title="Fixable" i-ph-hammer-duotone op35 />
126-
<div v-if="rule.docs?.recommended" title="Recommended" i-ph-thumbs-up-duotone op35 />
135+
<div
136+
v-if="rule.docs?.recommended"
137+
v-tooltip="'✅ Recommended'"
138+
i-ph-check-square-duotone op50
139+
/>
140+
<div
141+
v-if="rule.fixable"
142+
v-tooltip="'🔧 Fixable'"
143+
i-ph-wrench-duotone op50
144+
/>
127145
</div>
128146
</div>
129147
</template>

pages/configs.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ debouncedWatch(
172172
v-model="input"
173173
placeholder="Test matching with filepath..."
174174
border="~ base rounded-full"
175-
w-full bg-transparent px3 py2 pl10 font-mono outline-none
175+
:class="input ? 'font-mono' : ''"
176+
w-full bg-transparent px3 py2 pl10 outline-none
176177
@focus="autoCompleteOpen = true"
177178
@click="autoCompleteOpen = true"
178179
@blur="autoCompleteBlur"

pages/rules.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ function resetFilters() {
8080
<div relative flex>
8181
<input
8282
v-model="filters.search"
83+
:class="filters.search ? 'font-mono' : ''"
8384
placeholder="Search rules..."
8485
border="~ base rounded-full"
85-
w-full bg-transparent px3 py2 pl10 font-mono outline-none
86+
w-full bg-transparent px3 py2 pl10 outline-none
8687
>
8788
<div absolute bottom-0 left-0 top-0 flex="~ items-center justify-center" p4 op50>
8889
<div i-ph-magnifying-glass-duotone />

styles/global.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ html, body , #__nuxt{
44
padding: 0;
55
}
66

7+
body {
8+
--at-apply: bg-base color-base font-sans;
9+
}
10+
711
html.dark {
8-
background: #111;
9-
color: white;
1012
color-scheme: dark;
1113
}
1214

@@ -25,7 +27,7 @@ html.dark .shiki span {
2527
/* Overrides Floating Vue */
2628
.v-popper--theme-dropdown .v-popper__inner,
2729
.v-popper--theme-tooltip .v-popper__inner {
28-
--at-apply: bg-base text-black dark:text-white rounded border border-base shadow;
30+
--at-apply: bg-base color-base font-sans rounded border border-base shadow;
2931
box-shadow: 0 6px 30px #0000001a;
3032
}
3133

uno.config.ts

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import {
1111

1212
export default defineConfig({
1313
shortcuts: {
14-
'bg-base': 'bg-white dark:bg-#111',
15-
'bg-glass': 'bg-white:75 dark:bg-#111:75 backdrop-blur-5',
14+
'color-base': 'color-neutral-500 dark:color-neutral-300',
15+
'bg-base': 'bg-white dark:bg-neutral-900',
16+
'bg-glass': 'bg-white:75 dark:bg-neutral-900:75 backdrop-blur-5',
1617
'bg-code': 'bg-gray5:5',
1718
'bg-hover': 'bg-gray:5',
1819
'bg-active': 'bg-gray:10',
@@ -24,9 +25,77 @@ export default defineConfig({
2425
'action-button': 'border border-base rounded flex gap-2 items-center px2 py1 text-sm op75 hover:op100 hover:bg-hover',
2526
},
2627
theme: {
28+
// Reference: https://github.com/eslint/eslint.org/blob/main/src/assets/scss/tokens/themes.scss
2729
colors: {
28-
primary: '#4B32C3',
29-
accent: '#8080F2',
30+
neutral: {
31+
25: '#FCFCFD',
32+
50: '#F9FAFB',
33+
100: '#F2F4F7',
34+
200: '#E4E7EC',
35+
300: '#D0D5DD',
36+
400: '#98A2B3',
37+
500: '#667085',
38+
600: '#475467',
39+
700: '#344054',
40+
800: '#1D2939',
41+
900: '#101828',
42+
},
43+
44+
primary: {
45+
25: '#FBFBFF',
46+
50: '#F6F6FE',
47+
100: '#ECECFD',
48+
200: '#DEDEFF',
49+
300: '#CCCCFA',
50+
400: '#B7B7FF',
51+
500: '#A0A0F5',
52+
600: '#8080F2',
53+
700: '#6358D4',
54+
800: '#4B32C3',
55+
900: '#341BAB',
56+
},
57+
58+
warning: {
59+
25: '#FFFCF5',
60+
50: '#FFFAEB',
61+
100: '#FEF0C7',
62+
200: '#FEDF89',
63+
300: '#FEC84B',
64+
400: '#FDB022',
65+
500: '#F79009',
66+
600: '#DC6803',
67+
700: '#B54708',
68+
800: '#93370D',
69+
900: '#7A2E0E',
70+
},
71+
72+
success: {
73+
25: '#F6FEF9',
74+
50: '#ECFDF3',
75+
100: '#D1FADF',
76+
200: '#A6F4C5',
77+
300: '#6CE9A6',
78+
400: '#32D583',
79+
500: '#12B76A',
80+
600: '#039855',
81+
700: '#027A48',
82+
800: '#05603A',
83+
900: '#054F31',
84+
},
85+
86+
rose: {
87+
25: '#FFF5F6',
88+
50: '#FFF1F3',
89+
100: '#FFE4E8',
90+
200: '#FECDD6',
91+
300: '#FEA3B4',
92+
400: '#FD6F8E',
93+
500: '#F63D68',
94+
600: '#E31B54',
95+
700: '#C01048',
96+
800: '#A11043',
97+
900: '#89123E',
98+
},
3099
},
31100
},
32101
presets: [
@@ -38,9 +107,8 @@ export default defineConfig({
38107
presetTypography(),
39108
presetWebFonts({
40109
fonts: {
41-
sans: 'DM Sans',
42-
serif: 'DM Serif Display',
43-
mono: 'DM Mono',
110+
sans: 'Inter',
111+
mono: 'Space Mono',
44112
},
45113
}),
46114
],

0 commit comments

Comments
 (0)