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_column_ifs = image_float_size * 1.5 // img width ratio for always-small columns
14 image_float_min_size = 0.5 // ratio to image width when cols are scaled to min width
15 image_float_margin = 2%
16 mobile_menu_width = 600px // switch to mobile menu when screen gets this narrow
18 runaround_max = 370px // narrowest column that can have left/right images
19 centerer_width = 950px // inside. outside is columns.width
22 columns = wfpl_columns({
39 width: centerer_width - sidebar_width - sidebar_gap
45 margin-left: sidebar_gap
51 margin-left: sidebar_gap
56 width: sidebar_width - 2px - 30px
64 biggest_content_width = columns['widths']['.centerer.full > .main']
66 hide_in_one_column_mode = {
67 ".centerer.with_sidebar > .sidebar.plain": 1
68 ".centerer.with_sidebar > .sidebar.bordered": 1
72 font_size_large = 18px
73 font_size_normal = 15px
74 font_size_small = 13px
88 // always show vertical scrollbar, so content doesn't shift around when
89 // switching from tall to short pages
93 header, hgroup, section, footer, aside, nav, article, figure, img
99 border: 1px solid black
115 border: 1px dotted black
116 padding: 0 15px 15px 15px
125 border: 2px solid red
173 margin: 15px 15px 0 15px
175 p.quote:before, p.quote:after
180 display: inline-block
191 width: 0; // make sure it doesn't wrap
193 p.attrib, p.attribution
194 margin: 0 0 15px 20px
205 background: window_bg
207 font: font_size_normal Arimo, Arial, sans-serif
209 // call this for each ckeditor on each page
210 ckeditor_elements_already = {}
211 ckeditor(basename, element_name, body_id, width)
212 // ckeditor ui, including border around wysiwyg area
213 outer_selector = '#' + basename + '_body #cke_' + element_name
214 unless outer_selector in ckeditor_elements_already
215 ckeditor_elements_already[outer_selector] = 1
217 width: biggest_content_width + 30px
219 // body tag of the wysiwyg area
220 #{basename}_wysiwyg_{body_id}
221 background: content_bg
227 border: 5px solid #eee
230 ckeditor('admin_pages', 'content', 'content_full_main', columns['widths']['.centerer.full > .main'])
231 ckeditor('admin_pages', 'content', 'content_with_sidebar_main', columns['widths']['.centerer.with_sidebar > .main'])
232 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_plain', columns['widths']['.centerer.with_sidebar > .sidebar.plain'])
233 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_bordered', columns['widths']['.centerer.with_sidebar > .sidebar.bordered'])
235 body > .centerer > .nav
248 display: inline-block
255 box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4)
266 border-top: 1px dotted #ddc;
280 // obsolete floating images (from pastable example code on admin_images)
288 background-repeat: no-repeat
289 background-position: left top
300 background-repeat: no-repeat
301 background-position: left top
309 background-repeat: no-repeat
310 background-position: center top
313 // hack so that vertical margins are only between siblings for the most part
317 article > :first-child,
318 aside > :first-child,
319 section > :first-child,
327 fieldset > :last-child,
328 article > :last-child,
330 section > :last-child,
343 background: rgba(0,0,0,0.04)
346 background: rgba(0,0,0,0.07)
349 background: rgba(0,0,0,0.02)
352 background: rgba(0,0,0,0.09)
356 border: 1px solid red
362 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi
371 background-size: 100% auto
372 background-repeat: no-repeat
373 background-position: 50% top
374 margin-bottom: 3px // padding above caption
375 // clip line with (which is there so ckeditor doesn't delete this)
378 .wfpl_li, .wfpl_ci, .wfpl_ri
379 width: unit(image_float_size * 100, '%') // when window is large
382 margin-right: image_float_margin // this can be a percent right?
388 margin-left: image_float_margin // this can be a percent right?
389 .wfpl_thumb // note: does not contain a .wfpl_i
390 display: inline-block
393 background-size: contain
394 background-position: 50% 50%
395 background-repeat: no-repeat
396 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi, .wfpl_thumb
400 // output css from column calculations
401 for selector, css in columns.css
409 // small enough that things are scaling, big enough that we have all columns
410 @media screen and (max-width: (columns.width))
411 // output responsive css from column calculations
412 for selector, css in columns.responsive_css
416 // as big as it can be
420 // make sure that borders (which won't scale) and rounding errors don't
422 body > .centerer.full > .main,
423 body > .centerer.with_sidebar > .sidebar.plain,
424 body > .centerer.with_sidebar > .sidebar.bordered
427 // big left/right images
428 for selector, css in columns.css
429 if columns['widths'][selector] > runaround_max
431 col_max_width = columns['widths'][selector]
432 col_min_width = runaround_max
434 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
436 width: col_max_width * image_float_size
438 // switch to 1-column layout when .with_sidebar>.main wouldn't have space for left/right images
439 single_column_max = columns.width / columns['widths']['.centerer.with_sidebar > .main'] * runaround_max
442 background-position: columns.width columns['widths']['.centerer.with_sidebar > .main']
443 background-position: runaround_max single_column_max
444 @media screen and (max-width: (single_column_max))
445 for selector, css in columns.css
447 if selector == '.centerer'
449 else if selector in hide_in_one_column_mode
457 margin-top: columns['responsive_css']['.centerer']['margin']
459 // make image sizing act like it's the "full"/only column
460 col_max_width = columns['widths']['.centerer.full > .main']
461 col_min_width = runaround_max
463 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
465 width: col_max_width * image_float_size
467 // mixin for making left/right images behave as centered
468 wfpl_li_ri_to_ci(selector, width)
470 .wfpl_li, .wfpl_ci, .wfpl_ri
476 // convert left/right to centered when columns width <= runaround_max
477 for selector, css in columns.css
478 if columns['widths'][selector] > runaround_max
479 // calculate screen width when column width is runaround_max
480 screen_rmax = columns.width / columns['widths']['.centerer.full > .main'] * runaround_max
481 @media screen and (max-width: (screen_rmax))
482 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * image_float_size)
484 // no @media, because these colums are always narrower than runaround_max
485 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * narrow_column_ifs)
491 @media screen and (max-width: (mobile_menu_width))
492 #mobile_menu_check:not(:checked) + div
494 #mobile_menu_check:checked + div
500 background: rgba(255, 255, 255, 0.95)
508 border-bottom-left-radius: 4px
509 border-bottom-right-radius: 4px
510 box-shadow: 0px 3px 3px rgba(0,0,0,0.1)
519 // undo space_evenly stuff:
529 body > .centerer > .nav ul > li, #mobile_menu_button
531 padding: 3px 10px 4px 17px
532 font-size: font_size_large
533 #admin_images_body .th_toggle_buttons