1
|
/**
|
2
|
* @file
|
3
|
* Positioning for a fixed-width, desktop-centric layout.
|
4
|
*
|
5
|
* Define CSS classes to create a table-free, 3-column, 2-column, or single
|
6
|
* column layout depending on whether blocks are enabled in the left or right
|
7
|
* columns.
|
8
|
*
|
9
|
* This layout uses the Zen Grids plugin for Compass: http://zengrids.com
|
10
|
*/
|
11
|
|
12
|
@import "base";
|
13
|
|
14
|
|
15
|
// We are going to create a 980px wide, 5 column grid with 20px gutters between
|
16
|
// columns (applied as 10px of left/right padding on each column).
|
17
|
$zen-column-count: 5;
|
18
|
$zen-gutter-width: 20px;
|
19
|
$zen-grid-width: 980px;
|
20
|
|
21
|
|
22
|
// IE6-7 don't support box-sizing: border-box. We can fix this in 1 of 2 ways:
|
23
|
// - (Preferred) Install the box-sizing polyfill and set the variable below to
|
24
|
// the absolute path URL to the boxsizing.htc file.
|
25
|
// @see https://github.com/Schepp/box-sizing-polyfill
|
26
|
// $box-sizing-polyfill-path: "/path/to/boxsizing.htc";
|
27
|
// - Use the same CSS unit for grid width and gutter width (use px for both or
|
28
|
// use % for both, etc.) and set the box-sizing variable to content-box.
|
29
|
$zen-box-sizing: content-box;
|
30
|
|
31
|
|
32
|
// You can generate more efficient CSS if you manually apply the
|
33
|
// zen-grid-item-base mixin to all grid items from within a single ruleset.
|
34
|
$zen-auto-include-item-base: false;
|
35
|
// $zen-auto-include-flow-item-base: false;
|
36
|
|
37
|
|
38
|
/*
|
39
|
* Center the page.
|
40
|
*/
|
41
|
|
42
|
#page,
|
43
|
.region-bottom {
|
44
|
/* If you want to make the page a fixed width and centered in the viewport,
|
45
|
* this is the standards-compliant way to do that. */
|
46
|
margin-left: auto;
|
47
|
margin-right: auto;
|
48
|
width: $zen-grid-width;
|
49
|
}
|
50
|
|
51
|
/*
|
52
|
* Apply the shared properties of grid items in a single, efficient ruleset.
|
53
|
*/
|
54
|
// See the note about $zen-auto-include-item-base above.
|
55
|
|
56
|
#header,
|
57
|
#content,
|
58
|
#navigation,
|
59
|
.region-sidebar-first,
|
60
|
.region-sidebar-second,
|
61
|
#footer {
|
62
|
@include zen-grid-item-base();
|
63
|
}
|
64
|
|
65
|
/*
|
66
|
* Containers for grid items and flow items.
|
67
|
*/
|
68
|
|
69
|
#header,
|
70
|
#main,
|
71
|
#footer {
|
72
|
@include zen-grid-container();
|
73
|
}
|
74
|
|
75
|
/*
|
76
|
* Navigation bar
|
77
|
*/
|
78
|
|
79
|
#main {
|
80
|
padding-top: 3em; /* Move all the children of #main down to make room. */
|
81
|
position: relative;
|
82
|
}
|
83
|
#navigation {
|
84
|
position: absolute;
|
85
|
top: 0; /* Move the navbar up inside #main's padding. */
|
86
|
height: 3em;
|
87
|
width: $zen-grid-width - $zen-gutter-width;
|
88
|
}
|
89
|
|
90
|
/*
|
91
|
* The layout when there is only one sidebar, the left one.
|
92
|
*/
|
93
|
|
94
|
.sidebar-first {
|
95
|
#content { /* Span 4 columns, starting in 2nd column from left. */
|
96
|
@include zen-grid-item(4, 2);
|
97
|
}
|
98
|
|
99
|
.region-sidebar-first { /* Span 1 column, starting in 1st column from left. */
|
100
|
@include zen-grid-item(1, 1);
|
101
|
}
|
102
|
}
|
103
|
|
104
|
/*
|
105
|
* The layout when there is only one sidebar, the right one.
|
106
|
*/
|
107
|
|
108
|
.sidebar-second {
|
109
|
#content { /* Span 4 columns, starting in 1st column from left. */
|
110
|
@include zen-grid-item(4, 1);
|
111
|
}
|
112
|
|
113
|
.region-sidebar-second { /* Span 1 column, starting in 5th column from left. */
|
114
|
@include zen-grid-item(1, 5);
|
115
|
}
|
116
|
}
|
117
|
|
118
|
/*
|
119
|
* The layout when there are two sidebars.
|
120
|
*/
|
121
|
|
122
|
.two-sidebars {
|
123
|
#content { /* Span 3 columns, starting in 2nd column from left. */
|
124
|
@include zen-grid-item(3, 2);
|
125
|
}
|
126
|
|
127
|
.region-sidebar-first { /* Span 1 column, starting in 1st column from left. */
|
128
|
@include zen-grid-item(1, 1);
|
129
|
}
|
130
|
|
131
|
.region-sidebar-second { /* Span 1 column, starting in 5th column from left. */
|
132
|
@include zen-grid-item(1, 5);
|
133
|
}
|
134
|
}
|