theme

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Index

Constants

View Source
const KeyNew = "new"

Variables

View Source
var ThemeDefault = func() *Theme {
	nbl := "#8eb6bd"
	if o := util.GetEnv("app_nav_color_light"); o != "" {
		nbl = o
	}
	nbd := "#495f64"
	if o := util.GetEnv("app_nav_color_dark"); o != "" {
		nbd = o
	}

	return &Theme{
		Key: "default",
		Light: &Colors{
			Border: "1px solid #dddddd", LinkDecoration: "none",
			Foreground: "#000000", ForegroundMuted: "#999999",
			Background: "#ffffff", BackgroundMuted: "#eeeeee",
			LinkForeground: "#2d414e", LinkVisitedForeground: "#406379",
			NavForeground: "#000000", NavBackground: nbl,
			MenuForeground: "#000000", MenuBackground: "#c1e3e8", MenuSelectedBackground: "#8eb6bd", MenuSelectedForeground: "#000000",
			ModalBackdrop: "rgba(77, 77, 77, .7)", Success: "#008000", Error: "#ff0000",
		},
		Dark: &Colors{
			Border: "1px solid #666666", LinkDecoration: "none",
			Foreground: "#ffffff", ForegroundMuted: "#999999",
			Background: "#121212", BackgroundMuted: "#333333",
			LinkForeground: "#2d414e", LinkVisitedForeground: "#aaaaaa",
			NavForeground: "#ffffff", NavBackground: nbd,
			MenuForeground: "#eeeeee", MenuBackground: "#171f24", MenuSelectedBackground: "#333333", MenuSelectedForeground: "#ffffff",
			ModalBackdrop: "rgba(33, 33, 33, .7)", Success: "#008000", Error: "#ff0000",
		},
	}
}()

Functions

This section is empty.

Types

type Colors

type Colors struct {
	Border         string `json:"brd"`
	LinkDecoration string `json:"ld"`

	Foreground      string `json:"fg"`
	ForegroundMuted string `json:"fgm"`
	Background      string `json:"bg"`
	BackgroundMuted string `json:"bgm"`

	LinkForeground        string `json:"lf"`
	LinkVisitedForeground string `json:"lvf"`

	NavForeground string `json:"nf"`
	NavBackground string `json:"nb"`

	MenuForeground         string `json:"mf"`
	MenuBackground         string `json:"mb"`
	MenuSelectedForeground string `json:"msf"`
	MenuSelectedBackground string `json:"msb"`

	ModalBackdrop string `json:"mbd"`
	Success       string `json:"ok"`
	Error         string `json:"err"`
}

func (*Colors) ApplyMap

func (c *Colors) ApplyMap(m util.ValueMap, prefix string) *Colors

func (*Colors) CSS

func (c *Colors) CSS(key string, indent int) string

func (*Colors) Clone

func (c *Colors) Clone() *Colors

func (*Colors) Equals

func (c *Colors) Equals(x *Colors) bool

nolint

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(files filesystem.FileLoader) *Service

func (*Service) All

func (s *Service) All(logger util.Logger) Themes

func (*Service) Clear

func (s *Service) Clear()

func (*Service) Get

func (s *Service) Get(theme string, logger util.Logger) *Theme

func (*Service) Save

func (s *Service) Save(t *Theme, logger util.Logger) error

type Theme

type Theme struct {
	Key   string  `json:"-"`
	Light *Colors `json:"light"`
	Dark  *Colors `json:"dark"`
	// contains filtered or unexported fields
}

func ApplyMap

func ApplyMap(frm util.ValueMap) *Theme

func (*Theme) CSS

func (t *Theme) CSS(indent int) string

func (*Theme) Clone

func (t *Theme) Clone(key string) *Theme

func (*Theme) Equals

func (t *Theme) Equals(x *Theme) bool

type Themes

type Themes []*Theme

func (Themes) Replace

func (t Themes) Replace(n *Theme) Themes

func (Themes) Sort

func (t Themes) Sort()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL