class Roadie::StyleBlock
A style block is the combination of a {Selector} and a list of {StyleProperty}.
@api private
def initialize(selector, properties, media)
-
media
(Array
) -- Array of media types, e.g. -
properties
(Array
) -- -
selector
(Selector
) --
def initialize(selector, properties, media) @selector = selector @properties = properties @media = media.map(&:to_s) end
def inlinable?
-
(Boolean)
-
Other tags:
- See: inlineable_media -
def inlinable? inlinable_media? && selector.inlinable? end
def inlinable_media?
-
(Boolean)
-
def inlinable_media? @media.none? { |media_query| media_query.include? "(" } end
def to_s
-
(String)
-
def to_s # NB - leave off redundant final semicolon - see https://www.w3.org/TR/CSS2/syndata.html#declaration "#{selector}{#{properties.map(&:to_s).join(";")}}" end