Skip to content

Instantly share code, notes, and snippets.

@agibralter
Created April 10, 2011 16:55
Show Gist options
  • Select an option

  • Save agibralter/912518 to your computer and use it in GitHub Desktop.

Select an option

Save agibralter/912518 to your computer and use it in GitHub Desktop.
// (Using compass's border-radius mixin)
.br-2-2-0-0 {
@include border-radius(2px 2px 0 0);
}
.br-0-0-2-2 {
@include border-radius(0 0 2px 2px);
}
.br-2-0-0-2 {
@include border-radius(2px 0 0 2px);
}
.br-0-2-2-0 {
@include border-radius(0 2px 2px 0);
}
@import "border_radius";
// I find myself doing this to avoid packing my css files with the 5 lines it takes to define a cross-browser border radius
#foo-1 {
@extend .br-2-2-0-0;
}
#foo-2 {
@extend .br-2-2-0-0;
}
#foo-3 {
@extend .br-2-2-0-0;
}
// BUT!
// I would love to be able to do something like this:
#foo {
@include my-border-radius(2px, 2px, 0, 0);
}
// ... which would define a top level class:
.br-2px-2px-0-0 {
@include border-radius(2px 2px 0 0);
}
// ... and extend the current selector with that class:
#foo {
@extend .br-2px-2px-0-0;
}
// ... that way the border-radius/-moz-border-radius/-webkit-border-radius for 2-2-0-0 only appears once in the generated css.
@import "border_radius";
#bar-1 {
@extend .br-2-0-0-2;
}
#bar-2 {
@extend .br-2-0-0-2;
}
#bar-3 {
@extend .br-2-0-0-2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment