Support CSS3-style pseudo-elements.
This commit is contained in:
parent
b281f151a8
commit
a7614864f7
|
@ -278,7 +278,13 @@ END
|
||||||
def parse_line(line)
|
def parse_line(line)
|
||||||
case line[0]
|
case line[0]
|
||||||
when ATTRIBUTE_CHAR
|
when ATTRIBUTE_CHAR
|
||||||
|
if line[1] != ATTRIBUTE_CHAR
|
||||||
parse_attribute(line, ATTRIBUTE)
|
parse_attribute(line, ATTRIBUTE)
|
||||||
|
else
|
||||||
|
# Support CSS3-style pseudo-elements,
|
||||||
|
# which begin with ::
|
||||||
|
Tree::RuleNode.new(line, @options[:style])
|
||||||
|
end
|
||||||
when Constant::CONSTANT_CHAR
|
when Constant::CONSTANT_CHAR
|
||||||
parse_constant(line)
|
parse_constant(line)
|
||||||
when COMMENT_CHAR
|
when COMMENT_CHAR
|
||||||
|
|
|
@ -174,6 +174,16 @@ END
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_pseudo_elements
|
||||||
|
assert_equal(<<CSS, render(<<SASS))
|
||||||
|
::first-line {
|
||||||
|
size: 10em; }
|
||||||
|
CSS
|
||||||
|
::first-line
|
||||||
|
size: 10em
|
||||||
|
SASS
|
||||||
|
end
|
||||||
|
|
||||||
def test_directive
|
def test_directive
|
||||||
assert_equal("@a b;", render("@a b"))
|
assert_equal("@a b;", render("@a b"))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue