123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- /*
- * Copyright 2007 The Closure Library Authors. All Rights Reserved.
- *
- * Use of this source code is governed by the Apache License, Version 2.0.
- * See the COPYING file for details.
- */
- /**
- * CSS Inlay
- * Percentage based templates
- * @author ddiaz@google.com (Dustin Diaz)
- * @author elsigh@google.com (Lindsey Simon)
- * @fileoverview
- * The first ten templates are described using the following convention:
- * tpl-LEFT%-RIGHT% and tpl-LEFT%-RIGHT%-alt, where alt switches render order.
- *
- * The rationale for the percentage values are pretty fascinating.
- * Three nine's are needed for a miminal affordance in the gap between units
- * for Opera, while two for IE 5.5 and down.
- * Straight percentages seem to work fine otherwise, but the values here test
- * well cross-browser.
- *
- * Sample Usage:
- <div class="g-section g-tpl-50-50">
- <div class="g-unit g-first">
- <p>
- Lorem Ipsum...
- </p>
- </div>
- <div class="g-unit">
- <p>
- Lorem Ipsum...
- </p>
- </div>
- </div>
- */
- /* 25/75 */
- .g-tpl-25-75 .g-unit,
- .g-unit .g-tpl-25-75 .g-unit,
- .g-unit .g-unit .g-tpl-25-75 .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-25-75 .g-unit {
- width: 74.999%;
- float: right;
- margin: 0;
- }
- .g-unit .g-unit .g-unit .g-tpl-25-75 .g-first,
- .g-unit .g-unit .g-tpl-25-75 .g-first,
- .g-unit .g-tpl-25-75 .g-first,
- .g-tpl-25-75 .g-first {
- width: 24.999%;
- float: left;
- margin: 0;
- }
- /* 25/75-alt */
- .g-tpl-25-75-alt .g-unit,
- .g-unit .g-tpl-25-75-alt .g-unit,
- .g-unit .g-unit .g-tpl-25-75-alt .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-25-75-alt .g-unit {
- width: 24.999%;
- float: left;
- margin: 0;
- }
- .g-unit .g-unit .g-unit .g-tpl-25-75-alt .g-first,
- .g-unit .g-unit .g-tpl-25-75-alt .g-first,
- .g-unit .g-tpl-25-75-alt .g-first,
- .g-tpl-25-75-alt .g-first {
- width: 74.999%;
- float: right;
- margin: 0;
- }
- /* 75/25 */
- .g-tpl-75-25 .g-unit,
- .g-unit .g-tpl-75-25 .g-unit,
- .g-unit .g-unit .g-tpl-75-25 .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-75-25 .g-unit {
- width: 24.999%;
- float: right;
- margin: 0;
- }
- .g-unit .g-unit .g-unit .g-tpl-75-25 .g-first,
- .g-unit .g-unit .g-tpl-75-25 .g-first,
- .g-unit .g-tpl-75-25 .g-first,
- .g-tpl-75-25 .g-first {
- width: 74.999%;
- float: left;
- margin: 0;
- }
- /* 75/25-alt */
- .g-tpl-75-25-alt .g-unit,
- .g-unit .g-tpl-75-25-alt .g-unit,
- .g-unit .g-unit .g-tpl-75-25-alt .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-75-25-alt .g-unit {
- width: 74.999%;
- float: left;
- margin: 0;
- }
- .g-unit .g-unit .g-unit .g-tpl-75-25-alt .g-first,
- .g-unit .g-unit .g-tpl-75-25-alt .g-first,
- .g-unit .g-tpl-75-25-alt .g-first,
- .g-tpl-75-25-alt .g-first {
- width: 24.999%;
- float: right;
- margin: 0;
- }
- /* 33/67 */
- .g-tpl-33-67 .g-unit,
- .g-unit .g-tpl-33-67 .g-unit,
- .g-unit .g-unit .g-tpl-33-67 .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-33-67 .g-unit {
- width: 66.999%;
- float: right;
- margin: 0;
- }
- .g-unit .g-unit .g-unit .g-tpl-33-67 .g-first,
- .g-unit .g-unit .g-tpl-33-67 .g-first,
- .g-unit .g-tpl-33-67 .g-first,
- .g-tpl-33-67 .g-first {
- width: 32.999%;
- float: left;
- margin: 0;
- }
- /* 33/67-alt */
- .g-tpl-33-67-alt .g-unit,
- .g-unit .g-tpl-33-67-alt .g-unit,
- .g-unit .g-unit .g-tpl-33-67-alt .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-33-67-alt .g-unit {
- width: 32.999%;
- float: left;
- margin: 0;
- }
- .g-unit .g-unit .g-unit .g-tpl-33-67-alt .g-first,
- .g-unit .g-unit .g-tpl-33-67-alt .g-first,
- .g-unit .g-tpl-33-67-alt .g-first,
- .g-tpl-33-67-alt .g-first {
- width: 66.999%;
- float: right;
- margin: 0;
- }
- /* 67/33 */
- .g-tpl-67-33 .g-unit,
- .g-unit .g-tpl-67-33 .g-unit,
- .g-unit .g-unit .g-tpl-67-33 .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-67-33 .g-unit {
- width: 32.999%;
- float: right;
- margin: 0;
- }
- .g-unit .g-unit .g-unit .g-tpl-67-33 .g-first,
- .g-unit .g-unit .g-tpl-67-33 .g-first,
- .g-unit .g-tpl-67-33 .g-first,
- .g-tpl-67-33 .g-first {
- width: 66.999%;
- float: left;
- margin: 0;
- }
- /* 67/33-alt */
- .g-tpl-67-33-alt .g-unit,
- .g-unit .g-tpl-67-33-alt .g-unit,
- .g-unit .g-unit .g-tpl-67-33-alt .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-67-33-alt .g-unit {
- width: 66.999%;
- float: left;
- margin: 0;
- }
- .g-unit .g-unit .g-unit .g-tpl-67-33-alt .g-first,
- .g-unit .g-unit .g-tpl-67-33-alt .g-first,
- .g-unit .g-tpl-67-33-alt .g-first,
- .g-tpl-67-33-alt .g-first {
- width: 32.999%;
- float: right;
- margin: 0;
- }
- /* 50/50 */
- .g-tpl-50-50 .g-unit,
- .g-unit .g-tpl-50-50 .g-unit,
- .g-unit .g-unit .g-tpl-50-50 .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-50-50 .g-unit {
- width: 49.999%;
- float: right;
- margin: 0;
- }
- .g-unit .g-unit .g-unit .g-tpl-50-50 .g-first,
- .g-unit .g-unit .g-tpl-50-50 .g-first,
- .g-unit .g-tpl-50-50 .g-first,
- .g-tpl-50-50 .g-first {
- width: 49.999%;
- float: left;
- margin: 0;
- }
- /* 50/50-alt */
- .g-tpl-50-50-alt .g-unit,
- .g-unit .g-tpl-50-50-alt .g-unit,
- .g-unit .g-unit .g-tpl-50-50-alt .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-50-50-alt .g-unit {
- width: 49.999%;
- float: left;
- margin: 0;
- }
- .g-unit .g-unit .g-unit .g-tpl-50-50-alt .g-first,
- .g-unit .g-unit .g-tpl-50-50-alt .g-first,
- .g-unit .g-tpl-50-50-alt .g-first,
- .g-tpl-50-50-alt .g-first {
- width: 49.999%;
- float: right;
- margin: 0;
- }
- /**
- * Nest templates contain floating g-units.
- * For these, width needs to be reset from the 100% for inline-block
- * to auto. This fixes an issue with horizontal scrollbars.
- */
- .g-tpl-nest {
- width: auto;
- }
- /**
- * Making any g-sections inside of g-tpl-nests display inline instead
- * of display block solves an issue where inner sections add up incrementally
- * their widths to set the width of the outer g-unit. This causes all kinds of
- * problems with float-drops and display:inline fixes this.
- */
- .g-tpl-nest .g-section {
- display: inline;
- }
- /* g-tpl-nest for multi unit nesting (float left), say for a menu. */
- .g-tpl-nest .g-unit,
- .g-unit .g-tpl-nest .g-unit,
- .g-unit .g-unit .g-tpl-nest .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-nest .g-unit {
- float: left;
- width: auto;
- margin: 0;
- }
- /* g-tpl-nest-alt for multi unit nesting (float right), say for a menu. */
- .g-tpl-nest-alt .g-unit,
- .g-unit .g-tpl-nest-alt .g-unit,
- .g-unit .g-unit .g-tpl-nest-alt .g-unit,
- .g-unit .g-unit .g-unit .g-tpl-nest-alt .g-unit {
- float: right;
- width: auto;
- margin: 0;
- }
|