fix(ui): safelist settings entry icons (#2050)
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
|
import { safelistSettingsEntryIcons, sharedUnoConfig } from '../../../uno.config'
|
||||||
|
|
||||||
|
describe('settings entry icon safelist', () => {
|
||||||
|
it('keeps settings entry icons in the shared Uno safelist', () => {
|
||||||
|
const icons = safelistSettingsEntryIcons()
|
||||||
|
expect(icons).toEqual([
|
||||||
|
'i-solar:emoji-funny-square-bold-duotone',
|
||||||
|
'i-solar:people-nearby-bold-duotone',
|
||||||
|
'i-solar:leaf-bold-duotone',
|
||||||
|
'i-solar:armchair-2-bold-duotone',
|
||||||
|
'i-solar:database-bold-duotone',
|
||||||
|
'i-solar:wi-fi-router-bold-duotone',
|
||||||
|
'i-solar:layers-bold-duotone',
|
||||||
|
'i-solar:box-minimalistic-bold-duotone',
|
||||||
|
'i-solar:filters-bold-duotone',
|
||||||
|
])
|
||||||
|
|
||||||
|
const config = sharedUnoConfig()
|
||||||
|
const safelist = Array.isArray(config.safelist) ? config.safelist : []
|
||||||
|
expect(safelist).toEqual(expect.arrayContaining(icons))
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -66,6 +66,20 @@ export function safelistAllPrimaryBackgrounds(): string[] {
|
|||||||
}).flat()
|
}).flat()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function safelistSettingsEntryIcons(): string[] {
|
||||||
|
return [
|
||||||
|
'i-solar:emoji-funny-square-bold-duotone',
|
||||||
|
'i-solar:people-nearby-bold-duotone',
|
||||||
|
'i-solar:leaf-bold-duotone',
|
||||||
|
'i-solar:armchair-2-bold-duotone',
|
||||||
|
'i-solar:database-bold-duotone',
|
||||||
|
'i-solar:wi-fi-router-bold-duotone',
|
||||||
|
'i-solar:layers-bold-duotone',
|
||||||
|
'i-solar:box-minimalistic-bold-duotone',
|
||||||
|
'i-solar:filters-bold-duotone',
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
export function presetWebFontsFonts(provider: 'fontsource' | 'none'): Record<string, string | WebFontMeta | (string | WebFontMeta)[]> {
|
export function presetWebFontsFonts(provider: 'fontsource' | 'none'): Record<string, string | WebFontMeta | (string | WebFontMeta)[]> {
|
||||||
return {
|
return {
|
||||||
'sans': {
|
'sans': {
|
||||||
@@ -155,6 +169,7 @@ export function sharedUnoConfig() {
|
|||||||
safelist: [
|
safelist: [
|
||||||
...'prose prose-sm m-auto text-left'.split(' '),
|
...'prose prose-sm m-auto text-left'.split(' '),
|
||||||
...safelistAllPrimaryBackgrounds(),
|
...safelistAllPrimaryBackgrounds(),
|
||||||
|
...safelistSettingsEntryIcons(),
|
||||||
],
|
],
|
||||||
// hyoban/unocss-preset-shadcn: Use shadcn ui with UnoCSS
|
// hyoban/unocss-preset-shadcn: Use shadcn ui with UnoCSS
|
||||||
// https://github.com/hyoban/unocss-preset-shadcn
|
// https://github.com/hyoban/unocss-preset-shadcn
|
||||||
|
|||||||
Reference in New Issue
Block a user