Skip to content

Instantly share code, notes, and snippets.

@geovanisouza92
Created November 26, 2014 12:14
Show Gist options
  • Select an option

  • Save geovanisouza92/68f12c13b2457dfd430f to your computer and use it in GitHub Desktop.

Select an option

Save geovanisouza92/68f12c13b2457dfd430f to your computer and use it in GitHub Desktop.
Rules to expand "html /deep/" and "::shadow" classes for Polymer/WebComponents
// Rules
.shadow(@parent, @sel, @ruleset) {
@rule: ~"@{parent}::shadow @{sel}";
@{rule} {
@ruleset();
}
}
.deep(@parent, @sel, @ruleset) {
@rule: ~"@{parent} /deep/ @{sel}, @{parent} @{sel}";
@{rule} {
@ruleset();
}
}
.deep(@sel, @ruleset) {
@rule: ~"html /deep/ @{sel}, @{sel}";
@{rule} {
@ruleset();
}
}
// Samples
.deep(p, {
margin: 0;
& a {
text-decoration: none;
}
});
.deep('#ink', {
color: white;
});
.deep(paper-input, '#ink', {
color: black;
});
.shadow(paper-input, '#ink', {
color: white;
});
.shadow('#my_button', '#ripple', {
color: blue;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment