Skip to content

Commit

Permalink
feat: ui improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 29, 2024
1 parent 8bcd0e9 commit 854759a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
11 changes: 7 additions & 4 deletions components/ConfigItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ const extraConfigs = computed(() => {
<div flex="~ gap-2 items-center wrap">
<button
v-for="name, idx of Object.keys(config.plugins)"
:key="idx" border="~ base rounded" bg-gray:5 px2
:style="{ color: getPluginColor(name) }"
font-mono op75
:key="idx" border="~ base rounded-full" px3
:style="{ color: getPluginColor(name), backgroundColor: getPluginColor(name, 0.1) }"
font-mono
@click="gotoPlugin(name)"
>
{{ name }}
Expand Down Expand Up @@ -190,7 +190,10 @@ const extraConfigs = computed(() => {
<div p2 px3 op50 of-auto>
{{ k }}
</div>
<Shiki lang="ts" :code="stringifyUnquoted(v)" max-h-100 max-w-full w-full of-scroll rounded bg-hover p2 text-sm />
<Shiki
lang="ts" :code="stringifyUnquoted(v)"
max-h-100 max-w-full w-full of-scroll rounded bg-code p2 text-sm
/>
</div>
</template>
</div>
Expand Down
3 changes: 1 addition & 2 deletions components/RuleItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ function capitalize(str?: string) {
<div :class="props.class" flex="~ gap-2 items-center">
<div
of-hidden text-ellipsis
:class="[
rule.deprecated ? 'line-through' : '',
gridView ? 'op50 text-sm' : 'op75',
gridView ? 'op50 text-sm' : 'op75 ws-nowrap of-hidden text-ellipsis line-clamp-1',
]"
>
{{ capitalize(rule.docs?.description) }}
Expand Down
8 changes: 7 additions & 1 deletion components/RuleStateItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ function goto() {
Rule options
</div>
</div>
<Shiki lang="ts" :code="stringifyUnquoted(state.options)" rounded bg-hover p2 text-sm />
<Shiki
v-for="options, idx of state.options"
:key="idx"
lang="ts"
:code="stringifyUnquoted(options)"
rounded bg-code p2 text-sm
/>
</template>
</div>
</template>
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ export default defineNuxtConfig({
},

devtools: {
enabled: true,
enabled: false,
},
})
4 changes: 3 additions & 1 deletion plugins/floating-vue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import FloatingVue from 'floating-vue'

export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(FloatingVue)
nuxtApp.vueApp.use(FloatingVue, {
overflowPadding: 20,
})
})
1 change: 1 addition & 0 deletions uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default defineConfig({
shortcuts: {
'bg-base': 'bg-white dark:bg-#111',
'bg-glass': 'bg-white:75 dark:bg-#111:75 backdrop-blur-5',
'bg-code': 'bg-gray5:5',
'bg-hover': 'bg-gray:5',
'bg-active': 'bg-gray:10',
'border-base': 'border-#aaa3',
Expand Down

0 comments on commit 854759a

Please sign in to comment.