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
95 image: sha1['images/sprites.min.svg']
96 y_origin: 'bottom' // inkscape rulers are backwards
106 column: 'three' 'four' 'five' 'six' 'seven'
113 row: '0' '1' '2' '3' '4'
133 display: inline-block
136 display: inline-block
140 // always show vertical scrollbar, so content doesn't shift around when
141 // switching from tall to short pages
145 header, hgroup, section, footer, aside, nav, article, figure, img
151 border: 1px solid black
167 border: 1px dotted black
168 padding: 0 15px 15px 15px
177 border: 2px solid red
225 margin: 15px 15px 0 15px
227 p.quote:before, p.quote:after
232 display: inline-block
243 width: 0; // make sure it doesn't wrap
245 p.attrib, p.attribution
246 margin: 0 0 15px 20px
257 background: window_bg
259 font: font_size_normal Arimo, Arial, sans-serif
260 line-height: line_height
262 // call this for each ckeditor on each page
263 ckeditor_elements_already = {}
264 ckeditor(basename, element_name, body_id, width)
265 // ckeditor ui, including border around wysiwyg area
266 outer_selector = '#' + basename + '_body #cke_' + element_name
267 unless outer_selector in ckeditor_elements_already
268 ckeditor_elements_already[outer_selector] = 1
270 width: biggest_content_width + 30px
272 // body tag of the wysiwyg area
273 #{basename}_wysiwyg_{body_id}
274 background: content_bg
280 border: 5px solid #eee
283 ckeditor('admin_pages', 'content', 'content_full_main', columns['widths']['.centerer.full > .main'])
284 ckeditor('admin_pages', 'content', 'content_with_sidebar_main', columns['widths']['.centerer.with_sidebar > .main'])
285 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_plain', columns['widths']['.centerer.with_sidebar > .sidebar.plain'])
286 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_bordered', columns['widths']['.centerer.with_sidebar > .sidebar.bordered'])
294 body > .centerer > .nav
298 space_evenly(line_height)
303 font-size: font_size_small
309 box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4)
320 border-top: 1px dotted #ddc;
326 font-size: font_size_small
327 background: rgba(255, 244, 244, 0.5)
328 border: 1px dotted #000
334 // obsolete floating images (from pastable example code on admin_images)
342 background-repeat: no-repeat
343 background-position: left top
354 background-repeat: no-repeat
355 background-position: left top
363 background-repeat: no-repeat
364 background-position: center top
367 // hack so that vertical margins are only between siblings for the most part
371 article > :first-child,
372 aside > :first-child,
373 section > :first-child,
381 fieldset > :last-child,
382 article > :last-child,
384 section > :last-child,
397 background: rgba(0,0,0,0.04)
400 background: rgba(0,0,0,0.07)
403 background: rgba(0,0,0,0.02)
406 background: rgba(0,0,0,0.09)
410 border: 1px solid red
416 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi
425 background-size: 100% auto
426 background-repeat: no-repeat
427 background-position: 50% top
428 margin-bottom: 3px // padding above caption
429 // clip line with (which is there so ckeditor doesn't delete this)
432 .wfpl_li, .wfpl_ci, .wfpl_ri
433 width: unit(image_float_size * 100, '%') // when window is large
436 margin-right: image_float_margin // this can be a percent right?
442 margin-left: image_float_margin // this can be a percent right?
443 .wfpl_thumb // note: does not contain a .wfpl_i
444 display: inline-block
447 background-size: contain
448 background-position: 50% 50%
449 background-repeat: no-repeat
450 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi, .wfpl_thumb
454 // output css from column calculations
455 for selector, css in columns.css
458 if columns['widths'][selector] < runaround_max
460 width: narrow_col_lr_width
462 width: narrow_col_ci_width
469 // small enough that things are scaling, big enough that we have all columns
470 @media screen and (max-width: (columns.width))
471 // output responsive css from column calculations
472 for selector, css in columns.responsive_css
476 // as big as it can be
480 // big left/right images
481 for selector, css in columns.css
482 if columns['widths'][selector] > runaround_max
484 col_max_width = columns['widths'][selector]
485 col_min_width = runaround_max
487 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
489 width: col_max_width * image_float_size
491 // switch to 1-column layout when .with_sidebar>.main wouldn't have space for left/right images
492 single_column_max = columns.width / columns['widths']['.centerer.with_sidebar > .main'] * runaround_max
495 background-position: columns.width columns['widths']['.centerer.with_sidebar > .main']
496 background-position: runaround_max single_column_max
497 @media screen and (max-width: (single_column_max))
498 for selector, css in columns.css
500 if selector == '.centerer'
502 else if selector in hide_in_one_column_mode
512 margin-top: columns['responsive_css']['.centerer']['margin']
514 // make image sizing act like it's the "full"/only column
515 col_max_width = columns['widths']['.centerer.full > .main']
516 col_min_width = runaround_max
518 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
520 width: col_max_width * image_float_size
522 // mixin for making left/right images behave as centered
523 wfpl_li_ri_to_ci(selector, width)
525 .wfpl_li, .wfpl_ci, .wfpl_ri
531 // convert left/right images to centered when columns width <= runaround_max
532 for selector, css in columns.css
533 if columns['widths'][selector] > runaround_max
534 // calculate screen width when column width is runaround_max
535 screen_rmax = columns.width / columns['widths']['.centerer.full > .main'] * runaround_max
536 @media screen and (max-width: (screen_rmax))
537 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * image_float_size)
543 @media screen and (max-width: (mobile_menu_width))
546 #mobile_menu_check:not(:checked) + div
548 #mobile_menu_check:checked + div
554 background: rgba(255, 255, 255, 0.95)
562 border-bottom-left-radius: 4px
563 border-bottom-right-radius: 4px
564 box-shadow: 0px 3px 3px rgba(0,0,0,0.1)
573 // undo space_evenly stuff:
583 body > .centerer > .nav ul > li, #mobile_menu_button
585 padding: 0px 10px 0px 17px
586 font-size: font_size_large
587 #admin_images_body .th_toggle_buttons
590 space_evenly(line_height)