forked from mdo/preboot
/
bootstrap.less
165 lines (137 loc) · 4.18 KB
/
bootstrap.less
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*--------------------------------------------------
Bootstrap.less v1
--------------------------------------------------
Colors
-------------------------------------------------- */
// Links
@link-color: #8b59c2;
@link-hover-color: darken(@link-color, 10);
// Grays
@gray-light: #777;
@gray: #555;
@gray-dark: #333;
// Accent Colors
@blue: #00b3ee;
@green: #46a546;
@red: #9d261d;
@yellow: #ffc40d;
@orange: #f89406;
@pink: #c3325f;
@purple: #7a43b6;
/*--------------------------------------------------
Mixins
-------------------------------------------------- */
// Clearfix for use in Less files
.clearfix{
&:after{
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
& {display: inline-block;}
* html & {height: 1%;}
& {display: block;}
}
// CSS3 columns.
.columns(@count, @gap: 1.5em){
-webkit-column-count: @count;
-webkit-column-gap: @gap;
-moz-column-count: @count;
-moz-column-gap: @gap;
column-count: @count;
column-gap: @gap;
& > * {
position: static; // Boy, it took me long time to figure this out.
}
}
// Button style
// Usage: include the mixin and define base color. I highly recommend you to customize these styles.
.button(@basecolor: #eee){
.rounded(3px);
-webkit-font-smoothing: antialiased;
display: inline-block;
.gradient(@basecolor, darken(@basecolor, 10%));
.sans-serif(bold);
text-align: center;
text-decoration: none;
padding: 0.3em 0.5em;
&:hover{
}
&:active{
.transition(none);
top: auto; outline: none !important;
}
}
// Border Radius
.rounded(@radius: 5px) {
-moz-border-radius: @radius;
-webkit-border-radius: @radius;
border-radius: @radius;
}
.border-radius(@topleft: 0, @topright: 0, @bottomright: 0, @bottomleft: 0) {
-moz-border-top-left-radius: @topleft;
-moz-border-top-right-radius: @topright;
-moz-border-bottom-right-radius: @bottomright;
-moz-border-bottom-left-radius: @bottomleft;
-webkit-border-top-left-radius: @topleft;
-webkit-border-top-right-radius: @topright;
-webkit-border-bottom-right-radius: @bottomright;
-webkit-border-bottom-left-radius: @bottomleft;
border-top-left-radius: @topleft;
border-top-right-radius: @topright;
border-bottom-right-radius: @bottomright;
border-bottom-left-radius: @bottomleft;
}
// Drop shadows
.box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) {
-webkit-box-shadow: @shadow;
-moz-box-shadow: @shadow;
box-shadow: @shadow;
}
// Transitions
.transition(@transition) {
-webkit-transition: @transition;
-moz-transition: @transition;
transition: @transition;
}
// Font Stacks
.sans-serif(@weight: normal, @size: 14px, @lineheight: 20px) {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: @size;
font-weight: @weight;
line-height: @lineheight;
}
.serif(@weight: normal, @size: 14px, @lineheight: 20px) {
font-family: "Georgia", Times New Roman, Times, sans-serif;
font-size: @size;
font-weight: @weight;
line-height: @lineheight;
}
.monospace(@weight: normal, @size: 12px, @lineheight: 20px) {
font-family: "Monaco", Courier New, monospace;
font-size: @size;
font-weight: @weight;
line-height: @lineheight;
}
// Gradients
.gradient(@startColor: #555, @endColor: #333) {
background-color: @endColor;
background-repeat: no-repeat;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor));
background-image: -moz-linear-gradient(@startColor, @endColor);
}
.three-color-gradient(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 0.5, @endColor: #c3325f) {
background-color: @endColor;
background-repeat: no-repeat;
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
background-image: -moz-linear-gradient(@startColor, color-stop(@midColor, @colorStop), @endColor);
}
// For links or buttons with background-image applied, and you want it to change on hover:
.hover(@dir: bottom){
&:hover{
background-position-y: @dir;
}
}