-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrid.scss
154 lines (132 loc) · 2.35 KB
/
grid.scss
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
//Variables for grid. Replace with your values.
$gutter: 10px;
$column_width: 71px;
$total_columns: 12;
$text_based_input_padding: 2px;
//Calculates page width. Please do not alter.
$total_page_width: (($total_columns * $column_width) + (($total_columns - 1) * $gutter));
//shared styles and mixins
.block
{
display: block;
}
@mixin float($float)
{
float: $float;
}
@mixin clear($clear)
{
clear: $clear;
}
@mixin top($top)
{
top: $top;
}
@mixin font_size($size)
{
font:
{
size: $size;
}
}
//The Grid
label
{
float: left;
margin-left: $gutter;
}
//calculate grid unit, text-base and select input and table cell widths
@for $i from 1 through $total_columns
{
$width: ($column_width * $i) + ($gutter * ($i - 1));
//columns
.unitx#{$i}
{
@if $i == $total_columns
{
margin-left: 0 !important;
width: $total_page_width;
}
@else
{
width: $width;
}
}
//text-based and select form inputs
label.unitx#{$i}
{
input[type="text"],
input[type="password"],
input[type="select"],
input[type="search"],
input[type="tel"],
input[type="email"],
input[type="url"],
select
{
width: ($width - ($text_based_input_padding * 2));
}
}
//form labels
label.unitx#{$i}
{
@if $i == 1 or $i == $total_columns
{
margin-left: 0;
}
@if $i == $total_columns
{
width: $total_page_width;
float: none;
}
}
//table cells
th, td
{
&.unitx#{$i}
{
width: $width;
}
}
}
#page
{
width: $total_page_width;
position: relative;
padding: 0 $gutter;
&:after
{
@extend .block;
@include clear(both);
content: ".";
height: 0;
visibility: hidden;
}
}
/* Base column markup */
.column
{
display: block;
float: left;
margin-left: $gutter;
&.first
{
margin-left: 0;
}
}
.colgroup, .align-left, .clear
{
@extend .block;
@include float(left);
}
.first, .no-gutter
{
margin-left: 0;
}
.first { @include clear(left); }
.gutter { margin-left: $gutter; }
.align-right { @include float(right); text-align: right; }
header,
section { padding-bottom: 18px; }
.leading { margin-bottom: 18px; }
.noleading { margin-bottom: 0 !important; }