Style is the core styling primitive - a complete Lipgloss port
Constructors
new_style
Create a new style (factory method like Lipgloss)
SourceClass methods
JoinHorizontal is a utility function for horizontally joining two
potentially multi-lined strings along a vertical axis.
pos: Vertical alignment (Top, Bottom, Center)
SourceJoinVertical is a utility function for vertically joining two potentially
multi-lined strings along a horizontal axis.
pos: Horizontal alignment (Left, Right, Center)
SourceInstance methods
align(h : Position, v : Position) : Style
Alignment - two arguments set horizontal and vertical
Sourcealign(p : Position) : Style
Alignment - single argument sets horizontal
Sourcealign_horizontal(p : Position) : Style
Sourcealign_vertical(p : Position) : Style
Sourcebackground(c : Color | AdaptiveColor | CompleteColor) : Style
Sourcebg_indexed(idx :
Int32) :
Style Compatibility helpers for older example code.
Sourcebold?
Crystal-idiomatic boolean getters
Sourceborder(b : Border) : Style
Border
[FIX] Explicit overload for single argument to satisfy compiler
Sourceborder_background(c : Color | AdaptiveColor) : Style
Sourceborder_bottom_background(c : Color | AdaptiveColor) : Style
Sourceborder_bottom_foreground(c : Color | AdaptiveColor) : Style
Sourceborder_foreground(c : Color | AdaptiveColor) : Style
Sourceborder_left_background(c : Color | AdaptiveColor) : Style
Sourceborder_left_foreground(c : Color | AdaptiveColor) : Style
Sourceborder_right_background(c : Color | AdaptiveColor) : Style
Sourceborder_right_foreground(c : Color | AdaptiveColor) : Style
Sourceborder_style(b : Border) : Style
Sourceborder_top_background(c : Color | AdaptiveColor) : Style
Sourceborder_top_foreground(c : Color | AdaptiveColor) : Style
Sourcefg_indexed(idx :
Int32) :
Style Compatibility helpers for older example code.
Sourceforeground(c : Color | AdaptiveColor | CompleteColor) : Style
Sourceget_background
DEPRECATED Use #background_color instead
Sourceget_bold
Aliases for backwards compatibility
Sourceget_color_whitespace
DEPRECATED Use #color_whitespace? instead
Sourceget_foreground
DEPRECATED Use #foreground_color instead
Sourceget_horizontal_border_size
Sourceget_horizontal_frame_size
Sourceget_italic
DEPRECATED Use #italic? instead
Sourceget_strikethrough_spaces
DEPRECATED Use #strikethrough_spaces? instead
Sourceget_underline
DEPRECATED Use #underline? instead
Sourceget_vertical_border_size
Sourceget_width
Backwards compatibility aliases
Sourceinherit(other : Style) : Style
Inherit overlays the style in the argument onto this style
Only unset rules on the receiver are inherited.
Margins, padding, and underlying string values are not inherited.
Sourcemargin(all :
Int32) :
Style Margin - CSS shorthand style
Sourcemargin_background(c : Color | AdaptiveColor) : Style
Sourcemerge(other : Style) : Style
Merge another style into this one
Properties that are set in the other style will override this style's properties
Sourcepadding(all :
Int32) :
Style Padding - CSS shorthand style
SourceRender applies the style to the given string(s)
Sourcerenderer(r : StyleRenderer) : Style
Sourceset_string(*strs :
String) :
Style SetString sets the underlying string value for the style
Sourcestrikethrough_spaces(v :
Bool = true) :
Style Sourceto_s
String implements the Stringer interface
Sourceunset_strikethrough_spaces
Sourcevalue
Value returns the raw, unformatted string value
Sourcewidth_value
Crystal-idiomatic property getters
Source