1 @require 'inc/wfpl/stylus_helpers.styl'
2 @require '.sha1sums.styl'
5 golden_ratio_small = 0.38196601125010515180 // ratio of whole to smaller part
12 image_float_size = golden_ratio_small
13 narrow_column_ifs = image_float_size * 1.5
14 image_float_min_size = 0.5
15 image_float_margin = 2%
16 mobile_menu_width = 600px // switch to mobile menu when screen gets this narrow
17 single_column_max = 600px // switch to single column when screen gets this narrow
18 runaround_max = 370px // center left/right images when _column_ gets this narrow
19 //// Column Dimensions
20 centerer_width = 950px // inside. outside is columns.width
23 columns = wfpl_columns({
40 width: centerer_width - sidebar_width - sidebar_gap
46 margin-left: sidebar_gap
52 margin-left: sidebar_gap
57 width: sidebar_width - 2px - 30px
65 biggest_content_width = columns['widths']['.centerer.full > .main']
67 hide_in_one_column_mode = {
68 ".centerer.with_sidebar > .sidebar.plain": 1
69 ".centerer.with_sidebar > .sidebar.bordered": 1
73 font_size_large = 18px
74 font_size_normal = 15px
75 font_size_small = 13px
89 // always show vertical scrollbar, so content doesn't shift around when
90 // switching from tall to short pages
94 header, hgroup, section, footer, aside, nav, article, figure, img
100 border: 1px solid black
116 border: 1px dotted black
117 padding: 0 15px 15px 15px
126 border: 2px solid red
174 margin: 15px 15px 0 15px
176 p.quote:before, p.quote:after
181 display: inline-block
192 width: 0; // make sure it doesn't wrap
194 p.attrib, p.attribution
195 margin: 0 0 15px 20px
206 background: window_bg
208 font: font_size_normal Arimo, Arial, sans-serif
210 // call this for each ckeditor on each page
211 ckeditor_elements_already = {}
212 ckeditor(basename, element_name, body_id, width)
213 // ckeditor ui, including border around wysiwyg area
214 unless element_name in ckeditor_elements_already
215 ckeditor_elements_already[element_name] = 1
216 #{basename}_body #cke_{element_name}
217 width: biggest_content_width + 30px
219 // body tag of the wysiwyg area
220 #{basename}_wysiwyg_{body_id}
221 background: content_bg
227 border: 5px solid #eee
230 ckeditor('admin_pages', 'content', 'content_full_main', columns['widths']['.centerer.full > .main'])
231 ckeditor('admin_pages', 'content', 'content_with_sidebar_main', columns['widths']['.centerer.with_sidebar > .main'])
232 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_plain', columns['widths']['.centerer.with_sidebar > .sidebar.plain'])
233 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_bordered', columns['widths']['.centerer.with_sidebar > .sidebar.bordered'])
235 body > .centerer > .nav
248 display: inline-block
255 box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4)
266 border-top: 1px dotted #ddc;
280 // obsolete floating images (from pastable example code on admin_images)
288 background-repeat: no-repeat
289 background-position: left top
300 background-repeat: no-repeat
301 background-position: left top
309 background-repeat: no-repeat
310 background-position: center top
313 // hack so that vertical margins are only between siblings for the most part
317 article > :first-child,
318 aside > :first-child,
319 section > :first-child,
327 fieldset > :last-child,
328 article > :last-child,
330 section > :last-child,
343 background: rgba(0,0,0,0.04)
346 background: rgba(0,0,0,0.07)
349 background: rgba(0,0,0,0.02)
352 background: rgba(0,0,0,0.09)
356 border: 1px solid red
362 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi
371 background-size: 100% auto
372 background-repeat: no-repeat
373 background-position: 50% top
374 margin-bottom: 3px // padding above caption
375 // clip line with (which is there so ckeditor doesn't delete this)
378 .wfpl_li, .wfpl_ci, .wfpl_ri
379 width: unit(image_float_size * 100, '%') // when window is large
382 margin-right: image_float_margin // this can be a percent right?
388 margin-left: image_float_margin // this can be a percent right?
389 .wfpl_thumb // note: does not contain a .wfpl_i
390 display: inline-block
393 background-size: contain
394 background-position: 50% 50%
395 background-repeat: no-repeat
396 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi, .wfpl_thumb
400 // output css from column calculations
401 for selector, css in columns.css
409 @media screen and (max-width: (columns.width))
410 // output responsive css from column calculations
411 for selector, css in columns.responsive_css
415 // as big as it can be
419 // make sure that borders (which won't scale) and rounding errors don't
421 body > .centerer.full > .main,
422 body > .centerer.with_sidebar > .sidebar.plain,
423 body > .centerer.with_sidebar > .sidebar.bordered
426 // big left/right images
427 for selector, css in columns.css
428 if columns['widths'][selector] > runaround_max
430 col_max_width = columns['widths'][selector]
431 col_min_width = col_max_width / columns.width * single_column_max
433 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
435 width: col_max_width * image_float_size
437 // mixin for making left/right images behave as centered
438 wfpl_li_ri_to_ci(selector, width)
440 .wfpl_li, .wfpl_ci, .wfpl_ri
446 // convert left/right to centered when columns width <= runaround_max
447 for selector, css in columns.css
448 if columns['widths'][selector] > runaround_max
449 // calculate screen width when column width is runaround_max
450 screen_rmax = columns['widths'][selector] / columns.width * runaround_max
451 @media screen and (max-width: (screen_rmax))
452 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * image_float_size)
454 // no @media, because these colums are always narrower than runaround_max
455 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * narrow_column_ifs)
457 // switch to 1-column layout
458 @media screen and (max-width: (single_column_max))
459 for selector, css in columns.css
461 if selector == '.centerer'
463 else if selector in hide_in_one_column_mode
471 margin-top: columns['responsive_css']['.centerer']['margin']
477 @media screen and (max-width: (mobile_menu_width))
478 #mobile_menu_check:not(:checked) + div
480 #mobile_menu_check:checked + div
486 background: rgba(255, 255, 255, 0.95)
494 border-bottom-left-radius: 4px
495 border-bottom-right-radius: 4px
496 box-shadow: 0px 3px 3px rgba(0,0,0,0.1)
505 // undo space_evenly stuff:
515 body > .centerer > .nav ul > li, #mobile_menu_button
517 padding: 3px 10px 4px 17px
518 font-size: font_size_large
519 #admin_images_body .th_toggle_buttons