Skip to content

Instantly share code, notes, and snippets.

@Guilh
Last active August 29, 2015 14:06
Show Gist options
  • Save Guilh/2b73ddf20172ed64c025 to your computer and use it in GitHub Desktop.
Save Guilh/2b73ddf20172ed64c025 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.1)
// Compass (v1.0.1)
// ----
@mixin child($pos) {
@if $pos == "first" {
&:#{$pos}-child {
float: left;
}
}
@else if $pos == "last" {
&:#{$pos}-child {
float: right;
}
}
@else {
@error "`#{$pos}` is not a valid pseudo-class.";
}
}
.foo {
@include child(last);
}
.foo:last-child {
float: right;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment