2 * adds a css outline to an element with compatibility for IE8/outline-offset
3 * NOTE: the element receiving the outline must be positioned (either relative or absolute)
4 * in order for the outline to work in IE8
6 * @param {number} [$width=1px]
7 * The width of the outline
9 * @param {string} [$style=solid]
10 * The style of the outline
12 * @param {color} [$color=#000]
13 * The color of the outline
15 * @param {number} [$offset=0]
16 * The offset of the outline
18 * @param {number/list} [$border-width=0]
19 * The border-width of the element receiving the outline.
20 * Required in order for outline-offset to work in IE8
22 * @param {boolean} [$pseudo=false]
23 * `true to always use a pseudo element to render the outline.
24 * by default this behavior is limited to IE8 only, but can be enabled in all browser
38 @mixin css-outline-pseudo() {
42 top: -$offset - $width - top($border-width) ;
43 right: -$offset - $width - right($border-width);
44 bottom: -$offset - $width - bottom($border-width);
45 left: -$offset - $width - left($border-width);
47 border: $width $style $color;
53 @include css-outline-pseudo;
55 outline: $width $style $color;
56 outline-offset: $offset;
61 @include css-outline-pseudo;