5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 20:03:01 +08:00

inject default css if none given

This commit is contained in:
Lea Anthony 2019-01-15 18:50:26 +11:00
parent 83e063bf2b
commit 7135d4fa27
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
4 changed files with 52 additions and 6 deletions

File diff suppressed because one or more lines are too long

39
assets/default/wails.css Normal file

File diff suppressed because one or more lines are too long

View File

@ -141,6 +141,12 @@ func (h *Headless) start(conn *websocket.Conn) {
}
h.log.DebugFields("Inject User CSS", Fields{"css": outputCSS})
h.injectCSS(h.appConfig.CSS)
} else {
// Use default wails css
h.log.Debug("Injecting Default Wails CSS")
defaultCSS := BoxString(&defaultAssets, "wails.css")
h.injectCSS(defaultCSS)
}
// Inject all the CSS files that have been added

View File

@ -208,6 +208,12 @@ func (w *webViewRenderer) Run() error {
}
w.log.DebugFields("Inject User CSS", Fields{"css": outputCSS})
w.injectCSS(w.config.CSS)
} else {
// Use default wails css
w.log.Debug("Injecting Default Wails CSS")
defaultCSS := BoxString(&defaultAssets, "wails.css")
w.injectCSS(defaultCSS)
}
// Inject all the CSS files that have been added