Advertisement
Sk8erPeter

fixed-width.scss in Zen

Aug 28th, 2012
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 3.56 KB | None | 0 0
  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 920px 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:    920px;
  20. $zen-grid-width:    920px;
  21.  
  22.  
  23. // IE6-7 don't support box-sizing: border-box. We can fix this in 1 of 2 ways:
  24. // - (Preferred) Install the box-sizing polyfill and set the variable below to
  25. //   the absolute path URL to the boxsizing.htc file.
  26. //   @see https://github.com/Schepp/box-sizing-polyfill
  27. //   $box-sizing-polyfill-path: "/path/to/boxsizing.htc";
  28. $box-sizing-polyfill-path: "/drupal/sites/all/themes/zenvizimalmok/box-sizing-polyfill/boxsizing.htc";
  29. // - Use the same CSS unit for grid width and gutter width (use px for both or
  30. //   use % for both, etc.) and set the box-sizing variable to content-box.
  31.     $zen-box-sizing: content-box;
  32.  
  33.  
  34. // You can generate more efficient CSS if you manually apply the
  35. // zen-grid-item-base mixin to all grid items from within a single ruleset.
  36. $zen-auto-include-item-base: false;
  37. // $zen-auto-include-flow-item-base: false;
  38.  
  39.  
  40. /*
  41. * Center the page.
  42. */
  43.  
  44. #page,
  45. .region-bottom {
  46.  /* If you want to make the page a fixed width and centered in the viewport,
  47.   * this is the standards-compliant way to do that. */
  48.  margin-left: auto;
  49.  margin-right: auto;
  50.  width: $zen-grid-width;
  51. }
  52.  
  53. /*
  54. * Apply the shared properties of grid items in a single, efficient ruleset.
  55. */
  56. // See the note about $zen-auto-include-item-base above.
  57.  
  58. #header,
  59. #banner,
  60. #content,
  61. #navigation,
  62. .region-sidebar-first,
  63. .region-sidebar-second,
  64. #footer {
  65.  @include zen-grid-item-base();
  66. }
  67.  
  68. /*
  69. * Containers for grid items and flow items.
  70. */
  71.  
  72. #header,
  73. #main,
  74. #footer {
  75.  @include zen-grid-container();
  76. }
  77.  
  78. /*
  79. * Navigation bar
  80. */
  81.  
  82. #main {
  83.  // padding-top: 3em; /* Move all the children of #main down to make room. */
  84.  padding-top: 1em; /* Move all the children of #main down to make room. */
  85.  position: relative;
  86. }
  87. #navigation {
  88.  position: absolute;
  89.  top: 0; /* Move the navbar up inside #main's padding. */
  90.   height: 3em;
  91.   width: $zen-grid-width - $zen-gutter-width;
  92. }
  93.  
  94. /*
  95.  * The layout when there is only one sidebar, the left one.
  96.  */
  97.  
  98. .sidebar-first {
  99.   #content { /* Span 4 columns, starting in 2nd column from left. */
  100.     @include zen-grid-item(4, 2);
  101.   }
  102.  
  103.   .region-sidebar-first { /* Span 1 column, starting in 1st column from left. */
  104.     @include zen-grid-item(1, 1);
  105.   }
  106. }
  107.  
  108. /*
  109.  * The layout when there is only one sidebar, the right one.
  110.  */
  111.  
  112. .sidebar-second {
  113.   #content { /* Span 4 columns, starting in 1st column from left. */
  114.     @include zen-grid-item(4, 1);
  115.   }
  116.  
  117.   .region-sidebar-second { /* Span 1 column, starting in 5th column from left. */
  118.     @include zen-grid-item(1, 5);
  119.   }
  120. }
  121.  
  122. /*
  123.  * The layout when there are two sidebars.
  124.  */
  125.  
  126. .two-sidebars {
  127.   #content { /* Span 3 columns, starting in 2nd column from left. */
  128.     @include zen-grid-item(3, 2);
  129.   }
  130.  
  131.   .region-sidebar-first { /* Span 1 column, starting in 1st column from left. */
  132.     @include zen-grid-item(1, 1);
  133.   }
  134.  
  135.   .region-sidebar-second { /* Span 1 column, starting in 5th column from left. */
  136.     @include zen-grid-item(1, 5);
  137.   }
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement