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({
40 width: centerer_width - sidebar_width - sidebar_gap
50 outer_width: sidebar_width
59 outer_width: sidebar_width
67 // the gap is used for checking the width calculations, but has no dom element.
68 // This space is left blank (by floating main to the left and sidebar to the
69 // right) and might save the layout if there are borders (which don't scale) or
71 remove(columns['css'], '.centerer.with_sidebar > .sidebar.gap')
72 remove(columns['responsive_css'], '.centerer.with_sidebar > .sidebar.gap')
74 biggest_content_width = columns['widths']['.centerer.full > .main']
76 hide_in_one_column_mode = {
77 ".centerer.with_sidebar > .sidebar.plain": 1
78 ".centerer.with_sidebar > .sidebar.bordered": 1
83 font_size_large = 18px
84 font_size_normal = 15px
85 font_size_small = 13px
99 // always show vertical scrollbar, so content doesn't shift around when
100 // switching from tall to short pages
104 header, hgroup, section, footer, aside, nav, article, figure, img
110 border: 1px solid black
126 border: 1px dotted black
127 padding: 0 15px 15px 15px
136 border: 2px solid red
184 margin: 15px 15px 0 15px
186 p.quote:before, p.quote:after
191 display: inline-block
202 width: 0; // make sure it doesn't wrap
204 p.attrib, p.attribution
205 margin: 0 0 15px 20px
216 background: window_bg
218 font: font_size_normal Arimo, Arial, sans-serif
219 line-height: line_height
221 // call this for each ckeditor on each page
222 ckeditor_elements_already = {}
223 ckeditor(basename, element_name, body_id, width)
224 // ckeditor ui, including border around wysiwyg area
225 outer_selector = '#' + basename + '_body #cke_' + element_name
226 unless outer_selector in ckeditor_elements_already
227 ckeditor_elements_already[outer_selector] = 1
229 width: biggest_content_width + 30px
231 // body tag of the wysiwyg area
232 #{basename}_wysiwyg_{body_id}
233 background: content_bg
239 border: 5px solid #eee
242 ckeditor('admin_pages', 'content', 'content_full_main', columns['widths']['.centerer.full > .main'])
243 ckeditor('admin_pages', 'content', 'content_with_sidebar_main', columns['widths']['.centerer.with_sidebar > .main'])
244 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_plain', columns['widths']['.centerer.with_sidebar > .sidebar.plain'])
245 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_bordered', columns['widths']['.centerer.with_sidebar > .sidebar.bordered'])
250 body > .centerer > .nav
253 space_evenly(line_height)
262 display: inline-block
269 box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4)
280 border-top: 1px dotted #ddc;
286 font-size: font_size_small
295 // obsolete floating images (from pastable example code on admin_images)
303 background-repeat: no-repeat
304 background-position: left top
315 background-repeat: no-repeat
316 background-position: left top
324 background-repeat: no-repeat
325 background-position: center top
328 // hack so that vertical margins are only between siblings for the most part
332 article > :first-child,
333 aside > :first-child,
334 section > :first-child,
342 fieldset > :last-child,
343 article > :last-child,
345 section > :last-child,
358 background: rgba(0,0,0,0.04)
361 background: rgba(0,0,0,0.07)
364 background: rgba(0,0,0,0.02)
367 background: rgba(0,0,0,0.09)
371 border: 1px solid red
377 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi
386 background-size: 100% auto
387 background-repeat: no-repeat
388 background-position: 50% top
389 margin-bottom: 3px // padding above caption
390 // clip line with (which is there so ckeditor doesn't delete this)
393 .wfpl_li, .wfpl_ci, .wfpl_ri
394 width: unit(image_float_size * 100, '%') // when window is large
397 margin-right: image_float_margin // this can be a percent right?
403 margin-left: image_float_margin // this can be a percent right?
404 .wfpl_thumb // note: does not contain a .wfpl_i
405 display: inline-block
408 background-size: contain
409 background-position: 50% 50%
410 background-repeat: no-repeat
411 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi, .wfpl_thumb
415 // output css from column calculations
416 for selector, css in columns.css
419 if columns['widths'][selector] < runaround_max
421 width: narrow_col_lr_width
423 width: narrow_col_ci_width
430 // small enough that things are scaling, big enough that we have all columns
431 @media screen and (max-width: (columns.width))
432 // output responsive css from column calculations
433 for selector, css in columns.responsive_css
437 // as big as it can be
441 // big left/right images
442 for selector, css in columns.css
443 if columns['widths'][selector] > runaround_max
445 col_max_width = columns['widths'][selector]
446 col_min_width = runaround_max
448 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
450 width: col_max_width * image_float_size
452 // switch to 1-column layout when .with_sidebar>.main wouldn't have space for left/right images
453 single_column_max = columns.width / columns['widths']['.centerer.with_sidebar > .main'] * runaround_max
456 background-position: columns.width columns['widths']['.centerer.with_sidebar > .main']
457 background-position: runaround_max single_column_max
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
473 margin-top: columns['responsive_css']['.centerer']['margin']
475 // make image sizing act like it's the "full"/only column
476 col_max_width = columns['widths']['.centerer.full > .main']
477 col_min_width = runaround_max
479 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
481 width: col_max_width * image_float_size
483 // mixin for making left/right images behave as centered
484 wfpl_li_ri_to_ci(selector, width)
486 .wfpl_li, .wfpl_ci, .wfpl_ri
492 // convert left/right images to centered when columns width <= runaround_max
493 for selector, css in columns.css
494 if columns['widths'][selector] > runaround_max
495 // calculate screen width when column width is runaround_max
496 screen_rmax = columns.width / columns['widths']['.centerer.full > .main'] * runaround_max
497 @media screen and (max-width: (screen_rmax))
498 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * image_float_size)
504 @media screen and (max-width: (mobile_menu_width))
507 #mobile_menu_check:not(:checked) + div
509 #mobile_menu_check:checked + div
515 background: rgba(255, 255, 255, 0.95)
523 border-bottom-left-radius: 4px
524 border-bottom-right-radius: 4px
525 box-shadow: 0px 3px 3px rgba(0,0,0,0.1)
534 // undo space_evenly stuff:
544 body > .centerer > .nav ul > li, #mobile_menu_button
546 padding: 3px 10px 4px 17px
547 font-size: font_size_large
548 #admin_images_body .th_toggle_buttons
551 space_evenly(line_height)