修复bug
This commit is contained in:
parent
ccfe077947
commit
cb3d043c90
|
@ -11,6 +11,9 @@ func (h *handle) colorSchemeCss() string {
|
||||||
s := slice.Filter([]string{h.calColorSchemeCss(), h.calSidebarTextColorCss(), h.calHeaderBackgroundColorCss()}, func(s string) bool {
|
s := slice.Filter([]string{h.calColorSchemeCss(), h.calSidebarTextColorCss(), h.calHeaderBackgroundColorCss()}, func(s string) bool {
|
||||||
return s != ""
|
return s != ""
|
||||||
})
|
})
|
||||||
|
if len(s) < 1 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
return fmt.Sprintf(`<style id='%s-inline-css'%s>\n%s\n</style>`, "twentyfifteen-style", "", strings.Join(s, "\n"))
|
return fmt.Sprintf(`<style id='%s-inline-css'%s>\n%s\n</style>`, "twentyfifteen-style", "", strings.Join(s, "\n"))
|
||||||
}
|
}
|
||||||
func (h *handle) calColorSchemeCss() (r string) {
|
func (h *handle) calColorSchemeCss() (r string) {
|
||||||
|
@ -44,7 +47,7 @@ func (h *handle) calColorSchemeCss() (r string) {
|
||||||
|
|
||||||
func (h *handle) calSidebarTextColorCss() (r string) {
|
func (h *handle) calSidebarTextColorCss() (r string) {
|
||||||
colors := h.getColorScheme()
|
colors := h.getColorScheme()
|
||||||
if h.IndexHandle.ThemeMods.SidebarTextcolor != "" && h.IndexHandle.ThemeMods.SidebarTextcolor == colors[4] {
|
if h.IndexHandle.ThemeMods.SidebarTextcolor == "" || h.IndexHandle.ThemeMods.SidebarTextcolor == colors[4] {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
linkColorRgb := Hex2RgbUint8(h.IndexHandle.ThemeMods.SidebarTextcolor)
|
linkColorRgb := Hex2RgbUint8(h.IndexHandle.ThemeMods.SidebarTextcolor)
|
||||||
|
@ -58,7 +61,7 @@ func (h *handle) calSidebarTextColorCss() (r string) {
|
||||||
|
|
||||||
func (h *handle) calHeaderBackgroundColorCss() (r string) {
|
func (h *handle) calHeaderBackgroundColorCss() (r string) {
|
||||||
colors := h.getColorScheme()
|
colors := h.getColorScheme()
|
||||||
if h.IndexHandle.ThemeMods.HeaderBackgroundColor != "" && h.IndexHandle.ThemeMods.HeaderBackgroundColor == colors[1] {
|
if h.IndexHandle.ThemeMods.HeaderBackgroundColor == "" || h.IndexHandle.ThemeMods.HeaderBackgroundColor == colors[1] {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
r = fmt.Sprintf(headerBackgroundColorCssTemplate, h.IndexHandle.ThemeMods.HeaderBackgroundColor, h.IndexHandle.ThemeMods.HeaderBackgroundColor)
|
r = fmt.Sprintf(headerBackgroundColorCssTemplate, h.IndexHandle.ThemeMods.HeaderBackgroundColor, h.IndexHandle.ThemeMods.HeaderBackgroundColor)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user