StartCSS modifies all CSS files in extractedAppsPath to change all colors value with CSS variables.
(extractedAppsPath string)
| 328 | // StartCSS modifies all CSS files in extractedAppsPath to change |
| 329 | // all colors value with CSS variables. |
| 330 | func 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 | |
| 347 | func colorVariableReplace(content string) string { |
| 348 | colorPatches := []Patch{ |
no test coverage detected