Documentation ¶
Index ¶
- Constants
- func Em(value float64) string
- func Float(value float64) string
- func Int(value int) string
- func Percent(value int) string
- func Pixels(value int) string
- func RGB(r, g, b int) string
- func RGBA(r, g, b int, a float64) string
- func Rem(value float64) string
- func URL(url string) string
- func Var(name string) string
- func ViewportHeight(value int) string
- func ViewportMax(value int) string
- func ViewportMin(value int) string
- func ViewportWidth(value int) string
- type CompositeStyle
- type Keyframes
- type Props
- type StyleManager
- type StyleSheet
Constants ¶
const ( // Layout Properties Display = "display" Position = "position" Top = "top" Right = "right" Bottom = "bottom" Left = "left" Overflow = "overflow" OverflowX = "overflow-x" OverflowY = "overflow-y" ZIndex = "z-index" Flex = "flex" FlexDirection = "flex-direction" JustifyContent = "justify-content" AlignItems = "align-items" AlignContent = "align-content" AlignSelf = "align-self" FlexWrap = "flex-wrap" FlexGrow = "flex-grow" FlexShrink = "flex-shrink" FlexBasis = "flex-basis" Grid = "grid" GridArea = "grid-area" GridAutoColumns = "grid-auto-columns" GridAutoFlow = "grid-auto-flow" GridAutoRows = "grid-auto-rows" GridColumn = "grid-column" GridColumnEnd = "grid-column-end" ColumnGap = "column-gap" GridColumnStart = "grid-column-start" GridRow = "grid-row" Gap = "gap" GridRowEnd = "grid-row-end" RowGap = "row-gap" GridRowStart = "grid-row-start" GridTemplate = "grid-template" GridTemplateAreas = "grid-template-areas" GridTemplateColumns = "grid-template-columns" GridTemplateRows = "grid-template-rows" // Box Model Properties Width = "width" MinWidth = "min-width" MaxWidth = "max-width" Height = "height" MinHeight = "min-height" MaxHeight = "max-height" Padding = "padding" PaddingTop = "padding-top" PaddingRight = "padding-right" PaddingBottom = "padding-bottom" PaddingLeft = "padding-left" Margin = "margin" MarginTop = "margin-top" MarginRight = "margin-right" MarginBottom = "margin-bottom" MarginLeft = "margin-left" Border = "border" BorderTop = "border-top" BorderRight = "border-right" BorderBottom = "border-bottom" BorderLeft = "border-left" BorderColor = "border-color" BorderTopColor = "border-top-color" BorderRightColor = "border-right-color" BorderBottomColor = "border-bottom-color" BorderLeftColor = "border-left-color" BorderStyle = "border-style" BorderTopStyle = "border-top-style" BorderRightStyle = "border-right-style" BorderBottomStyle = "border-bottom-style" BorderLeftStyle = "border-left-style" BorderWidth = "border-width" BorderTopWidth = "border-top-width" BorderRightWidth = "border-right-width" BorderBottomWidth = "border-bottom-width" BorderLeftWidth = "border-left-width" BorderRadius = "border-radius" BoxShadow = "box-shadow" Outline = "outline" OutlineStyle = "outline-style" OutlineColor = "outline-color" OutlineWidth = "outline-width" OutlineOffset = "outline-offset" // Fonts & Text Properties Color = "color" Font = "font" FontFamily = "font-family" FontSize = "font-size" FontWeight = "font-weight" LineHeight = "line-height" TextAlign = "text-align" TextDecoration = "text-decoration" TextTransform = "text-transform" LetterSpacing = "letter-spacing" WhiteSpace = "white-space" TextOverflow = "text-overflow" FontStyle = "font-style" TextShadow = "text-shadow" VerticalAlign = "vertical-align" WordSpacing = "word-spacing" WordBreak = "word-break" TextIndent = "text-indent" // Visual Properties BackgroundColor = "background-color" Background = "background" BackgroundImage = "background-image" BackgroundRepeat = "background-repeat" BackgroundSize = "background-size" ObjectFit = "object-fit" Opacity = "opacity" BoxSizing = "box-sizing" Cursor = "cursor" Transition = "transition" Transform = "transform" BackgroundPosition = "background-position" BackgroundAttachment = "background-attachment" BackgroundBlendMode = "background-blend-mode" BackfaceVisibility = "backface-visibility" BackdropFilter = "backdrop-filter" Perspective = "perspective" TransformOrigin = "transform-origin" // List properties ListStyle = "list-style" ListStyleType = "list-style-type" // Table Properties BorderCollapse = "border-collapse" BorderSpacing = "border-spacing" TableLayout = "table-layout" CaptionSide = "caption-side" Animation = "animation" AnimationDelay = "animation-delay" AnimationDirection = "animation-direction" AnimationDuration = "animation-duration" AnimationFillMode = "animation-fill-mode" AnimationIterationCount = "animation-iteration-count" AnimationPlayState = "animation-play-state" AnimationName = "animation-name" AnimationTimingFunction = "animation-timing-function" // Keyframes for animations (used within CSS, not directly as HTML attributes) KeyframesFrom = "from" KeyframesTo = "to" // Other Properties Visibility = "visibility" Clip = "clip" Content = "content" Filter = "filter" PointerEvents = "pointer-events" Resize = "resize" UserSelect = "user-select" // Interaction pseudo-classes PseudoHover = ":hover" PseudoActive = ":active" PseudoFocus = ":focus" PseudoFocusVisible = ":focus-visible" PseudoFocusWithin = ":focus-within" // Location pseudo-classes PseudoLink = ":link" PseudoVisited = ":visited" PseudoTarget = ":target" // Input pseudo-classes PseudoEnabled = ":enabled" PseudoDisabled = ":disabled" PseudoChecked = ":checked" PseudoIndeterminate = ":indeterminate" PseudoDefault = ":default" PseudoValid = ":valid" PseudoInvalid = ":invalid" PseudoPlaceholderShown = ":placeholder-shown" PseudoReadOnly = ":read-only" PseudoReadWrite = ":read-write" PseudoRequired = ":required" PseudoOptional = ":optional" // Tree-structural pseudo-classes PseudoFirstChild = ":first-child" PseudoLastChild = ":last-child" PseudoOnlyChild = ":only-child" PseudoFirstOfType = ":first-of-type" PseudoLastOfType = ":last-of-type" PseudoOnlyOfType = ":only-of-type" PseudoEmpty = ":empty" PseudoNthChild = ":nth-child" PseudoNthLastChild = ":nth-last-child" PseudoNthOfType = ":nth-of-type" PseudoNthLastOfType = ":nth-last-of-type" PseudoNot = ":not()" PseudoRoot = ":root" // Linguistic pseudo-classes PseudoLang = ":lang" // Fullscreen pseudo-class PseudoFullScreen = ":fullscreen" // Animations pseudo-classes PseudoPlaying = ":playing" PseudoPaused = ":paused" )
Variables ¶
This section is empty.
Functions ¶
func Float ¶ added in v0.24.0
Float returns a string representation of the float with 2 decimal places
func Percent ¶ added in v0.24.0
Percent returns a string representation of the given integer as a percentage.
func Pixels ¶ added in v0.24.0
Pixels returns a string representation of the given integer as a pixel value.
func RGB ¶ added in v0.24.0
RGB returns a string representation of the given RGB values as a CSS RGB value.
func RGBA ¶ added in v0.24.0
RGBA returns a string representation of the given RGBA values as a CSS RGBA value.
func URL ¶ added in v0.24.0
URL returns a string representation of the given string as a CSS URL value.
func Var ¶ added in v0.24.0
Var returns a string representation of the given string as a CSS var value.
func ViewportHeight ¶ added in v0.24.0
ViewportHeight returns a string representation of the given integer as a viewport height value.
func ViewportMax ¶ added in v0.24.0
ViewportMax returns a string representation of the given integer as a viewport maximum value.
func ViewportMin ¶ added in v0.24.0
ViewportMin returns a string representation of the given integer as a viewport minimum value.
func ViewportWidth ¶ added in v0.24.0
ViewportWidth returns a string representation of the given integer as a viewport width value.
Types ¶
type CompositeStyle ¶ added in v0.25.0
type CompositeStyle struct { Default Props PseudoClasses map[string]Props MediaQueries map[string]Props }
CompositeStyle represents a collection of styles.
type Props ¶ added in v0.11.0
Props is a map of CSS properties
type StyleManager ¶ added in v0.25.0
type StyleManager struct {
// contains filtered or unexported fields
}
StyleManager manages styles and generates CSS classes.
func NewStyleManager ¶ added in v0.25.0
func NewStyleManager() *StyleManager
NewStyleManager creates a new instance of StyleManager.
func (*StyleManager) AddAnimation ¶ added in v0.25.0
func (sm *StyleManager) AddAnimation(keyframes Keyframes) string
AddAnimation adds a new keyframes animation to the manager and returns an animation name.
func (*StyleManager) AddCompositeStyle ¶ added in v0.25.0
func (sm *StyleManager) AddCompositeStyle(composite CompositeStyle) string
func (*StyleManager) AddStyle ¶ added in v0.25.0
func (sm *StyleManager) AddStyle(style Props) string
AddStyle adds a new style to the manager and returns a class name.
func (*StyleManager) GenerateCSS ¶ added in v0.25.0
func (sm *StyleManager) GenerateCSS() string
GenerateCSS generates the CSS string for all styles managed by StyleManager.
type StyleSheet ¶ added in v0.25.0
StyleSheet represents a collection of styles mapped to class names.