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 // at col max width: ratio to image width
13 narrow_col_lr_width = 50% // width of left/right images in always-narrow columns
14 narrow_col_ci_width = 70% // width of centered images in always-narrow columns
15 image_float_min_size = 0.5 // ratio to image width when cols are scaled to min width
16 image_float_margin = 2%
17 mobile_menu_width = 600px // switch to mobile menu when screen gets this narrow
19 runaround_max = 370px // narrowest column that can have left/right images
20 centerer_width = 950px // inside. outside is columns.width
23 columns = wfpl_columns({
39 width: centerer_width - sidebar_width - sidebar_gap
49 outer_width: sidebar_width
58 outer_width: sidebar_width
66 // the gap is used for checking the width calculations, but has no dom element.
67 // This space is left blank (by floating main to the left and sidebar to the
68 // right) and might save the layout if there are borders (which don't scale) or
70 remove(columns['css'], '.centerer.with_sidebar > .sidebar.gap')
71 remove(columns['responsive_css'], '.centerer.with_sidebar > .sidebar.gap')
73 biggest_content_width = columns['widths']['.centerer.full > .main']
75 hide_in_one_column_mode = {
76 ".centerer.with_sidebar > .sidebar.plain": 1
77 ".centerer.with_sidebar > .sidebar.bordered": 1
82 font_size_large = 18px
83 font_size_normal = 15px
84 font_size_small = 13px
98 // always show vertical scrollbar, so content doesn't shift around when
99 // switching from tall to short pages
103 header, hgroup, section, footer, aside, nav, article, figure, img
109 border: 1px solid black
125 border: 1px dotted black
126 padding: 0 15px 15px 15px
135 border: 2px solid red
183 margin: 15px 15px 0 15px
185 p.quote:before, p.quote:after
190 display: inline-block
201 width: 0; // make sure it doesn't wrap
203 p.attrib, p.attribution
204 margin: 0 0 15px 20px
215 background: window_bg
217 font: font_size_normal Arimo, Arial, sans-serif
218 line-height: line_height
220 // call this for each ckeditor on each page
221 ckeditor_elements_already = {}
222 ckeditor(basename, element_name, body_id, width)
223 // ckeditor ui, including border around wysiwyg area
224 outer_selector = '#' + basename + '_body #cke_' + element_name
225 unless outer_selector in ckeditor_elements_already
226 ckeditor_elements_already[outer_selector] = 1
228 width: biggest_content_width + 30px
230 // body tag of the wysiwyg area
231 #{basename}_wysiwyg_{body_id}
232 background: content_bg
238 border: 5px solid #eee
241 ckeditor('admin_pages', 'content', 'content_full_main', columns['widths']['.centerer.full > .main'])
242 ckeditor('admin_pages', 'content', 'content_with_sidebar_main', columns['widths']['.centerer.with_sidebar > .main'])
243 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_plain', columns['widths']['.centerer.with_sidebar > .sidebar.plain'])
244 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_bordered', columns['widths']['.centerer.with_sidebar > .sidebar.bordered'])
252 body > .centerer > .nav
256 space_evenly(line_height)
265 display: inline-block
272 box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4)
283 border-top: 1px dotted #ddc;
289 font-size: font_size_small
290 background: rgba(255, 244, 244, 0.5)
291 border: 1px dotted #000
297 // obsolete floating images (from pastable example code on admin_images)
305 background-repeat: no-repeat
306 background-position: left top
317 background-repeat: no-repeat
318 background-position: left top
326 background-repeat: no-repeat
327 background-position: center top
330 // hack so that vertical margins are only between siblings for the most part
334 article > :first-child,
335 aside > :first-child,
336 section > :first-child,
344 fieldset > :last-child,
345 article > :last-child,
347 section > :last-child,
360 background: rgba(0,0,0,0.04)
363 background: rgba(0,0,0,0.07)
366 background: rgba(0,0,0,0.02)
369 background: rgba(0,0,0,0.09)
373 border: 1px solid red
379 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi
388 background-size: 100% auto
389 background-repeat: no-repeat
390 background-position: 50% top
391 margin-bottom: 3px // padding above caption
392 // clip line with (which is there so ckeditor doesn't delete this)
395 .wfpl_li, .wfpl_ci, .wfpl_ri
396 width: unit(image_float_size * 100, '%') // when window is large
399 margin-right: image_float_margin // this can be a percent right?
405 margin-left: image_float_margin // this can be a percent right?
406 .wfpl_thumb // note: does not contain a .wfpl_i
407 display: inline-block
410 background-size: contain
411 background-position: 50% 50%
412 background-repeat: no-repeat
413 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi, .wfpl_thumb
417 // output css from column calculations
418 for selector, css in columns.css
421 if columns['widths'][selector] < runaround_max
423 width: narrow_col_lr_width
425 width: narrow_col_ci_width
432 // small enough that things are scaling, big enough that we have all columns
433 @media screen and (max-width: (columns.width))
434 // output responsive css from column calculations
435 for selector, css in columns.responsive_css
439 // as big as it can be
443 // big left/right images
444 for selector, css in columns.css
445 if columns['widths'][selector] > runaround_max
447 col_max_width = columns['widths'][selector]
448 col_min_width = runaround_max
450 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
452 width: col_max_width * image_float_size
454 // switch to 1-column layout when .with_sidebar>.main wouldn't have space for left/right images
455 single_column_max = columns.width / columns['widths']['.centerer.with_sidebar > .main'] * runaround_max
458 background-position: columns.width columns['widths']['.centerer.with_sidebar > .main']
459 background-position: runaround_max single_column_max
460 @media screen and (max-width: (single_column_max))
461 for selector, css in columns.css
463 if selector == '.centerer'
465 else if selector in hide_in_one_column_mode
475 margin-top: columns['responsive_css']['.centerer']['margin']
477 // make image sizing act like it's the "full"/only column
478 col_max_width = columns['widths']['.centerer.full > .main']
479 col_min_width = runaround_max
481 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
483 width: col_max_width * image_float_size
485 // mixin for making left/right images behave as centered
486 wfpl_li_ri_to_ci(selector, width)
488 .wfpl_li, .wfpl_ci, .wfpl_ri
494 // convert left/right images to centered when columns width <= runaround_max
495 for selector, css in columns.css
496 if columns['widths'][selector] > runaround_max
497 // calculate screen width when column width is runaround_max
498 screen_rmax = columns.width / columns['widths']['.centerer.full > .main'] * runaround_max
499 @media screen and (max-width: (screen_rmax))
500 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * image_float_size)
506 @media screen and (max-width: (mobile_menu_width))
509 #mobile_menu_check:not(:checked) + div
511 #mobile_menu_check:checked + div
517 background: rgba(255, 255, 255, 0.95)
525 border-bottom-left-radius: 4px
526 border-bottom-right-radius: 4px
527 box-shadow: 0px 3px 3px rgba(0,0,0,0.1)
536 // undo space_evenly stuff:
546 body > .centerer > .nav ul > li, #mobile_menu_button
548 padding: 0px 10px 0px 17px
549 font-size: font_size_large
550 #admin_images_body .th_toggle_buttons
553 space_evenly(line_height)