Skip to content

Commit

Permalink
Implement /deep/ shadow DOM selector
Browse files Browse the repository at this point in the history
Fixes sass#452
  • Loading branch information
mgreter committed Mar 28, 2015
1 parent b287d31 commit 5caacc3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ namespace Sass {
extern const char webkit_calc_kwd[] = "-webkit-calc(";
extern const char ms_calc_kwd[] = "-ms-calc(";

// css selector keywords
extern const char sel_deep_kwd[] = "/deep/";

// css attribute-matching operators
extern const char tilde_equal[] = "~=";
extern const char pipe_equal[] = "|=";
Expand Down
3 changes: 3 additions & 0 deletions constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ namespace Sass {
extern const char webkit_calc_kwd[];
extern const char ms_calc_kwd[];

// css selector keywords
extern const char sel_deep_kwd[];

// css attribute-matching operators
extern const char tilde_equal[];
extern const char pipe_equal[];
Expand Down
4 changes: 4 additions & 0 deletions parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,9 @@ namespace Sass {
else if (lex< quoted_string >() || lex< number >()) {
return new (ctx.mem) Type_Selector(pstate, unquote(lexed));
}
else if (lex< exactly < sel_deep_kwd > >()) {
return new (ctx.mem) Type_Selector(pstate, unquote(lexed));
}
else if (peek< pseudo_not >()) {
return parse_negated_selector();
}
Expand Down Expand Up @@ -1984,6 +1987,7 @@ namespace Sass {
(q = peek< dimension >(p)) ||
(q = peek< quoted_string >(p)) ||
(q = peek< exactly<'*'> >(p)) ||
(q = peek< exactly<sel_deep_kwd> >(p)) ||
(q = peek< exactly<'('> >(p)) ||
(q = peek< exactly<')'> >(p)) ||
(q = peek< exactly<'['> >(p)) ||
Expand Down

0 comments on commit 5caacc3

Please sign in to comment.