Skip to content

Instantly share code, notes, and snippets.

@rutger1140
Last active May 18, 2016 13:02
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 rutger1140/b2598ec5fe644ed44534aed14829093c to your computer and use it in GitHub Desktop.
Save rutger1140/b2598ec5fe644ed44534aed14829093c to your computer and use it in GitHub Desktop.
LESS to SASS conversion - issue
// LESS
.form-field {
border: 1px solid #ccc;
padding: .5em 1em;
input& {
height: 2em;
}
textarea& {
height: auto;
}
}
// SASS
.form-field {
border: 1px solid #ccc;
padding: .5em 1em;
@at-root input#{&} {
height: 2em;
}
@at-root textarea#{&} {
height: auto;
}
}
@rutger1140
Copy link
Author

While converting some code I ran into this issue.

"&" may only be used at the beginning of a compound selector

The @at-root selector helped me out, but this doesn't feel like the way to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment