From 0a5d51b1488c91a5b6387d440ab16c04ef10bac8 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Tue, 23 Jun 2015 16:01:45 -0400 Subject: [PATCH] stylus helper for ckeditor sizing --- styl.styl | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/styl.styl b/styl.styl index f5e96ba..aa50a22 100644 --- 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 -// 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 -- 1.7.10.4