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
65 // the gap is used for checking the width calculations, but has no dom element.
66 // This space is left blank (by floating main to the left and sidebar to the
67 // right) and might save the layout if there are borders (which don't scale) or
69 a = remove(columns['css'], '.centerer.with_sidebar > .sidebar.gap')
70 a = remove(columns['responsive_css'], '.centerer.with_sidebar > .sidebar.gap')
72 biggest_content_width = columns['widths']['.centerer.full > .main']
74 hide_in_one_column_mode = {
75 ".centerer.with_sidebar > .sidebar.plain": 1
76 ".centerer.with_sidebar > .sidebar.bordered": 1
81 font_size_large = 18px
82 font_size_normal = 15px
83 font_size_small = 13px
94 image: sha1['images/sprites.min.svg']
95 y_origin: 'bottom' // inkscape rulers are backwards
105 column: 'three' 'four' 'five' 'six' 'seven'
112 row: '0' '1' '2' '3' '4'
132 display: inline-block
135 display: inline-block
139 // always show vertical scrollbar, so content doesn't shift around when
140 // switching from tall to short pages
144 header, hgroup, section, footer, aside, nav, article, figure, img
150 border: 1px solid black
166 border: 1px dotted black
167 padding: 0 15px 15px 15px
176 border: 2px solid red
224 margin: 15px 15px 0 15px
226 p.quote:before, p.quote:after
231 display: inline-block
242 width: 0; // make sure it doesn't wrap
244 p.attrib, p.attribution
245 margin: 0 0 15px 20px
256 background: window_bg
258 font: font_size_normal Arimo, Arial, sans-serif
259 line-height: line_height
261 // call this for each ckeditor on each page
262 ckeditor_elements_already = {}
263 ckeditor(basename, element_name, body_id, width)
264 // ckeditor ui, including border around wysiwyg area
265 outer_selector = '#' + basename + '_body #cke_' + element_name
266 unless outer_selector in ckeditor_elements_already
267 ckeditor_elements_already[outer_selector] = 1
269 width: biggest_content_width + 30px
271 // body tag of the wysiwyg area
272 #{basename}_wysiwyg_{body_id}
273 background: content_bg
279 border: 5px solid #eee
282 ckeditor('admin_pages', 'content', 'content_full_main', columns['widths']['.centerer.full > .main'])
283 ckeditor('admin_pages', 'content', 'content_with_sidebar_main', columns['widths']['.centerer.with_sidebar > .main'])
284 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_plain', columns['widths']['.centerer.with_sidebar > .sidebar.plain'])
285 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_bordered', columns['widths']['.centerer.with_sidebar > .sidebar.bordered'])
293 body > .centerer > .nav
297 space_evenly(line_height)
302 font-size: font_size_small
308 box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4)
319 border-top: 1px dotted #ddc;
325 font-size: font_size_small
326 background: rgba(255, 244, 244, 0.5)
327 border: 1px dotted #000
333 // obsolete floating images (from pastable example code on admin_images)
341 background-repeat: no-repeat
342 background-position: left top
353 background-repeat: no-repeat
354 background-position: left top
362 background-repeat: no-repeat
363 background-position: center top
366 // hack so that vertical margins are only between siblings for the most part
370 article > :first-child,
371 aside > :first-child,
372 section > :first-child,
380 fieldset > :last-child,
381 article > :last-child,
383 section > :last-child,
396 background: rgba(0,0,0,0.04)
399 background: rgba(0,0,0,0.07)
402 background: rgba(0,0,0,0.02)
405 background: rgba(0,0,0,0.09)
409 border: 1px solid red
415 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi
424 background-size: 100% auto
425 background-repeat: no-repeat
426 background-position: 50% top
427 margin-bottom: 3px // padding above caption
428 // clip line with (which is there so ckeditor doesn't delete this)
431 .wfpl_li, .wfpl_ci, .wfpl_ri
432 width: unit(image_float_size * 100, '%') // when window is large
435 margin-right: image_float_margin // this can be a percent right?
441 margin-left: image_float_margin // this can be a percent right?
442 .wfpl_thumb // note: does not contain a .wfpl_i
443 display: inline-block
446 background-size: contain
447 background-position: 50% 50%
448 background-repeat: no-repeat
449 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi, .wfpl_thumb
453 // output css from column calculations
454 for selector, css in columns.css
457 if columns['widths'][selector] < runaround_max
459 width: narrow_col_lr_width
461 width: narrow_col_ci_width
468 // small enough that things are scaling, big enough that we have all columns
469 @media screen and (max-width: (columns.width))
470 // output responsive css from column calculations
471 for selector, css in columns.responsive_css
475 // as big as it can be
479 // big left/right images
480 for selector, css in columns.css
481 if columns['widths'][selector] > runaround_max
483 col_max_width = columns['widths'][selector]
484 col_min_width = runaround_max
486 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
488 width: col_max_width * image_float_size
490 // switch to 1-column layout when .with_sidebar>.main wouldn't have space for left/right images
491 single_column_max = columns.width / columns['widths']['.centerer.with_sidebar > .main'] * runaround_max
494 background-position: columns.width columns['widths']['.centerer.with_sidebar > .main']
495 background-position: runaround_max single_column_max
496 @media screen and (max-width: (single_column_max))
497 for selector, css in columns.css
499 if selector == '.centerer'
501 else if selector in hide_in_one_column_mode
511 margin-top: columns['responsive_css']['.centerer']['margin']
513 // make image sizing act like it's the "full"/only column
514 col_max_width = columns['widths']['.centerer.full > .main']
515 col_min_width = runaround_max
517 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
519 width: col_max_width * image_float_size
521 // mixin for making left/right images behave as centered
522 wfpl_li_ri_to_ci(selector, width)
524 .wfpl_li, .wfpl_ci, .wfpl_ri
530 // convert left/right images to centered when columns width <= runaround_max
531 for selector, css in columns.css
532 if columns['widths'][selector] > runaround_max
533 // calculate screen width when column width is runaround_max
534 screen_rmax = columns.width / columns['widths']['.centerer.full > .main'] * runaround_max
535 @media screen and (max-width: (screen_rmax))
536 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * image_float_size)
542 @media screen and (max-width: (mobile_menu_width))
545 #mobile_menu_check:not(:checked) + div
547 #mobile_menu_check:checked + div
553 background: rgba(255, 255, 255, 0.95)
561 border-bottom-left-radius: 4px
562 border-bottom-right-radius: 4px
563 box-shadow: 0px 3px 3px rgba(0,0,0,0.1)
572 // undo space_evenly stuff:
582 body > .centerer > .nav ul > li, #mobile_menu_button
584 padding: 0px 10px 0px 17px
585 font-size: font_size_large
586 #admin_images_body .th_toggle_buttons
589 space_evenly(line_height)