MCPcopy
hub / github.com/darkreader/darkreader / getSVGImageCSS

Function getSVGImageCSS

tests/inject/dynamic/image-analysis.tests.ts:29–41  ·  view source on GitHub ↗
(svg: string, width: number, height: number, selector: string)

Source from the content-addressed store, hash-verified

27}
28
29function getSVGImageCSS(svg: string, width: number, height: number, selector: string) {
30 return multiline(
31 `${selector} {`,
32 ` background-image: url("${svgToDataURL(svg)}");`,
33 ' background-position: center;',
34 ' background-repeat: no-repeat;',
35 ' background-size: cover;',
36 ' display: inline-block;',
37 ` height: ${height}px;`,
38 ` width: ${width}px;`,
39 '}',
40 );
41}
42
43const images = {
44 darkIcon: multiline(

Callers 1

Calls 2

multilineFunction · 0.90
svgToDataURLFunction · 0.85

Tested by

no test coverage detected