css

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package css provides CSS Go definitions.

Index

Constants

View Source
const (
	AlignLeft    Align = "left"
	AlignRight         = "right"
	AlignCenter        = "center"
	AlignJustify       = "justify"
)
View Source
const (
	BorderNone   BorderStyleKind = "none"
	BorderHidden                 = "hidden"
	BorderDotted                 = "dotted"
	BorderDashed                 = "dashed"
	BorderSolid                  = "solid"
	BorderDouble                 = "double"
	BorderGroove                 = "groove"
	BorderRidge                  = "ridge"
	BorderInset                  = "inset"
	BorderOutset                 = "outset"
)
View Source
const (
	Transparent    Color = "transparent"
	Black                = "black"
	CadetBlue            = "cadetblue"
	CornflowerBlue       = "cornflowerblue"
	Cyan                 = "cyan"
	DarkSlateGrey        = "darkslategrey"
	Salmon               = "salmon"
	Thistle              = "thistle"
	White                = "white"
	WhiteSmoke           = "whitesmoke"
)
View Source
const (
	BottomLeft  Corner = "BottomLeft"
	BottomRight        = "BottomRight"
	TopLeft            = "TopLeft"
	TopRight           = "TopRight"
)
View Source
const (
	CursorAlias        CursorKind = "alias"
	CursorScroll                  = "all-scroll"
	CursorCell                    = "cell"
	CursorContext                 = "context-menu"
	CursorCopy                    = "copy"
	CursorCross                   = "crosshair"
	CursorDefault                 = "default"
	CursorHelp                    = "help"
	CursorMove                    = "move"
	CursorNodrop                  = "no-drop"
	CursorNone                    = "none"
	CursorInvalid                 = "not-allowed"
	CursorPointer                 = "pointer"
	CursorProgress                = "progress"
	CursorResizeCol               = "col-resize"
	CursorResizeRow               = "row-resize"
	CursorResizeE                 = "e-resize"
	CursorResizeEW                = "ew-resize"
	CursorResizeN                 = "n-resize"
	CursorResizeNE                = "ne-resize"
	CursorResizeNESW              = "nesw-resize"
	CursorResizeNS                = "ns-resize"
	CursorResizeNW                = "nw-resize"
	CursorResizeNWSE              = "nwse-resize"
	CursorResizeS                 = "s-resize"
	CursorResizeSE                = "se-resize"
	CursorResizeSW                = "sw-resize"
	CursorResizeW                 = "w-resize"
	CursorText                    = "text"
	CursorTextVertical            = "vertical-text"
	CursorWait                    = "wait"
	CursorZoomIn                  = "zoom-in"
	CursorZoomOut                 = "zoom-out"
)
View Source
const (
	DisplayBlock       DisplayKind = "block"
	DisplayFlex                    = "flex"
	DisplayGrid                    = "grid"
	DisplayInline                  = "inline"
	DisplayInlineBlock             = "inline-block"
	DisplayInlineFlex              = "inline-flex"
	DisplayInlineGrid              = "inline-grid"
	DisplayInlineTable             = "inline-table"
	DisplayNone                    = "none"
	DisplayTable                   = "table"
	DisplayTableCell               = "table-cell"
	DisplayTableRow                = "table-row"
)
View Source
const (
	FloatNone  FloatKind = "none"
	FloatLeft            = "left"
	FloatRight           = "right"
)
View Source
const (
	PositionAbsolute PositionKind = "absolute"
	PositionFixed                 = "fixed"
	PositionRelative              = "relative"
	PositionStatic                = "static"
	PositionSticky                = "sticky"
)
View Source
const (
	ResizeNone       ResizeKind = "none"
	ResizeBoth                  = "both"
	ResizeHorizontal            = "horizontal"
	ResizeVertical              = "vertical"
)
View Source
const (
	Bottom Side = "Bottom"
	Left        = "Left"
	Right       = "Right"
	Top         = "Top"
)
View Source
const (
	SpaceNormal  SpaceKind = "normal"
	SpaceNoWrap            = "nowrap"
	SpacePre               = "pre"
	SpacePreLine           = "pre-line"
	SpacePreWrap           = "pre-wrap"
)
View Source
const (
	// absolute units
	CM = "cm"
	MM = "mm"
	IN = "in" // 1in = 96px = 2.54cm
	PX = "px" // 1px = 1/96in
	PT = "pt" // 1pt = 1/72in
	PC = "pc" // 1pc = 1/6in
	//relative units
	EM   = "em"   // current font-size
	EX   = "ex"   // x-height of current font
	CH   = "ch"   // width of "0"
	REM  = "rem"  // root element font-size
	VW   = "vm"   // 1% of window width
	VH   = "vh"   // 1% of window height
	VMIN = "vmin" // min(vm, vh)
	VMAX = "vmax" // max(vm, vh)
	PCT  = "%"    // percentage of parent element
)
View Source
const (
	VBaseline   VAlign = "baseline"
	VBottom            = "bottom"
	VMiddle            = "middle"
	VTop               = "top"
	VTextBottom        = "text-bottom"
	VTextTop           = "text-top"
	VSub               = "sub"
	VSuper             = "super"
)

Variables

View Source
var SideAll []Side = []Side{Bottom, Left, Right, Top}

Functions

This section is empty.

Types

type Align

type Align string

type BorderStyleKind

type BorderStyleKind string

type Color

type Color string

type Corner

type Corner string

type CursorKind

type CursorKind string

type DisplayKind

type DisplayKind string

type FloatKind

type FloatKind string

type FontStyleKind

type FontStyleKind string
const (
	FontStyleItalic FontStyleKind = "italic"
	FontStyleNormal               = "normal"
)

type FontWeightKind

type FontWeightKind string
const (
	FontWeightBold   FontWeightKind = "bold"
	FontWeightNormal                = "normal"
)

type Length

type Length string
const (
	LengthAuto Length = "auto"
)

func LengthOf

func LengthOf(val uint16, unit Unit) Length

type PositionKind

type PositionKind string

type ResizeKind

type ResizeKind string

type Side

type Side string

type SpaceKind

type SpaceKind string

type Style

type Style map[string]string

func AlignText

func AlignText(val Align) Style

func AlignVertical

func AlignVertical(val VAlign) Style

func AlignVerticalL

func AlignVerticalL(val uint16, unit Unit) Style

func BackgroundColor

func BackgroundColor(color Color) Style

func Border

func Border(width uint16, unit Unit, style BorderStyleKind, color Color, sides ...Side) Style

func BorderCollapse

func BorderCollapse(val bool) Style

func BorderColor

func BorderColor(color Color, sides ...Side) Style

func BorderRadius

func BorderRadius(val uint16, unit Unit, corners ...Corner) Style

func BorderStyle

func BorderStyle(style BorderStyleKind, sides ...Side) Style

func BorderWidth

func BorderWidth(width uint16, unit Unit, sides ...Side) Style

func Cursor

func Cursor(val CursorKind) Style

func Display

func Display(val DisplayKind) Style

func Float

func Float(val FloatKind) Style

func Font

func Font(name string) Style

Font sets the css font family. Quotes the name.

func FontSize

func FontSize(size uint16, unit Unit) Style

func FontStyle

func FontStyle(val FontStyleKind) Style

func FontWeight

func FontWeight(val FontWeightKind) Style

func Grid

func Grid(rows []Length, cols []Length) Style

func GridArea

func GridArea(rowStart, rowSpan, colStart, colSpan uint16) Style

Indices start at 0.

func GridAreaCol

func GridAreaCol(start, span uint16) Style

func GridAreaRow

func GridAreaRow(start, span uint16) Style

func GridCols

func GridCols(cols ...Length) Style

func GridRows

func GridRows(rows ...Length) Style

func Height

func Height(val uint16, unit Unit) Style

func HeightMax

func HeightMax(val uint16, unit Unit) Style

func HeightMin

func HeightMin(val uint16, unit Unit) Style

func MakeStyle

func MakeStyle(src ...Style) Style

MakeStyle returns a new style that unites all argument styles.

func Margin

func Margin(val uint16, unit Unit, sides ...Side) Style

func OutlineStyle

func OutlineStyle(val BorderStyleKind) Style

func Padding

func Padding(val uint16, unit Unit, sides ...Side) Style

func Position

func Position(val PositionKind) Style

func Resize

func Resize(val ResizeKind) Style

func TabSize

func TabSize(val uint8) Style

func TextColor

func TextColor(val Color) Style

func TextLineHeight

func TextLineHeight(coef float64) Style

func Translate

func Translate(x int16, unitX Unit, y int16, unitY Unit) Style

func WhiteSpace

func WhiteSpace(val SpaceKind) Style

func Width

func Width(val uint16, unit Unit) Style

func WidthMax

func WidthMax(val uint16, unit Unit) Style

func WidthMin

func WidthMin(val uint16, unit Unit) Style

func X

func X(val uint16, unit Unit) Style

X sets the position on the horizontal axis

func Y

func Y(val uint16, unit Unit) Style

Y sets the position on the vertical axis

func (Style) Fork

func (x Style) Fork(src ...Style) Style

Fork is a shorthand for MakeStyle(x, src...)

func (Style) Set

func (x Style) Set(src ...Style)

Set includes the argument styles into the target.

type Unit

type Unit string

type VAlign

type VAlign string

Jump to

Keyboard shortcuts

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