You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_box.scss needs to be wrapped in a mixin so that the CSS it generates is only included if invoked. See the example below to see roughly how it should work.
Notice that it takes a parameter $ie-corner-tag which lets the mixin know if it needs to generate the code for '''' tags for rounded corners in IE8 and older. It defaults to false because we want to discourage people from forcing rounding in older browsers.
$ie-corner-tags should be set in a variables file.
@import"compass/utilities/general/hacks";
@import"utils/clearfix-me";
@import"compass/css3/border-radius";
@mixinoobox($ie-corner-tag: false){ // can be any HTML tag including; div, b, span, etc.// Box structure.box {
.box-head,.box-body,.box-foot{
//@include clearfix-me(micro);border: 1pxsolidred;//debug@includeclearfix-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 increase the box size to match the font-sizeposition: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: lefttop;
@extend%corner;
@extend%corner-left;
@extend%corner-top;
}
.tr{
background-position: righttop;
@extend%corner;
@extend%corner-right;
@extend%corner-top;
}
.bl {
background-position: leftbottom;
@extend%corner;
@extend%corner-left;
@extend%corner-bottom;
}
.br {background-position: rightbottom;
@extend%corner;
@extend%corner-right;
@extend%corner-bottom;
}
.top{
background-position:centertop;
@extend%corners-and-wrappers;
}
.bottom{
background-position:centerbottom;
_zoom:1; // zoom required for IE5.5 only@extend%corners-and-wrappers;
}
}
}
@if$ie-corner-tag {
.complex { // need images for borders. (you probably don't, think borders, inner and outer multiple shadows)//@extend .box; can't extend, output is too large. Use multiple classesoverflow:hidden;
*position:relative; //required for IE7, 6, 5.5*zoom:1; //required for IE7, 6, 5.5%corner-top {
height:32000px;
margin-bottom:-32000px;
width:10px;
}
.top,.bottom {
height: 5px;
}
}
.pop { // transparent on the outside//@extend .box; Can't extend, use multiple classesoverflow:visible;
margin: 10px20px20px10px;
background-position:lefttop;
.inner {
right:-10px;
bottom:-10px;
background-position:rightbottom;
padding:010px10px0;
}
.tl, .br {
display:none;
}
.bl {
bottom: -10px;
}
.tr{
float:right;
margin-right:-10px;
_display:inline; //fix double margin bug
}
}
}
// Box skins/* ----- simple (extends box) ----- */.box-simple {
border:1pxsolid#D7D7D7;
@includeborder-radius(7px);
@if$ie-corner-tag {
b {background-image:url(skin/simple_corners.png)\9;}
@warn"You will need to include the class 'box' in your HTML whenever you use a box style because you have $ie-corner-tag enabled. Consider defaulting to square corners for IE6, 7, and 8.";
} @else {
//@extend .box; // even this is too damn long... a site with 20 boxes will have a whole pile of stupid css.
}
}
}
The text was updated successfully, but these errors were encountered:
Hey Fi,
_box.scss needs to be wrapped in a mixin so that the CSS it generates is only included if invoked. See the example below to see roughly how it should work.
Notice that it takes a parameter $ie-corner-tag which lets the mixin know if it needs to generate the code for '''' tags for rounded corners in IE8 and older. It defaults to false because we want to discourage people from forcing rounding in older browsers.
$ie-corner-tags should be set in a variables file.
The text was updated successfully, but these errors were encountered: