Support CSS3-style pseudo-elements.

This commit is contained in:
Nathan Weizenbaum 2008-10-29 23:39:36 -07:00
parent b281f151a8
commit a7614864f7
2 changed files with 17 additions and 1 deletions

View File

@ -278,7 +278,13 @@ END
def parse_line(line)
case line[0]
when ATTRIBUTE_CHAR
parse_attribute(line, ATTRIBUTE)
if line[1] != ATTRIBUTE_CHAR
parse_attribute(line, ATTRIBUTE)
else
# Support CSS3-style pseudo-elements,
# which begin with ::
Tree::RuleNode.new(line, @options[:style])
end
when Constant::CONSTANT_CHAR
parse_constant(line)
when COMMENT_CHAR

View File

@ -174,6 +174,16 @@ 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
assert_equal("@a b;", render("@a b"))