Skip to content

Instantly share code, notes, and snippets.

@jackrugile
Created January 31, 2015 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackrugile/65829cf38ea8f8d8ebd6 to your computer and use it in GitHub Desktop.
Save jackrugile/65829cf38ea8f8d8ebd6 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
/*
The item class is sometimes a <div>, and sometimes an <a>.
I'd like to only set a hover effect when it's an <a>.
Id there a way to utilize the ampersand and
nested syntax to achieve this?
What I have below is what I want in theory, but it's invalid.
*/
.item {
background: tomato;
display: block;
a&:hover {
background: dodgerblue;
}
}
Invalid CSS after " a": expected "{", was "&:hover {"
"&:hover" may only be used at the beginning of a compound selector.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment