-
Notifications
You must be signed in to change notification settings - Fork 7
/
960-percentages.less
47 lines (42 loc) · 1 KB
/
960-percentages.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
// Defining number of columns in the grid.
// Common Values would be 12, 16 or 24
@width: 90%;
@def_grid: 16;
.container(){
margin:0 auto;
width:@width;
}
// Works out the width of elements based
// on total number of columns and width
// number of columns being displayed.
// Removes 20px for margins
.grid(@grid:@def_grid,@cols:'',@float:left,@display:inline){
display:@display;
float:@float;
margin:0 @margin;
width:(100%/@grid * @cols) - (@margin * 2);
}
// Allows for padding before element
.prefix(@grid:@def_grid,@cols:''){
padding-left:(100%/@grid * @cols);
}
// Allows for padding after element
.suffix(@grid:@def_grid,@cols:''){
padding-right:(100%/@grid * @cols);
}
// Removes left margin
.alpha(){
margin-left:0;
}
// Removes right margin
.omega(){
margin-right:0;
}
.push(@grid:@def_grid,@move:'') {
position:relative;
left:(100%/@grid * @move);
}
.pull(@grid:@def_grid,@move:''){
position:relative;
left:(100%/@grid * @move) * -1;
}