MCPcopy Create free account
hub / github.com/nuxt/icon / getCSS

Function getCSS

src/runtime/components/css.ts:111–126  ·  view source on GitHub ↗
(icon: IconifyIcon, withLayer = true)

Source from the content-addressed store, hash-verified

109 const selector = computed(() => '.' + escapeCssSelector(cssClass.value))
110
111 function getCSS(icon: IconifyIcon, withLayer = true) {
112 let iconSelector = selector.value
113 if (options.cssWherePseudo) {
114 iconSelector = `:where(${iconSelector})`
115 }
116
117 const css = getIconCSS(icon, {
118 iconSelector,
119 format: 'compressed',
120 customise: resolveCustomizeFn(props.customize, options.customize),
121 })
122 if (options.cssLayer && withLayer) {
123 return `@layer ${options.cssLayer} { ${css} }`
124 }
125 return css
126 }
127
128 if (import.meta.client) {
129 const selectors = getAllSelectors()

Callers 2

mountCSSFunction · 0.85
setupFunction · 0.85

Calls 1

resolveCustomizeFnFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…