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
46 margin-left: sidebar_gap
52 margin-left: sidebar_gap
57 width: sidebar_width - 2px - 30px
65 biggest_content_width = columns['widths']['.centerer.full > .main']
67 hide_in_one_column_mode = {
68 ".centerer.with_sidebar > .sidebar.plain": 1
69 ".centerer.with_sidebar > .sidebar.bordered": 1
73 font_size_large = 18px
74 font_size_normal = 15px
75 font_size_small = 13px
89 // always show vertical scrollbar, so content doesn't shift around when
90 // switching from tall to short pages
94 header, hgroup, section, footer, aside, nav, article, figure, img
100 border: 1px solid black
116 border: 1px dotted black
117 padding: 0 15px 15px 15px
126 border: 2px solid red
174 margin: 15px 15px 0 15px
176 p.quote:before, p.quote:after
181 display: inline-block
192 width: 0; // make sure it doesn't wrap
194 p.attrib, p.attribution
195 margin: 0 0 15px 20px
206 background: window_bg
208 font: font_size_normal Arimo, Arial, sans-serif
210 // call this for each ckeditor on each page
211 ckeditor_elements_already = {}
212 ckeditor(basename, element_name, body_id, width)
213 // ckeditor ui, including border around wysiwyg area
214 outer_selector = '#' + basename + '_body #cke_' + element_name
215 unless outer_selector in ckeditor_elements_already
216 ckeditor_elements_already[outer_selector] = 1
218 width: biggest_content_width + 30px
220 // body tag of the wysiwyg area
221 #{basename}_wysiwyg_{body_id}
222 background: content_bg
228 border: 5px solid #eee
231 ckeditor('admin_pages', 'content', 'content_full_main', columns['widths']['.centerer.full > .main'])
232 ckeditor('admin_pages', 'content', 'content_with_sidebar_main', columns['widths']['.centerer.with_sidebar > .main'])
233 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_plain', columns['widths']['.centerer.with_sidebar > .sidebar.plain'])
234 ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_bordered', columns['widths']['.centerer.with_sidebar > .sidebar.bordered'])
236 body > .centerer > .nav
249 display: inline-block
256 box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4)
267 border-top: 1px dotted #ddc;
281 // obsolete floating images (from pastable example code on admin_images)
289 background-repeat: no-repeat
290 background-position: left top
301 background-repeat: no-repeat
302 background-position: left top
310 background-repeat: no-repeat
311 background-position: center top
314 // hack so that vertical margins are only between siblings for the most part
318 article > :first-child,
319 aside > :first-child,
320 section > :first-child,
328 fieldset > :last-child,
329 article > :last-child,
331 section > :last-child,
344 background: rgba(0,0,0,0.04)
347 background: rgba(0,0,0,0.07)
350 background: rgba(0,0,0,0.02)
353 background: rgba(0,0,0,0.09)
357 border: 1px solid red
363 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi
372 background-size: 100% auto
373 background-repeat: no-repeat
374 background-position: 50% top
375 margin-bottom: 3px // padding above caption
376 // clip line with (which is there so ckeditor doesn't delete this)
379 .wfpl_li, .wfpl_ci, .wfpl_ri
380 width: unit(image_float_size * 100, '%') // when window is large
383 margin-right: image_float_margin // this can be a percent right?
389 margin-left: image_float_margin // this can be a percent right?
390 .wfpl_thumb // note: does not contain a .wfpl_i
391 display: inline-block
394 background-size: contain
395 background-position: 50% 50%
396 background-repeat: no-repeat
397 .wfpl_li, .wfpl_ci, .wfpl_ri, .wfpl_fi, .wfpl_thumb
401 // output css from column calculations
402 for selector, css in columns.css
405 if columns['widths'][selector] < runaround_max
407 width: narrow_col_lr_width
409 width: narrow_col_ci_width
415 // small enough that things are scaling, big enough that we have all columns
416 @media screen and (max-width: (columns.width))
417 // output responsive css from column calculations
418 for selector, css in columns.responsive_css
422 // as big as it can be
426 // make sure that borders (which won't scale) and rounding errors don't
428 body > .centerer.full > .main,
429 body > .centerer.with_sidebar > .sidebar.plain,
430 body > .centerer.with_sidebar > .sidebar.bordered
433 // big left/right images
434 for selector, css in columns.css
435 if columns['widths'][selector] > runaround_max
437 col_max_width = columns['widths'][selector]
438 col_min_width = runaround_max
440 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
442 width: col_max_width * image_float_size
444 // switch to 1-column layout when .with_sidebar>.main wouldn't have space for left/right images
445 single_column_max = columns.width / columns['widths']['.centerer.with_sidebar > .main'] * runaround_max
448 background-position: columns.width columns['widths']['.centerer.with_sidebar > .main']
449 background-position: runaround_max single_column_max
450 @media screen and (max-width: (single_column_max))
451 for selector, css in columns.css
453 if selector == '.centerer'
455 else if selector in hide_in_one_column_mode
463 margin-top: columns['responsive_css']['.centerer']['margin']
465 // make image sizing act like it's the "full"/only column
466 col_max_width = columns['widths']['.centerer.full > .main']
467 col_min_width = runaround_max
469 width: linear_scale_calc(col_max_width, col_min_width, col_max_width * image_float_size, col_min_width * image_float_min_size)
471 width: col_max_width * image_float_size
473 // mixin for making left/right images behave as centered
474 wfpl_li_ri_to_ci(selector, width)
476 .wfpl_li, .wfpl_ci, .wfpl_ri
482 // convert left/right to centered when columns width <= runaround_max
483 for selector, css in columns.css
484 if columns['widths'][selector] > runaround_max
485 // calculate screen width when column width is runaround_max
486 screen_rmax = columns.width / columns['widths']['.centerer.full > .main'] * runaround_max
487 @media screen and (max-width: (screen_rmax))
488 wfpl_li_ri_to_ci(selector, columns['widths'][selector] * image_float_size)
494 @media screen and (max-width: (mobile_menu_width))
495 #mobile_menu_check:not(:checked) + div
497 #mobile_menu_check:checked + div
503 background: rgba(255, 255, 255, 0.95)
511 border-bottom-left-radius: 4px
512 border-bottom-right-radius: 4px
513 box-shadow: 0px 3px 3px rgba(0,0,0,0.1)
522 // undo space_evenly stuff:
532 body > .centerer > .nav ul > li, #mobile_menu_button
534 padding: 3px 10px 4px 17px
535 font-size: font_size_large
536 #admin_images_body .th_toggle_buttons