aboutsummaryrefslogtreecommitdiff
path: root/data.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-11-13 11:02:23 +0100
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me>2024-11-13 11:02:23 +0100
commit7219e5bdf1cd32a75321463449f371e389767ee4 (patch)
treee44b3f5df0c7850388fc0810906bd7df79873a6c /data.go
parentc8ea8d4cd3ca9ef1c0f2e3c42ad11224d19386b9 (diff)
feat(style): custom colors for default buttons
Diffstat (limited to 'data.go')
-rw-r--r--data.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/data.go b/data.go
index c4f9354..c5c98c3 100644
--- a/data.go
+++ b/data.go
@@ -29,6 +29,7 @@ type Tag struct {
type Color struct {
Background *BackgroundColor `json:"background"`
+ Button *ButtonColor `json:"buttons"`
Text string `json:"text"`
}
@@ -41,6 +42,13 @@ type BackgroundColor struct {
} `json:"colors"`
}
+type ButtonColor struct {
+ Text string `json:"text"`
+ TextHover string `json:"text_hover"`
+ Background string `json:"background"`
+ BackgroundHover string `json:"background_hover"`
+}
+
type Link struct {
Link string `json:"link"`
Content string `json:"content"`
@@ -76,6 +84,14 @@ func (c *Config) GetTextColor() template.CSS {
return template.CSS("--text-color: " + c.Color.Text + ";")
}
+func (b *ButtonColor) GetTextColor() template.CSS {
+ return template.CSS("--text-color: " + b.Text + ";--text-color-hover: " + b.TextHover + ";")
+}
+
+func (b *ButtonColor) GetBackground() template.CSS {
+ return template.CSS("--background: " + b.Background + ";--background-hover: " + b.BackgroundHover + ";")
+}
+
func (l *Link) GetLinkColor() template.CSS {
return template.CSS("--text-color: " + l.TextColor + ";--text-color-hover: " + l.TextColorHover + ";")
}