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)
261 font-size: font_size_small
267 box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4)
278 border-top: 1px dotted #ddc;
284 font-size: font_size_small
285 background: rgba(255, 244, 244, 0.5)
286 border: 1px dotted #000
292 // obsolete floating images (from pastable example code on admin_images)
300 background-repeat: no-repeat
301 background-position: left top
312 background-repeat: no-repeat
313 background-position: left top
321 background-repeat: no-repeat
322 background-position: center top
325 // hack so that vertical margins are only between siblings for the most part
329 article > :first-child,
330 aside > :first-child,
331 section > :first-child,
339 fieldset > :last-child,
340 article > :last-child,
342 section > :last-child,
355 background: rgba(0,0,0,0.04)
358 background: rgba(0,0,0,0.07)
361 background: rgba(0,0,0,0.02)
364 background: rgba(0,0,0,0.09)
368 border: 1px solid red
374 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi
383 background-size: 100% auto
384 background-repeat: no-repeat
385 background-position: 50% top
386 margin-bottom: 3px // padding above caption
387 // clip line with (which is there so ckeditor doesn't delete this)
390 .wfpl_li, .wfpl_ci, .wfpl_ri
391 width: unit(image_float_size * 100, '%') // when window is large
394 margin-right: image_float_margin // this can be a percent right?
400 margin-left: image_float_margin // this can be a percent right?
401 .wfpl_thumb // note: does not contain a .wfpl_i
402 display: inline-block
405 background-size: contain
406 background-position: 50% 50%
407 background-repeat: no-repeat
408 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi, .wfpl_thumb
412 // output css from column calculations
413 for selector, css in columns.css
416 if columns['widths'][selector] < runaround_max
418 width: narrow_col_lr_width
420 width: narrow_col_ci_width
427 // small enough that things are scaling, big enough that we have all columns
428 @media screen and (max-width: (columns.width))
429 // output responsive css from column calculations
430 for selector, css in columns.responsive_css
434 // as big as it can be
438 // big left/right images
439 for selector, css in columns.css
440 if columns['widths'][selector] > runaround_max
442 col_max_width = columns['widths'][selector]
443 col_min_width = runaround_max
445 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
447 width: col_max_width * image_float_size
449 // switch to 1-column layout when .with_sidebar>.main wouldn't have space for left/right images
450 single_column_max = columns.width / columns['widths']['.centerer.with_sidebar > .main'] * runaround_max
453 background-position: columns.width columns['widths']['.centerer.with_sidebar > .main']
454 background-position: runaround_max single_column_max
455 @media screen and (max-width: (single_column_max))
456 for selector, css in columns.css
458 if selector == '.centerer'
460 else if selector in hide_in_one_column_mode
470 margin-top: columns['responsive_css']['.centerer']['margin']
472 // make image sizing act like it's the "full"/only column
473 col_max_width = columns['widths']['.centerer.full > .main']
474 col_min_width = runaround_max
476 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
478 width: col_max_width * image_float_size
480 // mixin for making left/right images behave as centered
481 wfpl_li_ri_to_ci(selector, width)
483 .wfpl_li, .wfpl_ci, .wfpl_ri
489 // convert left/right images to centered when columns width <= runaround_max
490 for selector, css in columns.css
491 if columns['widths'][selector] > runaround_max
492 // calculate screen width when column width is runaround_max
493 screen_rmax = columns.width / columns['widths']['.centerer.full > .main'] * runaround_max
494 @media screen and (max-width: (screen_rmax))
495 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * image_float_size)
501 @media screen and (max-width: (mobile_menu_width))
504 #mobile_menu_check:not(:checked) + div
506 #mobile_menu_check:checked + div
512 background: rgba(255, 255, 255, 0.95)
520 border-bottom-left-radius: 4px
521 border-bottom-right-radius: 4px
522 box-shadow: 0px 3px 3px rgba(0,0,0,0.1)
531 // undo space_evenly stuff:
541 body > .centerer > .nav ul > li, #mobile_menu_button
543 padding: 0px 10px 0px 17px
544 font-size: font_size_large
545 #admin_images_body .th_toggle_buttons
548 space_evenly(line_height)