Support color customization from the admin (#2338)
* Add user-customizable theming. Closes #1915 * Prettified Code! * Add user-customizable theming. Closes #1915 * Add explicit color for page content background * Prettified Code! Co-authored-by: gabek <gabek@users.noreply.github.com>
This commit is contained in:
@@ -67,6 +67,7 @@ const (
|
||||
hasConfiguredInitialNotificationsKey = "has_configured_initial_notifications"
|
||||
hideViewerCountKey = "hide_viewer_count"
|
||||
customOfflineMessageKey = "custom_offline_message"
|
||||
customColorVariableValuesKey = "custom_color_variable_values"
|
||||
)
|
||||
|
||||
// GetExtraPageBodyContent will return the user-supplied body content.
|
||||
@@ -932,3 +933,14 @@ func GetCustomOfflineMessage() string {
|
||||
func SetCustomOfflineMessage(message string) error {
|
||||
return _datastore.SetString(customOfflineMessageKey, message)
|
||||
}
|
||||
|
||||
// SetCustomColorVariableValues sets CSS variable names and values.
|
||||
func SetCustomColorVariableValues(variables map[string]string) error {
|
||||
return _datastore.SetStringMap(customColorVariableValuesKey, variables)
|
||||
}
|
||||
|
||||
// GetCustomColorVariableValues gets CSS variable names and values.
|
||||
func GetCustomColorVariableValues() map[string]string {
|
||||
values, _ := _datastore.GetStringMap(customColorVariableValuesKey)
|
||||
return values
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user