JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
stylus helper for ckeditor sizing
[wfpl-cms.git] / styl.styl
index 5c8be5d..aa50a22 100644 (file)
--- a/styl.styl
+++ b/styl.styl
@@ -1,26 +1,24 @@
-@require 'code/wfpl/stylus-helpers.styl'
-@require '.image-mtimes.styl'
+@require 'inc/wfpl/stylus_helpers.styl'
+@require '.sha1sums.styl'
 
 // dimensions
-site-width = 934px // inside the shadow
-site-padding = 30px
-sidebar-width = 220px
-content-width = (site-width - (site-padding * 3) - sidebar-width)
-font-size-normal = 15px
-font-size-small = 13px
-font-size-tiny = 11px
-site-column-gap = 40px
-spritesheet-height = 1050px // for sprites near bottom
+site_width = 934px // inside the shadow
+site_padding = 30px
+content_width = (site_width - (site_padding * 2))
+font_size_normal = 15px
+font_size_small = 13px
+font_size_tiny = 11px
+site_column_gap = 40px
 
 // colors
-content-bg = #fff
-content-fg = #000
-window-bg = #e6e7e8
+content_bg = #fff
+content_fg = #000
+window_bg = #e6e7e8
 
 // always show vertical scrollbar, so content doesn't shift around when
 // switching from tall to short pages
 html
-    overflow-y: scroll
+       overflow-y: scroll
 
 header, hgroup, section, footer, aside, nav, article, figure, img
        display: block
@@ -31,9 +29,10 @@ code.html
        border: 1px solid black
        background: #ccc
 
-* + .caption
-       margin-top: 15px
+.caption
        font-weight: bold
+       * + &
+               margin-top: 15px
 
 .field
        padding-top: 3px;
@@ -130,48 +129,60 @@ p.attrib, p.attribution
 body
        margin: 0
        padding: 0
-       color: content-fg
-       font: font-size-normal Arimo, Arial, sans-serif
-
-       // Styles for the <body> tag within ckeditor
-       background: content-bg
-       width: content-width
-       margin: 0 auto
-       &.real_body_tag // revert the above for the <body> on the real site
-               background: window-bg
-               width: auto
-               margin: 0
-
-// expand the ckeditor widget so there's space for the content to be exactly
-// the size of the content outside the editor
-#cke_content
-       margin-right: -15px
-       margin-left: -15px
+       background: window_bg
+       color: content_fg
+       font: font_size_normal Arimo, Arial, sans-serif
+
+// call this for each ckeditor on each page
+ckeditor(basename, element_name, width)
+       // ckeditor ui, including border around wysiwyg area
+       #{basename}_body #cke_{element_name}
+               margin-left: -15px
+               if width < 650px
+                       width: 680px
+               else
+                       width: width + 30px
+       // body tag of the wysiwyg area
+       #{basename}_wysiwyg_{element_name}
+               background: content_bg
+               width: width
+               margin: 0 auto
+               if width <= 600px
+                       min-width: 0
+                       width: width
+                       margin: 0 auto
+                       border-right: 20px solid #eee
+                       border-left: 20px solid #eee
+                       border-top: 1px solid #eee
+                       border-bottom: 1px solid #eee
+                       min-height: 250px
+
+ckeditor('admin_pages', 'content', content_width)
 
 // outermost div for centering, shadow, etc
 #centerer
        position: relative
-       background: content-bg
+       background: content_bg
        padding-top: 150px
-       padding-right: site-padding
-       padding-bottom: site-padding
-       padding-left: site-padding
-       width: site-width - @padding-left - @padding-right
+       padding-right: site_padding
+       padding-bottom: site_padding
+       padding-left: site_padding
+       width: site_width - @padding-left - @padding-right
        margin: 10px auto
 
 nav#site-nav
        padding-bottom: 20px
        ul
-               li-reset()
-               space-evenly()
+               li_reset()
+               space_evenly()
 
 footer
        clear: both
        padding-top: 40px
        ul
-               li-reset()
+               li_reset()
                li
-                       li-reset()
+                       li_reset()
                        display: inline-block
                        margin-right: 10px
 
@@ -242,6 +253,7 @@ td > :first-child,
 th > :first-child,
 legend + *,
 article > :first-child,
+aside > :first-child,
 section > :first-child,
 nav > :first-child,
 div > :first-child,
@@ -252,6 +264,7 @@ td > :last-child,
 th > :last-child,
 fieldset > :last-child,
 article > :last-child,
+aside > :last-child,
 section > :last-child,
 nav > :last-child,
 div > :last-child,
@@ -259,14 +272,27 @@ div > :last-child,
        margin-bottom: 0px
 
 table.evenodd
+       td, th
+               padding: 6px 12px
+               text-align: left
        > thead, > tbody, &
                > tr:nth-child(2n+1)
-                       > td:nth-child(2n)
-                               background: rgba(0,0,0,0)
-                       > td:nth-child(2n+1)
-                               background: rgba(0,0,0,0.05)
+                       > td, > th
+                               background: rgba(0,0,0,0.04)
+                       &:hover
+                               > td, > th
+                                       background: rgba(0,0,0,0.07)
                > tr:nth-child(2n+0)
-                       > td:nth-child(2n)
-                               background: rgba(0,0,0,0.05)
-                       > td:nth-child(2n+1)
-                               background: rgba(0,0,0,0.1)
+                       > td, > th
+                               background: rgba(0,0,0,0.02)
+                       &:hover
+                               > td, > th
+                                       background: rgba(0,0,0,0.09)
+
+.field_error
+       input
+               border: 1px solid red
+
+.password_suggestion
+       & + &
+               margin-left: 10px