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
255 space_evenly(line_height)
264 display: inline-block
271 box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4)
282 border-top: 1px dotted #ddc;
288 font-size: font_size_small
289 background: rgba(255, 244, 244, 0.5)
290 border: 1px dotted #000
296 // obsolete floating images (from pastable example code on admin_images)
304 background-repeat: no-repeat
305 background-position: left top
316 background-repeat: no-repeat
317 background-position: left top
325 background-repeat: no-repeat
326 background-position: center top
329 // hack so that vertical margins are only between siblings for the most part
333 article > :first-child,
334 aside > :first-child,
335 section > :first-child,
343 fieldset > :last-child,
344 article > :last-child,
346 section > :last-child,
359 background: rgba(0,0,0,0.04)
362 background: rgba(0,0,0,0.07)
365 background: rgba(0,0,0,0.02)
368 background: rgba(0,0,0,0.09)
372 border: 1px solid red
378 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi
387 background-size: 100% auto
388 background-repeat: no-repeat
389 background-position: 50% top
390 margin-bottom: 3px // padding above caption
391 // clip line with (which is there so ckeditor doesn't delete this)
394 .wfpl_li, .wfpl_ci, .wfpl_ri
395 width: unit(image_float_size * 100, '%') // when window is large
398 margin-right: image_float_margin // this can be a percent right?
404 margin-left: image_float_margin // this can be a percent right?
405 .wfpl_thumb // note: does not contain a .wfpl_i
406 display: inline-block
409 background-size: contain
410 background-position: 50% 50%
411 background-repeat: no-repeat
412 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi, .wfpl_thumb
416 // output css from column calculations
417 for selector, css in columns.css
420 if columns['widths'][selector] < runaround_max
422 width: narrow_col_lr_width
424 width: narrow_col_ci_width
431 // small enough that things are scaling, big enough that we have all columns
432 @media screen and (max-width: (columns.width))
433 // output responsive css from column calculations
434 for selector, css in columns.responsive_css
438 // as big as it can be
442 // big left/right images
443 for selector, css in columns.css
444 if columns['widths'][selector] > runaround_max
446 col_max_width = columns['widths'][selector]
447 col_min_width = runaround_max
449 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
451 width: col_max_width * image_float_size
453 // switch to 1-column layout when .with_sidebar>.main wouldn't have space for left/right images
454 single_column_max = columns.width / columns['widths']['.centerer.with_sidebar > .main'] * runaround_max
457 background-position: columns.width columns['widths']['.centerer.with_sidebar > .main']
458 background-position: runaround_max single_column_max
459 @media screen and (max-width: (single_column_max))
460 for selector, css in columns.css
462 if selector == '.centerer'
464 else if selector in hide_in_one_column_mode
474 margin-top: columns['responsive_css']['.centerer']['margin']
476 // make image sizing act like it's the "full"/only column
477 col_max_width = columns['widths']['.centerer.full > .main']
478 col_min_width = runaround_max
480 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
482 width: col_max_width * image_float_size
484 // mixin for making left/right images behave as centered
485 wfpl_li_ri_to_ci(selector, width)
487 .wfpl_li, .wfpl_ci, .wfpl_ri
493 // convert left/right images to centered when columns width <= runaround_max
494 for selector, css in columns.css
495 if columns['widths'][selector] > runaround_max
496 // calculate screen width when column width is runaround_max
497 screen_rmax = columns.width / columns['widths']['.centerer.full > .main'] * runaround_max
498 @media screen and (max-width: (screen_rmax))
499 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * image_float_size)
505 @media screen and (max-width: (mobile_menu_width))
508 #mobile_menu_check:not(:checked) + div
510 #mobile_menu_check:checked + div
516 background: rgba(255, 255, 255, 0.95)
524 border-bottom-left-radius: 4px
525 border-bottom-right-radius: 4px
526 box-shadow: 0px 3px 3px rgba(0,0,0,0.1)
535 // undo space_evenly stuff:
545 body > .centerer > .nav ul > li, #mobile_menu_button
547 padding: 3px 10px 4px 17px
548 font-size: font_size_large
549 #admin_images_body .th_toggle_buttons
552 space_evenly(line_height)