Skip to content

Instantly share code, notes, and snippets.

@stubbornella
Created August 8, 2012 22:45
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 stubbornella/3299510 to your computer and use it in GitHub Desktop.
Save stubbornella/3299510 to your computer and use it in GitHub Desktop.
Old IE support for SASS - OOCSS Boxes
$ie-support: 7 !default;
@mixin oobox($ie-corner-tag: false){ // can be any HTML tag including; div, b, span, etc.
.box {
.hd,.bd,.ft{
@include clearfix-me(micro);
}
@if $ie-corner-tag { // this code only ever executes if you want rounded corners in IE<8. Better without.
%corners-and-wrappers {
display:block;
background-repeat:no-repeat;
font-size:1%; // make sure IE doesn't get "helpful" and inc the box size to = font-size
position:relative;
z-index:10;
}
%corner {
@extend %corners-and-wrappers;
height:10px;
width:10px;
}
%corner-right {
float:right;
}
%corner-left {
float:left;
}
%corner-top {
overflow:hidden;
margin-bottom:-32000px;// margin bottom needs to be < -9px
}
%corner-bottom {
margin-top:-10px;
}
.tl{background-position: left top;
@extend %corner;
@extend %corner-left;
@extend %corner-top;
}
.tr{
background-position: right top;
@extend %corner;
@extend %corner-right;
@extend %corner-top;
}
.bl {
background-position: left bottom;
@extend %corner;
@extend %corner-left;
@extend %corner-bottom;
}
.br {background-position: right bottom;
@extend %corner;
@extend %corner-right;
@extend %corner-bottom;
}
.top{
background-position:center top;
@extend %corners-and-wrappers;
}
.bottom{
background-position:center bottom;
_zoom:1; // zoom required for IE5.5 only
@extend %corners-and-wrappers;
}
}
}
/* ----- simple (extends box) ----- */
.simple{
@extend .box;
&> .inner {
border:1px solid #D7D7D7;
@include border-radius(7px);
}
if $ie-corner-tag {
b {background-image:url(skin/simple_corners.png)\9;}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment