aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/less/lib/mixins.less
blob: 923df1ead80de356ca36f6c9d989ad44bfdc51b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// ==========================================================================
// Mixins
// ==========================================================================

// Contain floats: nicolasgallagher.com/micro-clearfix-hack/
// ---------------------------------------
.clearfix() {
    zoom: 1;
    &:before, 
    &:after { content: ""; display: table; }
    &:after { clear: both; }
}

// Webkit-style focus
// ---------------------------------------
.tab-focus() {
    // Default
    outline: thin dotted @gray-dark;
    // Webkit
    outline-offset: 1px;
}

// Use rems for font sizing
// Leave <body> at 100%/16px
// ---------------------------------------
.font-size(@font-size: 16){
    @rem: round((@font-size / 16), 3);
    font-size: (@font-size * 1px);
    font-size: ~"@{rem}rem";
}

// Font smoothing
// ---------------------------------------
.font-smoothing(@mode: on) when (@mode = on) {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}
.font-smoothing(@mode: on) when (@mode = off) {
    -moz-osx-font-smoothing: auto;
    -webkit-font-smoothing: subpixel-antialiased;
}