class Celestine::Style

Overview

Embeds CSS stylesheets inside an SVG document

Defined in:

drawables/style.cr

Constant Summary

TAG = "style"

Constructors

Instance Method Summary

Instance methods inherited from class Celestine::Drawable

class_attribute(io : IO) class_attribute, classes : Array(String) classes, classes=(val : Array(String)) classes=, custom_attribute(io : IO) custom_attribute, custom_attrs : Hash(String, String) custom_attrs, custom_attrs=(val : Hash(String, String)) custom_attrs=, draw(io : IO) : Nil draw, has_inner_elements? : Bool has_inner_elements?, id : String | Nil id, id=(id : String | Nil) id=, id_attribute(io : IO) id_attribute, inner_elements : IO::Memory inner_elements, inner_elements=(val : IO::Memory) inner_elements=, style : Hash(String, String) style, style=(val : Hash(String, String)) style=, style_attribute(io : IO) style_attribute, to_s(io : IO) : Nil
to_s : String
to_s

Constructor Detail

def self.new(type : String = "text/css") #

[View source]

Instance Method Detail

def css(raw_css : String) : self #

Adds a raw CSS string to this stylesheet


[View source]
def draw(io : IO) : Nil #
Description copied from class Celestine::Drawable

Main draw method for a drawable. Takes in and interacts with an io.


[View source]
def rule(selector : String, **props) : self #

Adds a formatted CSS rule with a selector and properties

style.rule(".icon", fill: "#3b82f6", stroke_width: "2px")

[View source]
def rules : Array(String) #

[View source]
def type : String #

[View source]
def type=(type : String) #

[View source]