Sha256: d3320f445a27d550718c68f3b690c3b25480a5ac35007f3864cf56086dd2bbbf
Contents?: true
Size: 866 Bytes
Versions: 25
Compression:
Stored size: 866 Bytes
Contents
module Less module Node class Selector < String include Entity Selectors = { :Descendant => '', :Child => '>', :Adjacent => '+', :PseudoClass => ':', :PseudoElement => '::', :Sibling => '~' } def initialize super Selectors[ self.class.to_s.split('::').last.to_sym ] end def self.[] key Node.const_get(Selectors.find {|k, v| v == key }.first) end end class Descendant < Selector def to_css; " " end end class Child < Selector def to_css; " #{self} " end end class Adjacent < Selector def to_css; " #{self} " end end class PseudoClass < Selector def to_css; self end end class PseudoElement < Selector def to_css; self end end end end
Version data entries
25 entries across 25 versions & 5 rubygems