PageRenderTime 51ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/wp-content/themes/thesis_17/lib/classes/css.php

https://github.com/JGrubb/Almond-Tree
PHP | 708 lines | 611 code | 64 blank | 33 comment | 92 complexity | 97482f37340781b988e014b53fab3267 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /**
  3. * css.php — Handles font-related styling and information.
  4. *
  5. * @package Thesis
  6. * @since 1.5
  7. * @subpackage Styling
  8. */
  9. /**
  10. * class Thesis_CSS
  11. *
  12. * Constructs the Thesis layout according to the options chosen in the Design Options panel (and the multimedia box settings)
  13. */
  14. class Thesis_CSS {
  15. function build() {
  16. $this->baselines();
  17. $this->widths();
  18. $this->content();
  19. $this->teasers();
  20. $this->colors();
  21. $this->borders();
  22. }
  23. function baselines() {
  24. $thesis_design = new thesis_design_options;
  25. $thesis_design->get_options();
  26. $this->base['num'] = 10;
  27. $this->fonts = $thesis_design->fonts;
  28. $this->colors = $thesis_design->colors;
  29. $this->borders = $thesis_design->borders;
  30. $this->nav = $thesis_design->nav;
  31. $this->layout = $thesis_design->layout;
  32. $this->teasers = $thesis_design->teasers;
  33. $this->feature_box = $thesis_design->feature_box;
  34. $this->multimedia_box = $thesis_design->multimedia_box;
  35. // Calculate line heights
  36. if (is_array($this->fonts['sizes'])) {
  37. foreach ($this->fonts['sizes'] as $area => $size) {
  38. if ($area == 'header' || $area == 'tagline' || $area == 'sidebars' || $area == 'code') {
  39. $line_height = $size + 6;
  40. if ($line_height % 2 == 1)
  41. $line_height = $line_height - 1;
  42. }
  43. elseif ($area == 'nav_menu') {
  44. $line_height = $size + 4;
  45. if ($line_height % 2 == 1)
  46. $line_height = $line_height - 1;
  47. }
  48. else {
  49. $line_height = $size + 8;
  50. if ($line_height % 2 == 1)
  51. $line_height = $line_height - 1;
  52. }
  53. $this->line_heights[$area] = $line_height;
  54. }
  55. }
  56. $this->base['horizontal'] = $this->line_heights['content'];
  57. $this->base['page_padding'] = ($this->layout['page_padding']) ? $this->line_heights['content'] * $this->layout['page_padding'] : 0;
  58. }
  59. function widths() {
  60. // Set baseline width elements (these are the basis for the horizontal cadence, if you will)
  61. $horizontal_spacing = array(
  62. 'single' => $this->base['horizontal'],
  63. 'half' => $this->base['horizontal'] / 2
  64. );
  65. // Thesis-specific width constants
  66. $widths['header_padding'] = $horizontal_spacing['half'];
  67. $widths['sidebar_padding'] = $horizontal_spacing['single'];
  68. $widths['teaser_margin'] = $horizontal_spacing['single'];
  69. $widths['mm_box_padding'] = $horizontal_spacing['single'];
  70. $widths['mm_image_padding'] = 1;
  71. $borders['mm_image'] = 1;
  72. $borders['nested'] = 1;
  73. $this->form_input = array(
  74. 'border' => array(
  75. 'top' => 1,
  76. 'right' => 1,
  77. 'bottom' => 1,
  78. 'left' => 1
  79. ),
  80. 'padding' => 3
  81. );
  82. // Generate various style variables based upon specified structure.
  83. if ($this->layout['columns'] == 2 || $this->layout['columns'] == 3) {
  84. $borders['content'] = ($this->borders['show']) ? 1 : 0;
  85. if ($this->layout['order'] == 'normal') { // Content on the left
  86. $widths['post_box_margin_left'] = $widths['comment_padding'] = $widths['prev_next_padding_left'] = $horizontal_spacing['half'];
  87. $widths['comment_margin_left'] = 0;
  88. $floats['content'] = 'float: left; ';
  89. $floats['sidebars'] = 'float: right; ';
  90. $special_comment_css = 'margin-left: ' . round(($widths['post_box_margin_left'] / $this->base['num']), 1) . 'em;';
  91. if ($this->layout['columns'] == 2)
  92. $widths['post_box_margin_right'] = $widths['comment_margin_right'] = $widths['prev_next_padding_right'] = $horizontal_spacing['single'] + 1;
  93. else
  94. $widths['post_box_margin_right'] = $widths['comment_margin_right'] = $widths['prev_next_padding_right'] = $horizontal_spacing['single'];
  95. }
  96. elseif ($this->layout['order'] == 'invert') { // Content in the middle (3-column only)
  97. $widths['post_box_margin_left'] = $widths['post_box_margin_right'] = $widths['comment_padding'] = $widths['prev_next_padding_left'] = $widths['prev_next_padding_right'] = $horizontal_spacing['single'];
  98. $widths['comment_margin_left'] = $widths['comment_margin_right'] = 0;
  99. $floats['content'] = 'float: right; ';
  100. $floats['sidebars'] = 'float: right; ';
  101. $special_comment_css = 'margin-right: ' . round(($widths['post_box_margin_right'] / $this->base['num']), 1) . 'em; margin-left: ' . round(($widths['post_box_margin_left'] / $this->base['num']), 1) . 'em;';
  102. }
  103. else { // Content on the right
  104. $widths['post_box_margin_left'] = $widths['prev_next_padding_left'] = $horizontal_spacing['single'];
  105. $widths['comment_margin_left'] = $widths['comment_margin_right'] = $widths['comment_padding'] = $horizontal_spacing['half'];
  106. $floats['content'] = 'float: right; ';
  107. $floats['sidebars'] = 'float: left; ';
  108. $special_comment_css = 'margin-left: ' . round(($widths['comment_margin_left'] / $this->base['num']), 1) . 'em;';
  109. if ($this->layout['columns'] == 2)
  110. $widths['post_box_margin_right'] = $widths['prev_next_padding_right'] = $horizontal_spacing['half'] - 1;
  111. else
  112. $widths['post_box_margin_right'] = $widths['prev_next_padding_right'] = $horizontal_spacing['half'];
  113. }
  114. if ($this->layout['columns'] == 3) {
  115. $widths['content'] = $this->layout['widths']['content'] + $widths['post_box_margin_left'] + $widths['post_box_margin_right'] + $borders['content'];
  116. $borders['sidebar'] = ($this->borders['show']) ? 1 : 0;
  117. $widths['total_sidebars'] = $this->layout['widths']['sidebar_1'] + $this->layout['widths']['sidebar_2'] + (2 * $widths['sidebar_padding']) + $borders['sidebar'];
  118. $widths['multimedia_box'] = $widths['total_sidebars'] - (2 * $widths['mm_box_padding']);
  119. $widths['content_box'] = $widths['content'] + $widths['total_sidebars'];
  120. $widths['container'] = $widths['content_box'] + (2 * $this->base['page_padding']);
  121. if ($this->layout['order'] == 'invert') {
  122. $widths['sidebars_box'] = $this->layout['widths']['sidebar_2'] + $widths['sidebar_padding'];
  123. $widths['column_wrap'] = $widths['content_box_bg_position'] = $this->layout['widths']['content'] + $widths['post_box_margin_left'] + $widths['post_box_margin_right'] + $borders['content'] + $this->layout['widths']['sidebar_1'] + $widths['sidebar_padding'];
  124. $widths['column_wrap_bg_position'] = $this->layout['widths']['sidebar_1'] + $widths['sidebar_padding'];
  125. $widths['nested_padding'] = $widths['comment_padding'];
  126. $wrap_border = ($this->borders['show']) ? 'background: url(\'../lib/images/dot-ddd.gif\') ' . round(($widths['column_wrap_bg_position'] / $this->base['num']), 3) . 'em 0 repeat-y; ' : '';
  127. $column_wrap_css = '
  128. #column_wrap { width: ' . round(($widths['column_wrap'] / $this->base['num']), 1) . 'em; ' . $wrap_border . '}';
  129. $sidebar_css = '#sidebar_1 { width: ' . round((($this->layout['widths']['sidebar_1'] + $widths['sidebar_padding']) / $this->base['num']), 1) . 'em; border: 0; float: left; }
  130. #sidebar_2 { width: ' . round(((($this->layout['widths']['sidebar_2'] + $widths['sidebar_padding'])) / $this->base['num']), 1) . 'em; }';
  131. $special_sidebar_css = '';
  132. }
  133. else {
  134. $widths['sidebars_box'] = $widths['total_sidebars'];
  135. $widths['nested_padding'] = 2 * $widths['comment_padding'];
  136. $column_wrap_css = '';
  137. if (!$this->layout['order'])
  138. $widths['content_box_bg_position'] = $widths['sidebars_box'];
  139. else
  140. $widths['content_box_bg_position'] = $this->layout['widths']['content'] + $widths['post_box_margin_left'] + $widths['post_box_margin_right'];
  141. $sidebar_css = '#sidebar_1 { width: ' . round((($this->layout['widths']['sidebar_1'] + $widths['sidebar_padding']) / $this->base['num']), 1) . 'em; border-style: dotted; border-width: 0 ' . round(($borders['sidebar'] / $this->base['num']), 1) . 'em 0 0; float: left; clear: left; }
  142. #sidebar_2 { width: ' . round(((($this->layout['widths']['sidebar_2'] + $widths['sidebar_padding']) - 1) / $this->base['num']), 1) . 'em; float: left; }';
  143. $special_sidebar_css = ' #sidebar_2 ul.sidebar_list { padding-right: ' . round(((($widths['sidebar_padding'] / 2) - 1) / $this->base['num']), 1) . 'em; }';
  144. }
  145. }
  146. else { // 2-column layout is in use
  147. $widths['sidebars_box'] = $this->layout['widths']['sidebar_1'] + $widths['sidebar_padding'];
  148. $widths['content_box'] = $this->layout['widths']['content'] + $widths['post_box_margin_left'] + $widths['post_box_margin_right'] + $borders['content'] + $widths['sidebars_box'];
  149. $widths['container'] = $widths['content_box'] + ($this->base['page_padding'] * 2);
  150. $widths['nested_padding'] = 2 * $widths['comment_padding'];
  151. if (!$this->layout['order'])
  152. $widths['content_box_bg_position'] = $widths['sidebars_box'];
  153. else
  154. $widths['content_box_bg_position'] = $this->layout['widths']['content'] + $widths['post_box_margin_left'] + $widths['post_box_margin_right'];
  155. $sidebar_css = '.sidebar { width: 100%; }
  156. #sidebar_1 { border: 0; }';
  157. $special_sidebar_css = '';
  158. }
  159. $content_border = ($this->borders['show']) ? 'background: url(\'../lib/images/dot-ddd.gif\') ' . round(($widths['content_box_bg_position'] / $this->base['num']), 1) . 'em 0 repeat-y; ' : '';
  160. $widths['multimedia_image'] = $widths['sidebars_box'] - $widths['mm_box_padding'] - (2 * $widths['mm_image_padding']) - (2 * $borders['mm_image']);
  161. $styles['content_box'] = '
  162. #content_box { width: 100%; ' . $content_border .'}
  163. .no_sidebars { background: none !important; }
  164. ' . $column_wrap_css . '
  165. #content { width: ' . round((($this->layout['widths']['content'] + $widths['post_box_margin_left'] + $widths['post_box_margin_right']) / $this->base['num']), 1) . 'em; ' . $floats['content'] . '}
  166. .no_sidebars #content { width: 100%; }
  167. .post_box, .teasers_box, .full_width #content_box .page { margin: 0 ' . round(($widths['post_box_margin_right'] / $this->base['num']), 1) . 'em 0 ' . round(($widths['post_box_margin_left'] / $this->base['num']), 1) . 'em; }
  168. .full_width #content_box .page { width: auto; }
  169. .no_sidebars .post_box { margin: 0 ' . round(($widths['header_padding'] / $this->base['num']), 1) . 'em; }
  170. .teasers_box { width: ' . round(($this->layout['widths']['content'] / $this->base['num']), 1) . 'em; }
  171. .teaser { width: ' . round(((($this->layout['widths']['content'] - $widths['teaser_margin']) / 2) / $this->base['num']), 1) . 'em; }
  172. #archive_info, .prev_next { padding-right: ' . round(($widths['prev_next_padding_right'] / $this->base['num']), 1) . 'em; padding-left: ' . round(($widths['prev_next_padding_left'] / $this->base['num']), 1) . 'em; }
  173. #sidebars { width: ' . round(($widths['sidebars_box'] / $this->base['num']), 1) . 'em; border: 0; ' . $floats['sidebars'] . '}';
  174. }
  175. elseif ($this->layout['columns'] == 1) {
  176. $widths['post_box_margin_left'] = $widths['post_box_margin_right'] = $widths['comment_padding'] = $widths['prev_next_padding_left'] = $widths['prev_next_padding_right'] = $horizontal_spacing['half'];
  177. $widths['comment_margin_left'] = $widths['comment_margin_right'] = 0;
  178. $widths['content_float'] = 'left';
  179. $special_comment_css = 'margin-right: ' . round(($widths['post_box_margin_right'] / $this->base['num']), 1) . 'em; margin-left: ' . round(($widths['post_box_margin_left'] / $this->base['num']), 1) . 'em;';
  180. $widths['container'] = $this->layout['widths']['content'] + $widths['post_box_margin_left'] + $widths['post_box_margin_right'] + ($this->base['page_padding'] * 2);
  181. $widths['nested_padding'] = 2 * $widths['comment_padding'];
  182. $widths['sidebars_area'] = $this->layout['widths']['content'] + $widths['post_box_margin_left'] + $widths['post_box_margin_right'];
  183. $borders['sidebar_top'] = 3;
  184. $borders['sidebar'] = 1;
  185. $sidebar_top_border = ($this->borders['show']) ? 'border-style: solid; border-width: ' . round(($borders['sidebar_top'] / $this->base['num']), 1) . 'em 0 0 0; ' : '';
  186. $sidebar_border = ($this->borders['show']) ? 'border-style: dotted; border-width: 0 ' . round(($borders['sidebar'] / $this->base['num']), 1) . 'em 0 0; ' : '';
  187. $sidebar_css = '#sidebar_1 { width: ' . round((($widths['sidebars_area'] / 2) - 1) / $this->base['num'], 1) . 'em; ' . $sidebar_border . 'float: left; }
  188. #sidebar_2 { width: ' . round((($widths['sidebars_area'] / 2) - 1) / $this->base['num'], 1) . 'em; float: right; }';
  189. $special_sidebar_css = '';
  190. $widths['multimedia_image'] = $widths['sidebars_area'] - $widths['mm_box_padding'] - (2 * $widths['mm_image_padding']) - (2 * $borders['mm_image']);
  191. $styles['content_box'] .= '
  192. #content_box { width: 100%; }
  193. #content { width: 100%; }
  194. .post_box, .teasers_box { margin: 0 ' . round(($widths['post_box_margin_left'] / $this->base['num']), 1) . 'em; }
  195. .teasers_box { width: ' . round(($this->layout['widths']['content'] / $this->base['num']), 1) . 'em; }
  196. .teaser { width: ' . round(((($this->layout['widths']['content'] - $widths['teaser_margin']) / 2) / $this->base['num']), 1) . 'em; }
  197. #archive_info, .prev_next { padding-right: ' . round(($widths['prev_next_padding_right'] / $this->base['num']), 1) . 'em; padding-left: ' . round(($widths['prev_next_padding_left'] / $this->base['num']), 1) . 'em; }
  198. #sidebars { width: 100%; ' . $sidebar_top_border . 'clear: both; }';
  199. }
  200. // Set up supported image size ratios for the multimedia box image handler
  201. $height_4x3 = $widths['multimedia_image'] * (3 / 4);
  202. $height_3x4 = $widths['multimedia_image'] * (4 / 3);
  203. $height_3x2 = $widths['multimedia_image'] * (2 / 3);
  204. $height_2x3 = $widths['multimedia_image'] * (3 / 2);
  205. $height_5x4 = $widths['multimedia_image'] * (4 / 5);
  206. $height_4x5 = $widths['multimedia_image'] * (5 / 4);
  207. $height_16x9 = $widths['multimedia_image'] * (9 / 16);
  208. $height_9x16 = $widths['multimedia_image'] * (16 / 9);
  209. $height_2x1 = $widths['multimedia_image'] * (1 / 2);
  210. $height_1x2 = $widths['multimedia_image'] * 2;
  211. // "Build" the widths part of the stylesheet
  212. if ($this->layout['framework'] == 'full-width') {
  213. $styles['core'] = '/*---:[ core layout elements ]:---*/
  214. .full_width { width: 100%; clear: both; }
  215. .full_width .page { width: ' . round((($widths['container'] - ($this->base['page_padding'] * 2)) / $this->base['num']), 1) . 'em; margin: 0 auto; padding-right: ' . round(($this->base['page_padding'] / $this->base['num']), 1) . 'em; padding-left: ' . round(($this->base['page_padding'] / $this->base['num']), 1) . 'em; }
  216. #header_area .page { padding-top: ' . round(($this->base['page_padding'] / $this->base['num']), 1) . 'em; }
  217. #footer_area .page { padding-bottom: ' . round(($this->base['page_padding'] / $this->base['num']), 1) . 'em; }';
  218. }
  219. else {
  220. $styles['core'] = '/*---:[ core layout elements ]:---*/
  221. #container { width: ' . round(($widths['container'] / $this->base['num']), 1) . 'em; margin: 0 auto; }
  222. #page { padding: ' . round(($this->base['page_padding'] / $this->base['num']), 1) . 'em; }';
  223. }
  224. $styles['core'] .= '
  225. #header, #footer { padding-right: ' . round(($widths['header_padding'] / $this->base['num']), 1) . 'em; padding-left: ' . round(($widths['header_padding'] / $this->base['num']), 1) . 'em; }';
  226. // Nav constructor
  227. $this->nav['submenu_width'] = ($this->nav['submenu_width'] >= 30 && $this->nav['submenu_width'] <= 600) ? $this->nav['submenu_width'] : 150;
  228. if ($this->nav['border']['width'] > 0) {
  229. $this->nav_border = round(($this->nav['border']['width'] / $this->base['num']), 1) . 'em';
  230. $this->nav_position = '-' . $this->nav_border;
  231. }
  232. else {
  233. $this->nav_border = 0;
  234. $this->nav_position = 0;
  235. }
  236. $styles['nav'] = '
  237. /*---:[ nav styles ]:---*/
  238. .menu ul, .menu ul li { width: ' . round(($this->nav['submenu_width'] / $this->base['num']), 1) . 'em; }
  239. .menu ul ul, .menu :hover ul :hover ul { left: ' . round((($this->nav['submenu_width'] - $this->nav['border']['width']) / $this->base['num']), 3) . 'em; }
  240. .menu li:hover ul, .menu a:hover ul { left: ' . $this->nav_position . '; }
  241. .menu { border-width: 0 0 ' . $this->nav_border . ' ' . $this->nav_border . '; }' . "\n";
  242. $styles['comments'] = '
  243. /*---:[ comments area ]:---*/
  244. #comments { margin-right: ' . round(($widths['comment_margin_right'] / $this->base['num']), 1) . 'em; margin-left: ' . round(($widths['comment_margin_left'] / $this->base['num']), 1) . 'em; }
  245. .comments_intro, #respond_intro { margin-left: ' . round(($widths['comment_padding'] / $this->base['num']), 1) . 'em; }
  246. dl#comment_list dt, #trackback_list { padding-right: ' . round(($widths['comment_padding'] / $this->base['num']), 1) . 'em; padding-left: ' . round(($widths['comment_padding'] / $this->base['num']), 1) . 'em; }
  247. dl#comment_list dd { padding-left: ' . round(($widths['comment_padding'] / $this->base['num']), 1) . 'em; }
  248. dl#comment_list dd .format_text, dl#comment_list dd #respond { padding-right: ' . round(($widths['comment_padding'] / $this->base['num']), 1) . 'em; }
  249. dl#comment_list dl dt { padding-left: ' . round(($widths['nested_padding'] / $this->base['num']), 1) . 'em; border-width: 0 0 0 ' . round(($borders['nested'] / $this->base['num']), 1) . 'em; }
  250. dl#comment_list dl dt.bypostauthor { padding-left: ' . round((($widths['nested_padding'] - 1) / $this->base['num']), 1) . 'em; border-width: 0 0 0 ' . round((($borders['nested'] + 1) / $this->base['num']), 1) . 'em; }
  251. dl#comment_list dl dd { padding-left: 0; }
  252. dl#comment_list dl dd .format_text { padding-left: ' . round(($widths['nested_padding'] / $this->fonts['sizes']['content']), 1) . 'em; border-width: 0 0 0 ' . round(($borders['nested'] / $this->fonts['sizes']['content']), 3) . 'em; }
  253. dl#comment_list dl dd.bypostauthor > .format_text { padding-left: ' . round((($widths['nested_padding'] - 1) / $this->fonts['sizes']['content']), 1) . 'em; border-width: 0 0 0 ' . round((($borders['nested'] + 1) / $this->fonts['sizes']['content']), 3) . 'em; }
  254. dl#comment_list dl dd dl { padding-left: ' . round(($widths['nested_padding'] / $this->base['num']), 1) . 'em; }
  255. #commentform { padding-right: ' . round(($widths['post_box_margin_right'] / $this->base['num']), 1) . 'em; padding-left: ' . round(($widths['comment_padding'] / $this->base['num']), 1) . 'em; }
  256. .comments_closed, .login_alert { ' . $special_comment_css . ' }';
  257. $styles['multimedia_image'] = '
  258. /*---:[ multimedia box elements ]:---*/
  259. #multimedia_box { padding: ' . round((($widths['mm_box_padding'] / 2) / $this->base['num']), 1) . 'em; }
  260. #image_box img { display: block; padding: ' . round(($widths['mm_image_padding'] / $this->base['num']), 1). 'em; border-width: ' . round(($borders['mm_image'] / $this->base['num']), 1) . 'em; }
  261. #image_box img.square { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; }
  262. #image_box img.four_by_three { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($height_4x3 / $this->base['num']), 1) . 'em; }
  263. #image_box img.three_by_four { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($height_3x4 / $this->base['num']), 1) . 'em; }
  264. #image_box img.three_by_two { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($height_3x2 / $this->base['num']), 1) . 'em; }
  265. #image_box img.two_by_three { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($height_2x3 / $this->base['num']), 1) . 'em; }
  266. #image_box img.five_by_four { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($height_5x4 / $this->base['num']), 1) . 'em; }
  267. #image_box img.four_by_five { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($height_4x5 / $this->base['num']), 1) . 'em; }
  268. #image_box img.sixteen_by_nine { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($height_16x9 / $this->base['num']), 1) . 'em; margin: 0 auto; }
  269. #image_box img.nine_by_sixteen { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($height_9x16 / $this->base['num']), 1) . 'em; margin: 0 auto; }
  270. #image_box img.two_by_one { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($height_2x1 / $this->base['num']), 1) . 'em; }
  271. #image_box img.one_by_two { width: ' . round(($widths['multimedia_image'] / $this->base['num']), 1) . 'em; height: ' . round(($height_1x2 / $this->base['num']), 1) . 'em; }';
  272. if ($this->feature_box['position']) { // Generate style for the feature box, if needed
  273. if ($this->feature_box['position'] == 'full-header' || $this->feature_box['position'] == 'full-content')
  274. $widths['feature_box_padding_left'] = $widths['feature_box_padding_right'] = $widths['header_padding'];
  275. elseif ($this->feature_box['position'] == 'content') {
  276. $widths['feature_box_padding_left'] = $widths['post_box_margin_left'];
  277. $widths['feature_box_padding_right'] = $widths['post_box_margin_right'];
  278. }
  279. else
  280. $widths['feature_box_padding_left'] = $widths['feature_box_padding_right'] = '';
  281. $styles['feature_box'] = '
  282. /*---:[ feature box styles ]:---*/
  283. #feature_box { padding-right: ' . round(($widths['feature_box_padding_right'] / $this->base['num']), 1) . 'em; padding-left: ' . round(($widths['feature_box_padding_right'] / $this->base['num']), 1) . 'em; }';
  284. }
  285. else
  286. $styles['feature_box'] = '';
  287. // Generate sidebar styling.
  288. $styles['sidebar'] = '
  289. ' . $sidebar_css . '
  290. .sidebar ul.sidebar_list { padding-right: ' . round((($widths['sidebar_padding'] / 2) / $this->base['num']), 1) . 'em; padding-left: ' . round((($widths['sidebar_padding'] / 2) / $this->base['num']), 1) . 'em; }
  291. ' . $special_sidebar_css;
  292. $this->css .= $styles['core'] . $styles['content_box'] . $styles['sidebar'] . $styles['nav'] . $styles['multimedia_image'] . $styles['feature_box'] . $styles['comments'];
  293. }
  294. function content() {
  295. // Calculate content element sizes
  296. $element_sizes['h2'] = $element_sizes['h3'] = $element_sizes['archive'] = $element_sizes['pullquotes'] = $this->fonts['sizes']['content'] + 4;
  297. $element_sizes['h4'] = $this->fonts['sizes']['content'];
  298. $element_sizes['prev_next'] = $element_sizes['archive_info'] = 10;
  299. $element_sizes['comment_author'] = $element_sizes['submit'] = $this->fonts['sizes']['content'] + 2;
  300. $element_sizes['respond'] = $this->fonts['sizes']['content'] + 3;
  301. $element_sizes['cancel'] = 11;
  302. if ($this->fonts['sizes']['content'] < 13) {
  303. $element_sizes['h5'] = $element_sizes['h6'] = $element_sizes['abbr'] = $element_sizes['acronym'] = $element_sizes['caption'] = 10;
  304. $element_sizes['tags'] = $element_sizes['to_comments'] = $this->fonts['sizes']['content'] - 1;
  305. $element_sizes['comment_byline'] = $element_sizes['comment_num'] = $element_sizes['trackback_timestamp'] = $element_sizes['allowed'] = 11;
  306. $element_sizes['code'] = $this->fonts['sizes']['content'];
  307. }
  308. else {
  309. $element_sizes['h5'] = $element_sizes['h6'] = $element_sizes['abbr'] = $element_sizes['acronym'] = $this->fonts['sizes']['content'] - 3;
  310. $element_sizes['tags'] = $element_sizes['to_comments'] = $element_sizes['comment_byline'] = $element_sizes['comment_num'] = $element_sizes['trackback_timestamp'] = $element_sizes['allowed'] = $element_sizes['caption'] = $this->fonts['sizes']['content'] - 2;
  311. $element_sizes['code'] = $this->fonts['sizes']['content'] - 1;
  312. }
  313. $nav_menu_padding = array('x' => $this->fonts['sizes']['nav_menu'] - 2, 'y' => $this->fonts['sizes']['nav_menu'] - 4);
  314. $nav_css = ($this->nav_border) ? '.menu table { bottom: -' . $this->nav_border . '; }' . "\n" . '.nav, .menu li ul { border-width: 0 0 ' . $this->nav_border . ' 0; }' . "\n" . '.menu li { margin-bottom: -' . $this->nav_border . '; }' . "\n\t" . '.menu li ul { margin-top: -' . $this->nav_border . '; }' . "\n\t" . '.menu ul ul { margin-top: 0; }' . "\n" : '.menu, .menu a, .menu li ul { border: none; }' . "\n" . '.menu table { bottom: 0; }' . "\n";
  315. $nav_tab_width = $this->nav['submenu_width'] - 2 * ($this->nav['border']['width'] + $nav_menu_padding['x']);
  316. // Calculate sidebar element sizes
  317. $sidebar_sizes['submit'] = $this->fonts['sizes']['sidebars'];
  318. $sidebar_sizes['calendar_line_height'] = 22;
  319. if ($this->fonts['sizes']['sidebars'] < 13) {
  320. $sidebar_sizes['abbr'] = $sidebar_sizes['acronym'] = 11;
  321. $sidebar_sizes['calendar_head'] = 11;
  322. $sidebar_sizes['code'] = $this->fonts['sizes']['sidebars'];
  323. }
  324. else {
  325. $sidebar_sizes['abbr'] = $sidebar_sizes['acronym'] = $this->fonts['sizes']['sidebars'] - 2;
  326. $sidebar_sizes['code'] = $this->fonts['sizes']['sidebars'] - 1;
  327. $sidebar_sizes['calendar_head'] = ($this->fonts['sizes']['sidebars'] == 13) ? 11 : 12;
  328. }
  329. // Retrieve user-selected fonts and set them up for use in CSS
  330. $font_stacks = thesis_get_fonts();
  331. foreach ($this->fonts['families'] as $area => $active_font) {
  332. if ($area == 'code' && !$active_font)
  333. $font_families[$area] = 'font-family: ' . $font_stacks[$this->fonts['families']['body']]['family'] . '; ';
  334. elseif ($area == 'tagline' && !$active_font)
  335. $font_families[$area] = ($this->fonts['families']['header']) ? 'font-family: ' . $font_stacks[$this->fonts['families']['header']]['family'] . '; ' : '';
  336. elseif ($area == 'subheads') {
  337. if ($active_font) $font_families[$area] = '.format_text h2, .format_text h3, .format_text h4, .format_text h5, .format_text h6 { font-family: ' . $font_stacks[$active_font]['family'] . '; }' . "\n";
  338. elseif ($this->fonts['families']['headlines']) $font_families[$area] = '.format_text h2, .format_text h3, .format_text h4, .format_text h5, .format_text h6 { font-family: ' . $font_stacks[$this->fonts['families']['headlines']]['family'] . '; }' . "\n";
  339. else $font_families[$area] = '';
  340. }
  341. elseif ($area == 'multimedia_box')
  342. $font_families['multimedia_box'] = ($active_font) ? '#multimedia_box { font-family: ' . $font_stacks[$this->fonts['families']['multimedia_box']]['family'] . "; }" : '';
  343. elseif ($active_font)
  344. $font_families[$area] = 'font-family: ' . $font_stacks[$active_font]['family'] . '; ';
  345. }
  346. // Set up relative sizes (for use in CSS calculations) based on the user-specified content font size
  347. for ($i = 1; $i <= 56; $i++)
  348. $relative[$i] = round(($i / $this->fonts['sizes']['content']), 3);
  349. $spacing['line_height'] = round(($this->line_heights['content'] / $this->base['num']), 1);
  350. $spacing['half'] = round((($this->line_heights['content'] / 2) / $this->base['num']), 1);
  351. $spacing['double'] = round((($this->line_heights['content'] * 2) / $this->base['num']), 1);
  352. $spacing['relative'] = $relative[$this->line_heights['content']];
  353. $spacing['relative_half'] = $relative[($this->line_heights['content'] / 2)];
  354. $spacing['pullquotes'] = round(($this->line_heights['content'] / $element_sizes['pullquotes']), 3);
  355. $spacing['to_comments'] = round(($this->line_heights['content'] / $element_sizes['to_comments']), 3);
  356. $spacing['tags'] = round(($this->line_heights['content'] / $element_sizes['tags']), 3);
  357. // Set up relative font sizes for sidebar styles
  358. for ($i = 1; $i <= 56; $i++)
  359. $sidebar[$i] = round(($i / $this->fonts['sizes']['sidebars']), 3);
  360. $sidebar_input_font = ($font_families['sidebars']) ? $font_families['sidebars'] : $font_families['body'];
  361. // Build CSS output.
  362. $this->css .= '
  363. /*---:[ content elements ]:---*/
  364. body { ' . $font_families['body'] . '}
  365. #header { padding-top: ' . $spacing['line_height'] . 'em; padding-bottom: ' . $spacing['line_height'] . 'em; }
  366. .post_box { padding-top: ' . $spacing['line_height'] . 'em; }
  367. .headline_area { margin-bottom: ' . $spacing['line_height'] . 'em; }
  368. .teasers_box { padding-top: ' . $spacing['line_height'] . 'em; padding-bottom: ' . $spacing['line_height'] . 'em; }
  369. #multimedia_box { margin-bottom: ' . $spacing['line_height'] . 'em; }
  370. #footer { ' . $font_families['footer'] . 'padding-top: ' . $spacing['half'] . 'em; padding-bottom: ' . $spacing['half'] . 'em; }
  371. /*---:[ #header styles ]:---*/
  372. #header #logo { font-size: ' . round(($this->fonts['sizes']['header'] / $this->base['num']), 1) . 'em; line-height: ' . round(($this->line_heights['header'] / $this->fonts['sizes']['header']), 3) . 'em; ' . $font_families['header'] . '}
  373. #header #tagline { font-size: ' . round(($this->fonts['sizes']['tagline'] / $this->base['num']), 1) . 'em; line-height: ' . round((($this->fonts['sizes']['tagline'] + 6) / $this->fonts['sizes']['tagline']), 3) . 'em; ' . $font_families['tagline'] . '}
  374. /*---:[ nav menu styles ]:---*/
  375. ' . $nav_css . '
  376. .menu a { font-size: ' . round(($this->fonts['sizes']['nav_menu'] / $this->base['num']), 1) . 'em; ' . $font_families['nav_menu'] . 'line-height: ' . round(($this->line_heights['nav_menu'] / $this->fonts['sizes']['nav_menu']), 3) . 'em; padding: ' . round(($nav_menu_padding['y'] / $this->fonts['sizes']['nav_menu']), 3) . 'em ' . round(($nav_menu_padding['x'] / $this->fonts['sizes']['nav_menu']), 3) . 'em; border-width: ' . round(($this->nav['border']['width'] / $this->fonts['sizes']['nav_menu']), 3) . 'em; border-left-width: 0; }
  377. .menu ul a { width: ' . round(($nav_tab_width / $this->fonts['sizes']['nav_menu']), 3) . 'em; border-left-width: ' . round(($this->nav['border']['width'] / $this->fonts['sizes']['nav_menu']), 3) . 'em; }
  378. /*---:[ headlines ]:---*/
  379. .headline_area h1, .headline_area h2 { font-size: ' . round(($this->fonts['sizes']['headlines'] / $this->base['num']), 1) . 'em; line-height: ' . round(($this->line_heights['headlines'] / $this->fonts['sizes']['headlines']), 3) . 'em; ' . $font_families['headlines'] . '}
  380. ' . $font_families['subheads'] . '.format_text h2, .format_text h3 { font-size: ' . round(($element_sizes['h2'] / $this->fonts['sizes']['content']), 3) . 'em; line-height: ' . round(($this->line_heights['content'] / $element_sizes['h2']), 3) . 'em; margin: ' . round((($this->line_heights['content'] * 1.5) / $element_sizes['h2']), 3) . 'em 0 ' . round((($this->line_heights['content'] / 2) / $element_sizes['h2']), 3) . 'em 0; }
  381. .format_text h4 { font-size: ' . round(($element_sizes['h4'] / $this->fonts['sizes']['content']), 3) . 'em; }
  382. .format_text h5 { font-size: ' . round(($element_sizes['h5'] / $this->fonts['sizes']['content']), 3) . 'em; }
  383. .format_text h6 { font-size: ' . round(($element_sizes['h6'] / $this->fonts['sizes']['content']), 3) . 'em; }
  384. .teaser h2 { ' . $font_families['headlines'] . '}
  385. .sidebar h3 { font-size: ' . $sidebar[$this->fonts['sizes']['sidebar_headings']] . 'em; line-height: ' . round(($this->line_heights['sidebars'] / $this->fonts['sizes']['sidebar_headings']), 3) . 'em; ' . $font_families['sidebar_headings'] . 'margin-bottom: ' . round((($this->line_heights['sidebars'] / 2) / $this->fonts['sizes']['sidebar_headings']), 3) . 'em; }
  386. #archive_info h1 { font-size: ' . round(($element_sizes['archive'] / $this->base['num']), 1) . 'em; line-height: 1em; }
  387. /*---:[ bylines ]:---*/
  388. .headline_meta { font-size: ' . round(($this->fonts['sizes']['bylines'] / $this->base['num']), 1) . 'em; line-height: ' . round(($this->line_heights['bylines'] / $this->fonts['sizes']['bylines']), 3) . 'em; ' . $font_families['bylines'] . '}
  389. .headline_meta .pad_left { padding-left: ' . round((($this->line_heights['bylines'] / 2) / $this->fonts['sizes']['bylines']), 3) . 'em; }
  390. /*---:[ headline area (image thumbnails) ]:---*/
  391. .headline_area img.alignleft { margin: 0 ' . $spacing['line_height'] . 'em ' . $spacing['line_height'] . 'em 0; }
  392. .headline_area img.alignright { margin: 0 0 ' . $spacing['line_height'] . 'em ' . $spacing['line_height'] . 'em; }
  393. .headline_area img.alignnone { margin: 0 auto ' . $spacing['line_height'] . 'em 0; }
  394. .headline_area img.aligncenter { margin: 0 auto ' . $spacing['line_height'] . 'em auto; }
  395. .headline_area img.frame { padding: ' . round(((($this->line_heights['content'] / 2) - 1) / $this->base['num']), 1) . 'em; border-width: ' . round((1 / $this->base['num']), 1) . 'em; }
  396. /*---:[ post content area ]:---*/
  397. .format_text { font-size: ' . round(($this->fonts['sizes']['content'] / $this->base['num']), 1) . 'em; line-height: ' . $spacing['relative'] . 'em; }
  398. .format_text p { margin-bottom: ' . $spacing['relative'] . 'em; }
  399. .format_text p.note, .format_text p.alert { padding: ' . $relative[(($this->line_heights['content'] / 2) - 3)] . 'em ' . $spacing['relative_half'] . 'em; }
  400. .format_text .drop_cap { font-size: ' . $relative[(($this->line_heights['content'] * 2) + 6)] . 'em; line-height: ' . round((($this->line_heights['content'] - 3) / ($this->line_heights['content'] + 3)), 3) . 'em; padding: ' . round((1 / ($this->line_heights['content'] + 3)), 3) . 'em ' . round((3 / ($this->line_heights['content'] + 3)), 3) . 'em 0 0; }
  401. .ie6 .format_text .drop_cap { padding-right: ' . round((1.5 / ($this->line_heights['content'] + 3)), 3) . 'em; }
  402. .format_text acronym, .format_text abbr { font-size: ' . $relative[$element_sizes['abbr']] . 'em; }
  403. .format_text code, .format_text pre { ' . $font_families['code'] . '}
  404. .format_text code { font-size: ' . $relative[$element_sizes['code']] . 'em; }
  405. .format_text pre { font-size: ' . $relative[$this->fonts['sizes']['code']] . 'em; line-height: ' . round(($this->line_heights['code'] / $this->fonts['sizes']['code']), 3) . 'em; margin-bottom: ' . round(($this->line_heights['content'] / $this->fonts['sizes']['code']), 3) . 'em; padding: ' . round(((($this->line_heights['content'] / 2) - 3) / $this->fonts['sizes']['code']), 3) . 'em ' . round((($this->line_heights['content'] / 2) / $this->fonts['sizes']['code']), 3) . 'em; }
  406. .format_text sub, .format_text sup { line-height: ' . $relative[($this->line_heights['content'] / 2)] . 'em }
  407. .format_text ul { margin: 0 0 ' . $spacing['relative'] . 'em ' . $spacing['relative'] . 'em; }
  408. .format_text ol { margin: 0 0 ' . $spacing['relative'] . 'em ' . $spacing['relative'] . 'em; }
  409. .format_text ul ul, .format_text ul ol, .format_text ol ul, .format_text ol ol { margin: 0 0 0 ' . $spacing['relative'] . 'em; }
  410. .format_text dl { margin-bottom: ' . $spacing['relative'] . 'em; }
  411. .format_text dd { margin-bottom: ' . $spacing['relative'] . 'em; }
  412. .format_text blockquote { margin: 0 0 ' . $spacing['relative'] . 'em ' . $spacing['relative_half'] . 'em; padding-left: ' . $spacing['relative_half'] . 'em; }
  413. /*---:[ pullquotes ]:---*/
  414. .format_text blockquote.right, .format_text blockquote.left { width: 45%; font-size: ' . $relative[$element_sizes['pullquotes']] . 'em; line-height: ' . $spacing['pullquotes'] . 'em; }
  415. .format_text blockquote.right { margin: 0 0 ' . $spacing['pullquotes'] . 'em ' . $spacing['pullquotes'] . 'em; }
  416. .format_text blockquote.left { margin: 0 ' . $spacing['pullquotes'] . 'em ' . $spacing['pullquotes'] . 'em 0; }
  417. /*---:[ image handling classes ]:---*/
  418. .format_text img.left, .format_text img.alignleft, .wp-caption.alignleft { margin: 0 ' . $spacing['relative'] . 'em ' . $spacing['relative'] . 'em 0; }
  419. .format_text img.right, .format_text img.alignright, .wp-caption.alignright { margin: 0 0 ' . $spacing['relative'] . 'em ' . $spacing['relative'] . 'em; }
  420. .format_text img.center, .format_text img.aligncenter, .wp-caption.aligncenter { margin: 0 auto ' . $spacing['relative'] . 'em auto; }
  421. .format_text img.block, .format_text img.alignnone, .wp-caption.alignnone { margin: 0 auto ' . $spacing['relative'] . 'em 0; }
  422. .format_text img[align="left"] { margin-right: ' . $spacing['relative'] . 'em; margin-bottom: ' . $spacing['relative'] . 'em; }
  423. .format_text img[align="right"] { margin-bottom: ' . $spacing['relative'] . 'em; margin-left: ' . $spacing['relative'] . 'em; }
  424. .format_text img[align="middle"] { margin-bottom: ' . $spacing['relative'] . 'em; }
  425. .format_text img.frame, .format_text .wp-caption { padding: ' . $relative[(($this->line_heights['content'] / 2) - 1)] . 'em; border-width: ' . $relative[1] . 'em; }
  426. .format_text img.stack { margin-left: ' . $spacing['relative'] . 'em; }
  427. .format_text .wp-caption p { font-size: ' . $relative[$element_sizes['caption']] . 'em; line-height: ' . round((($this->line_heights['content'] - 4) / $element_sizes['caption']), 3) . 'em; margin-bottom: 0; }
  428. /*---:[ ad and miscellaneous "block" classes ]:---*/
  429. .format_text .ad { margin-left: ' . $spacing['relative'] . 'em; }
  430. .format_text .ad_left { margin-right: ' . $spacing['relative'] . 'em; }
  431. /*---:[ after-post elements ]:---*/
  432. .format_text .to_comments { font-size: ' . $relative[$element_sizes['to_comments']] . 'em; line-height: ' . $spacing['to_comments'] . 'em; margin-bottom: ' . $spacing['to_comments'] . 'em; }
  433. .format_text .to_comments span { font-size: ' . $spacing['to_comments'] . 'em; }
  434. .format_text .post_tags { font-size: ' . $relative[$element_sizes['tags']] . 'em; line-height: ' . $spacing['tags'] . 'em; margin-bottom: ' . $spacing['tags'] . 'em; }
  435. /*---:[ multimedia box ]:---*/
  436. ' . $font_families['multimedia_box'] . '
  437. #custom_box { font-size: ' . round(($this->fonts['sizes']['multimedia_box'] / $this->base['num']), 3) . 'em; line-height: ' . round(($this->line_heights['multimedia_box'] / $this->fonts['sizes']['multimedia_box']), 3) . 'em; }
  438. /*---:[ archive information block ]:---*/
  439. #archive_info { padding-top: ' . $spacing['half'] . 'em; padding-bottom: ' . $spacing['half'] . 'em; }
  440. #archive_info p { font-size: ' . round(($element_sizes['archive_info'] / $this->base['num']), 1) . 'em; line-height: 1em; margin-bottom: ' . $spacing['half'] . 'em; }
  441. /*---:[ previous and next links ]:---*/
  442. .prev_next { padding-top: ' . $spacing['half'] . 'em; padding-bottom: ' . $spacing['half'] . 'em; }
  443. .prev_next p { font-size: ' . round(($element_sizes['prev_next'] / $this->base['num']), 1) . 'em; line-height: ' . round(($this->line_heights['content'] / $element_sizes['prev_next']), 3) . 'em; }
  444. .post_nav .previous { margin-bottom: ' . round((($this->line_heights['content'] / $element_sizes['prev_next']) / 4), 3) . 'em; }
  445. .post_nav a { font-size: ' . round(($this->fonts['sizes']['content'] / $element_sizes['prev_next']), 3) . 'em; line-height: ' . $spacing['relative'] . 'em; }
  446. /*---:[ comment area ]:---*/
  447. #comments { margin-top: ' . $spacing['double'] . 'em; }
  448. .comments_intro { margin-bottom: ' . $spacing['half'] . 'em; }
  449. .comments_intro p { font-size: ' . round(($element_sizes['to_comments'] / $this->base['num']), 1) . 'em; line-height: ' . $spacing['to_comments'] . 'em; }
  450. .comments_intro span { font-size: ' . $spacing['to_comments'] . 'em; }
  451. #comment_list, #trackback_list { margin-bottom: ' . $spacing['double'] . 'em; }
  452. dl#comment_list dt { padding-top: ' . round((($this->line_heights['content'] - 4) / $this->base['num']), 1) . 'em; }
  453. dl#comment_list dt span { font-size: ' . round(($element_sizes['comment_byline'] / $this->base['num']), 1) . 'em; line-height: ' . round(($this->line_heights['content'] / $element_sizes['comment_byline']), 3) . 'em; }
  454. dl#comment_list dt .comment_author { font-size: ' . round(($element_sizes['comment_author'] / $this->base['num']), 3) . 'em; line-height: ' . round(($this->line_heights['content'] / $element_sizes['comment_author']), 3) . 'em; padding-right: ' . round((($this->line_heights['content'] / 2) / $element_sizes['comment_author']), 3) . 'em; }
  455. .avatar img { margin-left: ' . round(($this->base['num'] / $element_sizes['comment_byline']), 3) . 'em; }
  456. .comment_time { padding-right: ' . round((($this->line_heights['content'] / 2) / $element_sizes['comment_byline']), 3) . 'em; }
  457. .comment_num { padding-left: ' . round(($this->base['num'] / $element_sizes['comment_byline']), 3) . 'em; }
  458. .comment_num a { font-size: ' . round(($element_sizes['comment_num'] / $element_sizes['comment_byline']), 3) . 'em; line-height: ' . round(($this->line_heights['content'] / $element_sizes['comment_num']), 3) . 'em; padding: ' . round((1 / $element_sizes['comment_num']), 3) . 'em ' . round((3 / $element_sizes['comment_num']), 3) . 'em; }
  459. dl#comment_list dd { padding-top: ' . $spacing['half'] . 'em; }
  460. dl#comment_list dd p.reply a { font-size: ' . round(($element_sizes['abbr'] / $this->fonts['sizes']['content']), 3) . 'em; line-height: ' . round(($this->line_heights['code'] / $element_sizes['abbr']), 3) . 'em; }
  461. dl#comment_list dl dd p.reply { margin-bottom: 0; }
  462. dl#comment_list dl dt, dl#comment_list dl dd { padding-top: 0; }
  463. dl#comment_list dl dd .format_text { margin-bottom: ' . $relative[$this->line_heights['content']] . 'em; }
  464. #trackback_list { padding-top: ' . $spacing['half'] . 'em; list-style: none; }
  465. #trackback_list a { font-size: ' . round(($this->fonts['sizes']['content'] / $this->base['num']), 1) . 'em; line-height: ' . $spacing['relative'] . 'em; }
  466. #trackback_list span { font-size: ' . round(($element_sizes['trackback_timestamp'] / $this->base['num']), 1) . 'em; line-height: ' . round(($this->line_heights['content'] / $element_sizes['trackback_timestamp']), 3) . 'em; }
  467. .comments_closed { margin-top: ' . $spacing['double'] . 'em; margin-bottom: ' . $spacing['line_height'] . 'em; }
  468. /*---:[ comment form styles ]:---*/
  469. #respond { margin-bottom: ' . $spacing['double'] . 'em; }
  470. #respond_intro { margin-bottom: ' . $spacing['half'] . 'em; }
  471. #respond_intro p { font-size: ' . round(($element_sizes['respond'] / $this->base['num']), 1) . 'em; line-height: ' . round(($this->line_heights['content'] / $element_sizes['respond']), 3) . 'em; }
  472. #cancel-comment-reply-link { font-size: ' . round(($element_sizes['cancel'] / $this->base['num']), 1) . 'em; line-height: 1em; padding: ' . round(6 / $element_sizes['cancel'], 3) . 'em ' . round(8 / $element_sizes['cancel'], 3) . 'em; border-width: ' . round(2 / $element_sizes['cancel'], 3) . 'em; }
  473. .login_alert { margin-top: ' . $spacing['double'] . 'em; margin-bottom: ' . $spacing['line_height'] . 'em; padding: ' . $spacing['half'] . 'em; }
  474. #commentform { padding-top: ' . $spacing['half'] . 'em; }
  475. #commentform p, .login_alert p { font-size: ' . round(($this->fonts['sizes']['content'] / $this->base['num']), 1) . 'em; line-height: ' . $relative[$this->line_heights['content']] . 'em; }
  476. #commentform p.comment_box { line-height: ' . $spacing['relative_half'] . 'em; }
  477. #commentform label { padding-left: ' . $spacing['relative_half'] . 'em; }
  478. #commentform textarea { height: ' . round((($this->line_heights['content'] * 8) / $this->fonts['sizes']['content']), 3) . 'em; line-height: ' . $spacing['relative'] . 'em; }
  479. #commentform span.allowed { width: 97.3%; padding-top: ' . $relative[(($this->line_heights['code'] - 4) / 2)] . 'em; padding-bottom: ' . $relative[(($this->line_heights['code'] - 4) / 2)] . 'em; border-width: 0 ' . $relative[$this->form_input['border']['right']] . 'em ' . $relative[$this->form_input['border']['bottom']] . 'em ' . $relative[$this->form_input['border']['left']] . 'em; }
  480. #commentform span.allowed span { font-size: ' . $relative[$element_sizes['allowed']] . 'em; line-height: ' . round(($this->line_heights['content'] / $element_sizes['allowed']), 3) . 'em; padding: 0 ' . round(((($this->line_heights['code'] - 4) / 2) / $element_sizes['allowed']), 3) . 'em; }
  481. /* Support for the highly-recommended Subscribe to Comments Plugin */
  482. #commentform p.subscribe-to-comments { font-size: ' . round(($this->fonts['sizes']['content'] / $this->base['num']), 1) . 'em; }
  483. #commentform p.subscribe-to-comments label { font-size: 1em; }
  484. /*---:[ sidebar styles ]:---*/
  485. .sidebar { ' . $font_families['sidebars'] . '}
  486. #column_wrap .sidebar ul.sidebar_list { padding-top: ' . $spacing['line_height'] . 'em; }
  487. li.widget { font-size: ' . round(($this->fonts['sizes']['sidebars'] / $this->base['num']), 1) . 'em; line-height: ' . $sidebar[$this->line_heights['sidebars']] . 'em; margin-bottom: ' . $sidebar[($this->line_heights['sidebars'] * 2)] . 'em; }
  488. li.tag_cloud { line-height: ' . $sidebar[($this->line_heights['sidebars'] + 4)] . 'em; }
  489. li.widget p { margin-bottom: ' . $sidebar[$this->line_heights['sidebars']] . 'em; }
  490. li.widget abbr, li.widget acronym { font-size: ' . $sidebar[$sidebar_sizes['abbr']] . 'em; }
  491. li.widget code { font-size: ' . $sidebar[$sidebar_sizes['code']] . 'em; }
  492. li.widget ul li { margin-bottom: ' . $sidebar[($this->fonts['sizes']['sidebars'] - 4)] . 'em; }
  493. li.widget li ul { margin: ' . $sidebar[($this->fonts['sizes']['sidebars'] - 4)] . 'em 0 0 ' . $sidebar[$this->line_heights['sidebars']] . 'em; }
  494. /*---:[ widget box styles ]:---*/
  495. li.widget .widget_box { padding: ' . $sidebar[($this->line_heights['sidebars'] / 2)] . 'em; border-width: ' . $sidebar[1] . 'em; }
  496. /*---:[ google custom search ]:---*/
  497. li.thesis_widget_google_cse form input[type="submit"] { font-size: ' . $sidebar[$sidebar_sizes['submit']] . 'em; ' . $font_families['sidebar'] . 'margin-top: ' . round((6 / $sidebar_sizes['submit']), 3) . 'em; padding: ' . round((2 / $sidebar_sizes['submit']), 3) . 'em ' . round((3 / $sidebar_sizes['submit']), 3) . 'em; }
  498. /*---:[ calendar widget ]:---*/
  499. #calendar_wrap a { padding: ' . $sidebar[1] . 'em; }
  500. #calendar_wrap a:hover { padding: ' . $sidebar[1] . 'em; }
  501. table#wp-calendar caption { font-size: ' . $sidebar[$sidebar_sizes['calendar_head']] . 'em; line-height: ' . round(($sidebar_sizes['calendar_line_height'] / $sidebar_sizes['calendar_head']), 3) . 'em; }
  502. table#wp-calendar th { font-size: ' . $sidebar[$sidebar_sizes['calendar_head']] . 'em; line-height: ' . round(($sidebar_sizes['calendar_line_height'] / $sidebar_sizes['calendar_head']), 3) . 'em; padding-top: ' . round((1 / $sidebar_sizes['calendar_head']), 3) . 'em; }
  503. table#wp-calendar td { line-height: ' . round(($sidebar_sizes['calendar_line_height'] / $this->fonts['sizes']['sidebars']), 3) . 'em; }
  504. table#wp-calendar td#next, table#wp-calendar td#prev { font-size: ' . $sidebar[$sidebar_sizes['calendar_head']] . 'em; line-height: ' . round(($sidebar_sizes['calendar_line_height'] / $sidebar_sizes['calendar_head']), 3) . 'em; }
  505. table#wp-calendar td#next { padding-right: ' . round((6 / $sidebar_sizes['calendar_head']), 3) . 'em; }
  506. table#wp-calendar td#prev { padding-left: ' . round((6 / $sidebar_sizes['calendar_head']), 3) . 'em; }
  507. /*---:[ form inputs ]:---*/
  508. input, textarea { ' . $font_families['body'] . '}
  509. .format_text input, #commentform input, #commentform textarea { width: 45%; padding: ' . $relative[$this->form_input['padding']] . 'em; border-width: ' . $relative[$this->form_input['border']['top']] . 'em ' . $relative[$this->form_input['border']['right']] . 'em ' . $relative[$this->form_input['border']['bottom']] . 'em ' . $relative[$this->form_input['border']['left']] . 'em; }
  510. #commentform textarea { width: 96%; }
  511. .format_text input.form_submit, #commentform .form_submit { font-size: ' . $relative[$element_sizes['submit']] . 'em; padding: ' . round((5 / $element_sizes['submit']), 3) . 'em ' . round((4 / $element_sizes['submit']), 3) . 'em; }
  512. .sidebar .text_input, .sidebar .form_submit { padding: ' . $sidebar[4] . 'em; ' . $sidebar_input_font . '}
  513. .sidebar input[type="text"], .sidebar input[type="submit"] { padding: ' . $sidebar[4] . 'em; ' . $sidebar_input_font . '}
  514. /*---:[ footer styles ]:---*/
  515. #footer p { font-size: ' . round(($this->fonts['sizes']['footer'] / $this->base['num']), 1) . 'em; line-height: ' . round(($this->line_heights['footer'] / $this->fonts['sizes']['footer']), 3) . 'em; }';
  516. $this->css .= (!$this->multimedia_box['status']) ? "\n" . 'ul.sidebar_list { padding-top: ' . $spacing['line_height'] . 'em; }' : '';
  517. }
  518. function teasers() {
  519. $teaser_line_heights['excerpt'] = $this->teasers['font_sizes']['excerpt'] + 6;
  520. $teaser_line_heights['headline'] = $this->teasers['font_sizes']['headline'] + 6;
  521. if ($teaser_line_heights['excerpt'] % 2 == 1)
  522. $teaser_line_heights['excerpt'] = $teaser_line_heights['excerpt'] + 1;
  523. if ($teaser_line_heights['headline'] <= $teaser_line_heights['excerpt'])
  524. $teaser_line_heights['headline'] = $teaser_line_heights['excerpt'];
  525. $spacing['line_height'] = round(($teaser_line_heights['excerpt'] / $this->base['num']), 1);
  526. $font_stacks = thesis_get_fonts();
  527. $teaser_byline_font = ($this->fonts['families']['bylines']) ? 'font-family: ' . $font_stacks[$this->fonts['families']['bylines']]['family'] . '; ' : 'font-family: ' . $font_stacks[$this->fonts['families']['body']]['family'] . '; ';
  528. $this->css .= '
  529. /*---:[ teaser styles ]:---*/
  530. .teaser h2 { font-size: ' . round(($this->teasers['font_sizes']['headline'] / $this->base['num']), 1) . 'em; line-height: ' . round(($teaser_line_heights['headline'] / $this->teasers['font_sizes']['headline']), 3) . 'em; }
  531. .teaser .format_teaser { font-size: ' . round(($this->teasers['font_sizes']['excerpt'] / $this->base['num']), 1) . 'em; line-height: ' . round(($teaser_line_heights['excerpt'] / $this->teasers['font_sizes']['excerpt']), 3) . 'em; margin-top: ' . round(($teaser_line_heights['excerpt'] / $this->teasers['font_sizes']['excerpt']), 3) . 'em; margin-bottom: ' . round(($teaser_line_heights['excerpt'] / $this->teasers['font_sizes']['excerpt']), 3) . 'em; }
  532. .teaser .teaser_author, .teaser .teaser_category, .teaser .teaser_date, .teaser .teaser_comments, .teaser .edit_post { ' . $teaser_byline_font . '}
  533. .teaser .teaser_author { font-size: ' . round(($this->teasers['font_sizes']['author'] / $this->base['num']), 1) . 'em; line-height: ' . round((($teaser_line_heights['excerpt'] - 2) / $this->teasers['font_sizes']['author']), 3) . 'em; }
  534. .teaser .teaser_category { font-size: ' . round(($this->teasers['font_sizes']['category'] / $this->base['num']), 1) . 'em; line-height: ' . round((($teaser_line_heights['excerpt'] - 2) / $this->teasers['font_sizes']['category']), 3) . 'em; }
  535. .teaser .teaser_date { font-size: ' . round(($this->teasers['font_sizes']['date'] / $this->base['num']), 1) . 'em; line-height: ' . round((($teaser_line_heights['excerpt'] - 2) / $this->teasers['font_sizes']['date']), 3) . 'em; }
  536. .teaser .teaser_comments { font-size: ' . round(($this->teasers['font_sizes']['comments'] / $this->base['num']), 1) . 'em; line-height: ' . round((($teaser_line_heights['excerpt'] - 2) / $this->teasers['font_sizes']['comments']), 3) . 'em; }
  537. .teaser .teaser_link { font-size: ' . round(($…

Large files files are truncated, but you can click here to view the full file