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

Function UserCSS

src/apply/apply.go:112–121  ·  view source on GitHub ↗

UserCSS creates colors.css user.css files in "xpui". To not use custom css, set `themeFolder` to blank string To use default color scheme, set `scheme` to `nil`

(appsFolderPath, themeFolder string, scheme map[string]string)

Source from the content-addressed store, hash-verified

110// To not use custom css, set `themeFolder` to blank string
111// To use default color scheme, set `scheme` to `nil`
112func UserCSS(appsFolderPath, themeFolder string, scheme map[string]string) {
113 colorsDest := filepath.Join(appsFolderPath, "xpui", "colors.css")
114 if err := os.WriteFile(colorsDest, []byte(getColorCSS(scheme)), 0700); err != nil {
115 utils.Fatal(err)
116 }
117 cssDest := filepath.Join(appsFolderPath, "xpui", "user.css")
118 if err := os.WriteFile(cssDest, []byte(getUserCSS(themeFolder)), 0700); err != nil {
119 utils.Fatal(err)
120 }
121}
122
123// UserAsset .
124func UserAsset(appsFolderPath, themeFolder string) {

Callers 1

refreshThemeCSSFunction · 0.92

Calls 3

FatalFunction · 0.92
getColorCSSFunction · 0.85
getUserCSSFunction · 0.85

Tested by

no test coverage detected