g-ratio.css 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /*
  2. * Copyright 2007 The Closure Library Authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by the Apache License, Version 2.0.
  5. * See the COPYING file for details.
  6. */
  7. /**
  8. * CSS Inlay
  9. * Percentage based templates
  10. * @author ddiaz@google.com (Dustin Diaz)
  11. * @author elsigh@google.com (Lindsey Simon)
  12. * @fileoverview
  13. * The first ten templates are described using the following convention:
  14. * tpl-LEFT%-RIGHT% and tpl-LEFT%-RIGHT%-alt, where alt switches render order.
  15. *
  16. * The rationale for the percentage values are pretty fascinating.
  17. * Three nine's are needed for a miminal affordance in the gap between units
  18. * for Opera, while two for IE 5.5 and down.
  19. * Straight percentages seem to work fine otherwise, but the values here test
  20. * well cross-browser.
  21. *
  22. * Sample Usage:
  23. <div class="g-section g-tpl-50-50">
  24. <div class="g-unit g-first">
  25. <p>
  26. Lorem Ipsum...
  27. </p>
  28. </div>
  29. <div class="g-unit">
  30. <p>
  31. Lorem Ipsum...
  32. </p>
  33. </div>
  34. </div>
  35. */
  36. /* 25/75 */
  37. .g-tpl-25-75 .g-unit,
  38. .g-unit .g-tpl-25-75 .g-unit,
  39. .g-unit .g-unit .g-tpl-25-75 .g-unit,
  40. .g-unit .g-unit .g-unit .g-tpl-25-75 .g-unit {
  41. width: 74.999%;
  42. float: right;
  43. margin: 0;
  44. }
  45. .g-unit .g-unit .g-unit .g-tpl-25-75 .g-first,
  46. .g-unit .g-unit .g-tpl-25-75 .g-first,
  47. .g-unit .g-tpl-25-75 .g-first,
  48. .g-tpl-25-75 .g-first {
  49. width: 24.999%;
  50. float: left;
  51. margin: 0;
  52. }
  53. /* 25/75-alt */
  54. .g-tpl-25-75-alt .g-unit,
  55. .g-unit .g-tpl-25-75-alt .g-unit,
  56. .g-unit .g-unit .g-tpl-25-75-alt .g-unit,
  57. .g-unit .g-unit .g-unit .g-tpl-25-75-alt .g-unit {
  58. width: 24.999%;
  59. float: left;
  60. margin: 0;
  61. }
  62. .g-unit .g-unit .g-unit .g-tpl-25-75-alt .g-first,
  63. .g-unit .g-unit .g-tpl-25-75-alt .g-first,
  64. .g-unit .g-tpl-25-75-alt .g-first,
  65. .g-tpl-25-75-alt .g-first {
  66. width: 74.999%;
  67. float: right;
  68. margin: 0;
  69. }
  70. /* 75/25 */
  71. .g-tpl-75-25 .g-unit,
  72. .g-unit .g-tpl-75-25 .g-unit,
  73. .g-unit .g-unit .g-tpl-75-25 .g-unit,
  74. .g-unit .g-unit .g-unit .g-tpl-75-25 .g-unit {
  75. width: 24.999%;
  76. float: right;
  77. margin: 0;
  78. }
  79. .g-unit .g-unit .g-unit .g-tpl-75-25 .g-first,
  80. .g-unit .g-unit .g-tpl-75-25 .g-first,
  81. .g-unit .g-tpl-75-25 .g-first,
  82. .g-tpl-75-25 .g-first {
  83. width: 74.999%;
  84. float: left;
  85. margin: 0;
  86. }
  87. /* 75/25-alt */
  88. .g-tpl-75-25-alt .g-unit,
  89. .g-unit .g-tpl-75-25-alt .g-unit,
  90. .g-unit .g-unit .g-tpl-75-25-alt .g-unit,
  91. .g-unit .g-unit .g-unit .g-tpl-75-25-alt .g-unit {
  92. width: 74.999%;
  93. float: left;
  94. margin: 0;
  95. }
  96. .g-unit .g-unit .g-unit .g-tpl-75-25-alt .g-first,
  97. .g-unit .g-unit .g-tpl-75-25-alt .g-first,
  98. .g-unit .g-tpl-75-25-alt .g-first,
  99. .g-tpl-75-25-alt .g-first {
  100. width: 24.999%;
  101. float: right;
  102. margin: 0;
  103. }
  104. /* 33/67 */
  105. .g-tpl-33-67 .g-unit,
  106. .g-unit .g-tpl-33-67 .g-unit,
  107. .g-unit .g-unit .g-tpl-33-67 .g-unit,
  108. .g-unit .g-unit .g-unit .g-tpl-33-67 .g-unit {
  109. width: 66.999%;
  110. float: right;
  111. margin: 0;
  112. }
  113. .g-unit .g-unit .g-unit .g-tpl-33-67 .g-first,
  114. .g-unit .g-unit .g-tpl-33-67 .g-first,
  115. .g-unit .g-tpl-33-67 .g-first,
  116. .g-tpl-33-67 .g-first {
  117. width: 32.999%;
  118. float: left;
  119. margin: 0;
  120. }
  121. /* 33/67-alt */
  122. .g-tpl-33-67-alt .g-unit,
  123. .g-unit .g-tpl-33-67-alt .g-unit,
  124. .g-unit .g-unit .g-tpl-33-67-alt .g-unit,
  125. .g-unit .g-unit .g-unit .g-tpl-33-67-alt .g-unit {
  126. width: 32.999%;
  127. float: left;
  128. margin: 0;
  129. }
  130. .g-unit .g-unit .g-unit .g-tpl-33-67-alt .g-first,
  131. .g-unit .g-unit .g-tpl-33-67-alt .g-first,
  132. .g-unit .g-tpl-33-67-alt .g-first,
  133. .g-tpl-33-67-alt .g-first {
  134. width: 66.999%;
  135. float: right;
  136. margin: 0;
  137. }
  138. /* 67/33 */
  139. .g-tpl-67-33 .g-unit,
  140. .g-unit .g-tpl-67-33 .g-unit,
  141. .g-unit .g-unit .g-tpl-67-33 .g-unit,
  142. .g-unit .g-unit .g-unit .g-tpl-67-33 .g-unit {
  143. width: 32.999%;
  144. float: right;
  145. margin: 0;
  146. }
  147. .g-unit .g-unit .g-unit .g-tpl-67-33 .g-first,
  148. .g-unit .g-unit .g-tpl-67-33 .g-first,
  149. .g-unit .g-tpl-67-33 .g-first,
  150. .g-tpl-67-33 .g-first {
  151. width: 66.999%;
  152. float: left;
  153. margin: 0;
  154. }
  155. /* 67/33-alt */
  156. .g-tpl-67-33-alt .g-unit,
  157. .g-unit .g-tpl-67-33-alt .g-unit,
  158. .g-unit .g-unit .g-tpl-67-33-alt .g-unit,
  159. .g-unit .g-unit .g-unit .g-tpl-67-33-alt .g-unit {
  160. width: 66.999%;
  161. float: left;
  162. margin: 0;
  163. }
  164. .g-unit .g-unit .g-unit .g-tpl-67-33-alt .g-first,
  165. .g-unit .g-unit .g-tpl-67-33-alt .g-first,
  166. .g-unit .g-tpl-67-33-alt .g-first,
  167. .g-tpl-67-33-alt .g-first {
  168. width: 32.999%;
  169. float: right;
  170. margin: 0;
  171. }
  172. /* 50/50 */
  173. .g-tpl-50-50 .g-unit,
  174. .g-unit .g-tpl-50-50 .g-unit,
  175. .g-unit .g-unit .g-tpl-50-50 .g-unit,
  176. .g-unit .g-unit .g-unit .g-tpl-50-50 .g-unit {
  177. width: 49.999%;
  178. float: right;
  179. margin: 0;
  180. }
  181. .g-unit .g-unit .g-unit .g-tpl-50-50 .g-first,
  182. .g-unit .g-unit .g-tpl-50-50 .g-first,
  183. .g-unit .g-tpl-50-50 .g-first,
  184. .g-tpl-50-50 .g-first {
  185. width: 49.999%;
  186. float: left;
  187. margin: 0;
  188. }
  189. /* 50/50-alt */
  190. .g-tpl-50-50-alt .g-unit,
  191. .g-unit .g-tpl-50-50-alt .g-unit,
  192. .g-unit .g-unit .g-tpl-50-50-alt .g-unit,
  193. .g-unit .g-unit .g-unit .g-tpl-50-50-alt .g-unit {
  194. width: 49.999%;
  195. float: left;
  196. margin: 0;
  197. }
  198. .g-unit .g-unit .g-unit .g-tpl-50-50-alt .g-first,
  199. .g-unit .g-unit .g-tpl-50-50-alt .g-first,
  200. .g-unit .g-tpl-50-50-alt .g-first,
  201. .g-tpl-50-50-alt .g-first {
  202. width: 49.999%;
  203. float: right;
  204. margin: 0;
  205. }
  206. /**
  207. * Nest templates contain floating g-units.
  208. * For these, width needs to be reset from the 100% for inline-block
  209. * to auto. This fixes an issue with horizontal scrollbars.
  210. */
  211. .g-tpl-nest {
  212. width: auto;
  213. }
  214. /**
  215. * Making any g-sections inside of g-tpl-nests display inline instead
  216. * of display block solves an issue where inner sections add up incrementally
  217. * their widths to set the width of the outer g-unit. This causes all kinds of
  218. * problems with float-drops and display:inline fixes this.
  219. */
  220. .g-tpl-nest .g-section {
  221. display: inline;
  222. }
  223. /* g-tpl-nest for multi unit nesting (float left), say for a menu. */
  224. .g-tpl-nest .g-unit,
  225. .g-unit .g-tpl-nest .g-unit,
  226. .g-unit .g-unit .g-tpl-nest .g-unit,
  227. .g-unit .g-unit .g-unit .g-tpl-nest .g-unit {
  228. float: left;
  229. width: auto;
  230. margin: 0;
  231. }
  232. /* g-tpl-nest-alt for multi unit nesting (float right), say for a menu. */
  233. .g-tpl-nest-alt .g-unit,
  234. .g-unit .g-tpl-nest-alt .g-unit,
  235. .g-unit .g-unit .g-tpl-nest-alt .g-unit,
  236. .g-unit .g-unit .g-unit .g-tpl-nest-alt .g-unit {
  237. float: right;
  238. width: auto;
  239. margin: 0;
  240. }