MCPcopy
hub / github.com/spicetify/cli / StartCSS

Function StartCSS

src/preprocess/preprocess.go:330–345  ·  view source on GitHub ↗

StartCSS modifies all CSS files in extractedAppsPath to change all colors value with CSS variables.

(extractedAppsPath string)

Source from the content-addressed store, hash-verified

328// StartCSS modifies all CSS files in extractedAppsPath to change
329// all colors value with CSS variables.
330func StartCSS(extractedAppsPath string) {
331 appPath := filepath.Join(extractedAppsPath, "xpui")
332 filepath.Walk(appPath, func(path string, info os.FileInfo, err error) error {
333 // temp so text won't be black ._.
334 if strings.HasPrefix(info.Name(), "pip-mini-player") && strings.HasSuffix(info.Name(), ".css") {
335 return nil
336 }
337
338 if filepath.Ext(info.Name()) == ".css" {
339 utils.ModifyFile(path, func(content string) string {
340 return colorVariableReplace(content)
341 })
342 }
343 return nil
344 })
345}
346
347func colorVariableReplace(content string) string {
348 colorPatches := []Patch{

Callers 1

BackupFunction · 0.92

Calls 2

ModifyFileFunction · 0.92
colorVariableReplaceFunction · 0.85

Tested by

no test coverage detected