JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
stylus helper for ckeditor sizing
authorJason Woofenden <jason@jasonwoof.com>
Tue, 23 Jun 2015 20:01:45 +0000 (16:01 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Tue, 23 Jun 2015 20:01:45 +0000 (16:01 -0400)
styl.styl

index f5e96ba..aa50a22 100644 (file)
--- a/styl.styl
+++ b/styl.styl
@@ -133,16 +133,31 @@ body
        color: content_fg
        font: font_size_normal Arimo, Arial, sans-serif
 
-// expand the ckeditor widget so there's space for the content to be exactly
-// the size of the content outside the editor
-.cke
-       margin-right: -15px
-       margin-left: -15px
-// <body> tag within ckeditor
-#admin_pages_wysiwyg_content
-       background: content_bg
-       width: content_width
-       margin: 0 auto
+// 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