Projet

Général

Profil

Paste
Télécharger (5,14 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / zen / STARTERKIT / sass / layouts / _responsive.scss @ a1cafe7e

1
/**
2
 * @file
3
 * Positioning for a responsive layout.
4
 *
5
 * Define CSS classes to create a fluid grid layout with optional sidebars
6
 * depending on whether blocks are placed in the left or right sidebars.
7
 *
8
 * This layout uses the Zen Grids plugin for Compass: http://zengrids.com
9
 */
10

    
11
// We are going to create a fluid grid with 1, 3, or 5 columns and 20px gutters
12
// between columns (applied as 10px of left/right padding on each column).
13
$zen-column-count:  1;
14
$zen-gutter-width:  20px;
15

    
16
// If you need IE6/7 support for box-sizing: border-box (default), see _init.scss
17
//$zen-box-sizing: content-box;
18

    
19
// You can generate more efficient CSS if you manually apply the
20
// zen-grid-item-base mixin to all grid items from within a single ruleset.
21
$zen-auto-include-item-base: false;
22
// $zen-auto-include-flow-item-base: false;
23

    
24
// Suppress this section of CSS for RTL layouts since it contains no CSS that
25
// needs RTL-specific overrides.
26
@if $zen-reverse-all-floats == false {
27

    
28
/**
29
 * Center the page.
30
 *
31
 * For screen sizes larger than 1200px, prevent excessively long lines of text
32
 * by setting a max-width.
33
 */
34
#page,
35
.region-bottom {
36
  margin-left: auto;
37
  margin-right: auto;
38
  max-width: 1200px;
39
}
40

    
41
/* Apply the shared properties of grid items in a single, efficient ruleset. */
42
#header,
43
#content,
44
#navigation,
45
.region-sidebar-first,
46
.region-sidebar-second,
47
#footer {
48
  // See the note about $zen-auto-include-item-base above.
49
  @include zen-grid-item-base();
50
}
51

    
52
/* Containers for grid items and flow items. */
53
#header,
54
#main,
55
#footer {
56
  @include zen-grid-container();
57
}
58

    
59
/* Navigation bar */
60
@media all and (min-width: 480px) {
61
  #main {
62
    /* Move all the children of #main down to make room. */
63
    padding-top: $nav-height;
64
    position: relative;
65
  }
66
  #navigation {
67
    /* Move the navbar up inside #main's padding. */
68
    position: absolute;
69
    top: 0;
70
    height: $nav-height;
71
    width: $zen-grid-width;
72
  }
73
}
74

    
75
} // End of @if $zen-reverse-all-floats == false
76

    
77
/**
78
 * Use 3 grid columns for smaller screens.
79
 */
80
@media all and (min-width: 480px) and (max-width: 959px) {
81

    
82
  $zen-column-count: 3;
83

    
84
  /**
85
   * The layout when there is only one sidebar, the left one.
86
   */
87
  .sidebar-first {
88
    /* Span 2 columns, starting in 2nd column from left. */
89
    #content {
90
      @include zen-grid-item(2, 2);
91
    }
92

    
93
    /* Span 1 column, starting in 1st column from left. */
94
    .region-sidebar-first {
95
      @include zen-grid-item(1, 1);
96
    }
97
  }
98

    
99
  /**
100
   * The layout when there is only one sidebar, the right one.
101
   */
102
  .sidebar-second {
103
    /* Span 2 columns, starting in 1st column from left. */
104
    #content {
105
      @include zen-grid-item(2, 1);
106
    }
107

    
108
    /* Span 1 column, starting in 3rd column from left. */
109
    .region-sidebar-second {
110
      @include zen-grid-item(1, 3);
111
    }
112
  }
113

    
114
  /**
115
   * The layout when there are two sidebars.
116
   */
117
  .two-sidebars {
118
    /* Span 2 columns, starting in 2nd column from left. */
119
    #content {
120
      @include zen-grid-item(2, 2);
121
    }
122

    
123
    /* Span 1 column, starting in 1st column from left. */
124
    .region-sidebar-first {
125
      @include zen-grid-item(1, 1);
126
    }
127

    
128
    /* Start a new row and span all 3 columns. */
129
    .region-sidebar-second {
130
      @include zen-grid-item(3, 1);
131
      @include zen-nested-container(); // Since we're making every block in this region be a grid item.
132
      @include zen-clear();
133

    
134
      /* Apply the shared properties of grid items in a single, efficient ruleset. */
135
      .block {
136
        @include zen-grid-item-base();
137
      }
138
      /* Span 1 column, starting in the 1st column from left. */
139
      .block:nth-child(3n+1) {
140
        @include zen-grid-item(1, 1);
141
        @include zen-clear();
142
      }
143
      /* Span 1 column, starting in the 2nd column from left. */
144
      .block:nth-child(3n+2) {
145
        @include zen-grid-item(1, 2);
146
      }
147
      /* Span 1 column, starting in the 3rd column from left. */
148
      .block:nth-child(3n) {
149
        @include zen-grid-item(1, 3);
150
      }
151
    }
152
  }
153
}
154

    
155
/**
156
 * Use 5 grid columns for larger screens.
157
 */
158
@media all and (min-width: 960px) {
159

    
160
  $zen-column-count: 5;
161

    
162
  /**
163
   * The layout when there is only one sidebar, the left one.
164
   */
165
  .sidebar-first {
166
    /* Span 4 columns, starting in 2nd column from left. */
167
    #content {
168
      @include zen-grid-item(4, 2);
169
    }
170

    
171
    /* Span 1 column, starting in 1st column from left. */
172
    .region-sidebar-first {
173
      @include zen-grid-item(1, 1);
174
    }
175
  }
176

    
177
  /**
178
   * The layout when there is only one sidebar, the right one.
179
   */
180
  .sidebar-second {
181
    /* Span 4 columns, starting in 1st column from left. */
182
    #content {
183
      @include zen-grid-item(4, 1);
184
    }
185

    
186
    /* Span 1 column, starting in 5th column from left. */
187
    .region-sidebar-second {
188
      @include zen-grid-item(1, 5);
189
    }
190
  }
191

    
192
  /**
193
   * The layout when there are two sidebars.
194
   */
195
  .two-sidebars {
196
    /* Span 3 columns, starting in 2nd column from left. */
197
    #content {
198
      @include zen-grid-item(3, 2);
199
    }
200

    
201
    /* Span 1 column, starting in 1st column from left. */
202
    .region-sidebar-first {
203
      @include zen-grid-item(1, 1);
204
    }
205

    
206
    /* Span 1 column, starting in 5th column from left. */
207
    .region-sidebar-second {
208
      @include zen-grid-item(1, 5);
209
    }
210
  }
211
}