Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Can you redefine sass variables based on parent class/ID name?
$panel-background-color: blue;
$panel-color: white;
.panel {
background-color:$panel-background-color;
color:$panel-color;
}
Insert some sort of logic -- if panel is a child of parent-div, redefine the following variables:
$panel-background-color:purple;
$panel-color:yellow
If panel is not a child of parent-div, do nothing. Use the 'default' variables
.parent-div .panel {
background-color:$panel-background-color;
color:$panel-color
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment