Debian Codegraph @

lib/compass/utilities/general/_hacks.scss

raw
1 @import "../../support";
2
3 // The `zoom` approach generates less CSS but does not validate.
4 // Set this to `block` to use the display-property to hack the
5 // element to gain layout.
6 $default-has-layout-approach: zoom !default;
7
8 // This mixin causes an element matching the selector
9 // to gain the "hasLayout" property in internet explorer.
10 // More information on [hasLayout](http://reference.sitepoint.com/css/haslayout).
11 @mixin has-layout($approach: $default-has-layout-approach) {
12 @if $legacy-support-for-ie {
13 @if $approach == zoom {
14 @include has-layout-zoom;
15 } @else if $approach == block {
16 @include has-layout-block;
17 } @else {
18 @warn "Unknown has-layout approach: #{$approach}";
19 @include has-layout-zoom;
20 }
21 }
22 }
23
24 @mixin has-layout-zoom {
25 @if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
26 *zoom: 1;
27 }
28 }
29
30 @mixin has-layout-block {
31 @if $legacy-support-for-ie {
32 // This makes ie6 get layout
33 display: inline-block;
34 // and this puts it back to block
35 & { display: block; }
36 }
37 }
38
39 // A hack to supply IE6 (and below) with a different property value.
40 // [Read more](http://www.cssportal.com/css-hacks/#in_css-important).
41 @mixin bang-hack($property, $value, $ie6-value) {
42 @if $legacy-support-for-ie6 {
43 #{$property}: #{$value} !important;
44 #{$property}: #{$ie6-value};
45 }
46 }