MCPcopy Index your code
hub / github.com/stenciljs/core / normalizeCSS

Function normalizeCSS

src/utils/test/scope-css.spec.ts:20–28  ·  view source on GitHub ↗
(css: string)

Source from the content-addressed store, hash-verified

18
19describe('scopeCSS', function () {
20 function normalizeCSS(css: string): string {
21 return css
22 .replace(/\s+/g, ' ')
23 .replace(/:\s/g, ':')
24 .replace(/'/g, '"')
25 .replace(/ }/g, '}')
26 .replace(/url\((\"|\s)(.+)(\"|\s)\)(\s*)/g, (...match: string[]) => `url("${match[2]}")`)
27 .replace(/\[(.+)=([^"\]]+)\]/g, (...match: string[]) => `[${match[1]}="${match[2]}"]`);
28 }
29
30 function s(cssText: string, scopeId: string, commentOriginalSelector = false) {
31 const shim = scopeCss(cssText, scopeId, commentOriginalSelector);

Callers 1

sFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected