Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 3, 2022
1 parent 8b2f20c commit 90fdd07
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion interactive/components/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { evaluateUserConfig } from '@unocss/shared-docs'
import type { UserConfig } from '@unocss/core'
import CodeMirror from '../../packages/inspector/client/components/CodeMirror.vue'
const raw = $ref(userConfigRaw.value)
const raw = $ref(userConfigRaw.value || defaultConfigStr)
let config = $ref<UserConfig | undefined>()
let error = $ref<Error | undefined>()
let isLoading = $ref(true)
Expand Down
2 changes: 2 additions & 0 deletions interactive/components/TheNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import { currentTab, isCompact, toggleCompact, uno } from '~/composables/state'
<div flex-auto />
<div row gap4 text="lg gray4" items-center>
<template v-if="currentTab === 'search'">
<!-- TODO -->
<button
v-if="false"
class="i-carbon-settings-adjust"
title="Config"
@click="currentTab = 'config'"
Expand Down
17 changes: 6 additions & 11 deletions packages/preset-icons/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,17 @@ const COLLECTION_NAME_PARTS_MAX = 3
export { IconsOptions }

async function lookupIconLoader(): Promise<UniversalIconLoader> {
let useIconLoader: UniversalIconLoader | undefined
if (isNode && !isVSCode) {
try {
useIconLoader = await import('@iconify/utils/lib/loader/node-loader').then(i => i?.loadNodeIcon)
return await import('@iconify/utils/lib/loader/node-loader').then(i => i?.loadNodeIcon)
}
catch {
try {
useIconLoader = require('@iconify/utils/lib/loader/node-loader.cjs')
}
catch {
useIconLoader = loadIcon
}
catch {}
try {
return require('@iconify/utils/lib/loader/node-loader.cjs')
}
catch {}
}

return useIconLoader ?? loadIcon
return loadIcon
}

export const preset = (options: IconsOptions = {}): Preset => {
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/preset-icons.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ exports[`preset-icons > icon unit fixtures 1`] = `
.dark .dark\\\\:i-carbon-moon,
.dark .dark\\\\:i-carbon-moon\\\\?auto{--un-icon:url(\\"data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3Z'/%3E%3C/svg%3E\\");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}
.dark .dark\\\\:i-carbon-moon\\\\?bg{background:url(\\"data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 32 32' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3Z'/%3E%3C/svg%3E\\") no-repeat;background-size:100% 100%;background-color:transparent;width:1em;height:1em;}
.i-carbon-sun{--un-icon:url(\\"data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 32 32' width='2rem' height='2rem' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z'/%3E%3C/svg%3E\\");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:2rem;height:2rem;}
.i-carbon-sun\\\\?bg{background:url(\\"data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 32 32' width='2rem' height='2rem' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z'/%3E%3C/svg%3E\\") no-repeat;background-size:100% 100%;background-color:transparent;width:2rem;height:2rem;}"
.i-carbon-sun{--un-icon:url(\\"data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 32 32' width='2rem' height='2rem' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z'/%3E%3C/svg%3E\\");mask:var(--un-icon) no-repeat;mask-size:100% 100%;-webkit-mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;background-color:currentColor;width:1em;height:1em;}
.i-carbon-sun\\\\?bg{background:url(\\"data:image/svg+xml;utf8,%3Csvg preserveAspectRatio='xMidYMid meet' viewBox='0 0 32 32' width='2rem' height='2rem' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6ZM5.394 6.813L6.81 5.399l3.505 3.506L8.9 10.319zM2 15.005h5v2H2zm3.394 10.193L8.9 21.692l1.414 1.414l-3.505 3.506zM15 25.005h2v5h-2zm6.687-1.9l1.414-1.414l3.506 3.506l-1.414 1.414zm3.313-8.1h5v2h-5zm-3.313-6.101l3.506-3.506l1.414 1.414l-3.506 3.506zM15 2.005h2v5h-2z'/%3E%3C/svg%3E\\") no-repeat;background-size:100% 100%;background-color:transparent;width:1em;height:1em;}"
`;

0 comments on commit 90fdd07

Please sign in to comment.