COLOR =================================================================== **/ if ( ( $color = aweaver_getopt( 'hr_color' ) ) && $color != 'inherit' ) { $put .= "hr,hr.wp-block-separator{background-color:{$color};}\n"; } if ( ( $css = aweaver_getopt( 'hr_color_css' ) ) ) { $put .= "hr,hr.wp-block-separator{$css}\n"; } $bgcolor = aweaver_getopt_default( 'content_h_bgcolor', 'inherit' ); if ( $bgcolor != 'inherit' ) { $put .= "{$block_sel},{$mce_sel}{background-color: {$bgcolor};}\n"; } $css = $color = aweaver_getopt( 'content_h_bgcolor_css' ); if ( $css ) { $put .= "{$block_sel},{$mce_sel}{$css}\n"; } return $put; } //# early style function aweaver_output_edit_style( $editor = 'mce' ) { $put = sprintf( "/* WARNING: Do not edit this file. It is dynamically generated. Any edits you make will be overwritten. */ /* This file for %s generated using %s %s subtheme: %s */\n", $editor, AWEAVER_THEMENAME, AWEAVER_VERSION, aweaver_getopt( 'themename' ) ); if ( $editor == 'mce' ) { $content_body = '.mce-content-body'; $selector = '.mce-content-body'; $selector_tr = '.mce-content-body,body,tr,td,label,th,thead th'; $selector_font = $selector_tr; $selector_bg = $selector; } else { $content_body = '.mce-content-body '; $selector = ".mce-content-body, *[class^='wp-block-'],.mce-content-body p "; $selector_tr = ".mce-content-body,.mce-content-body *[class^='wp-block-'],.mce-content-body p,.mce-content-body tr,.mce-content-body td,.mce-content-body label,.mce-content-body th,.mce-content-body thead th "; $selector_font = $selector_tr . ',.editor-block-list__block:not( .is-multi-selected ) .wp-block-paragraph,.edit-post-visual-editor,.edit-post-visual-editor p,.edit-post-layout .editor-post-title textarea'; $selector_bg = '.editor-styles-wrapper'; } // ** FONT family - default ** $body_font_family = aweaver_get_cascade_opt( '_font_family', 'inherit' ); // necessary if some plugin ( Jetpack! ) puts font-family editor stylesheet $body_selector = 'body#tinymce.wp-editor,.mce-content-body'; $put .= aweaver_put_font_family( $body_font_family, $body_selector, ' !important' ); // ** FONT SIZE ** if ( ( $base_font_px = aweaver_getopt( 'site_fontsize_int' ) ) == '' ) { $base_font_px = 16; } if ( $base_font_px != 16 ) { $put .= "body{font-size:{$base_font_px}px;}"; } $base_font_px = ( float) $base_font_px; $font_size = aweaver_get_cascade_opt( '_font_size', 'default' ); $fontmult = aweaver_fontsize_mult( $font_size, 'standard' ); $em_font_size = ( $base_font_px / $base_font_px ) * $fontmult; $put .= "{$selector_font}{font-size:" . $em_font_size . "em;}\n"; // ** FONT STYLE / WEIGHT ** // valusew will be 'on' or 'off' or '', unless checkbox // wrapper_bold, wrapper_italic, container_bold, container_italic, content_bold, content_italic, page_title_italic, page_title_nomral ( weight - checkbox ) // content_h_italic, content_h_nomral ( weight, checkbox ) $font_style = aweaver_get_cascade_opt( '_italic', '' ); if ( $font_style != '' ) { $italic = ( $font_style == 'on' ) ? 'italic' : 'normal'; $put .= "{$selector_font}{font-style:{$italic};}\n"; } $font_style = aweaver_get_cascade_opt( '_bold', '' ); if ( $font_style != '' ) { $italic = ( $font_style == 'on' ) ? 'bold' : 'normal'; $put .= "{$selector_font}{font-weight:{$italic};}\n"; } // ====== BG COLOR ==== /* need to handle bg color of content area - need to do the cascade */ $bg = ''; if ( ( $val = aweaver_getopt_default( 'editor_bgcolor', 'inherit' ) ) && $val != 'inherit' ) { /* alt bg color */ $bg = $val; } elseif ( ( $val = aweaver_getopt_default( 'content_bgcolor', 'inherit' ) ) && $val != 'inherit' ) { /* #content */ $bg = $val; } elseif ( ( $val = aweaver_getopt_default( 'container_bgcolor', 'inherit' ) ) && $val != 'inherit' ) { /* #container */ $bg = $val; } elseif ( ( $val = aweaver_getopt_default( 'wrapper_bgcolor', 'inherit' ) ) && $val != 'inherit' ) { /* #wrapper */ $bg = $val; } elseif ( ( $val = aweaver_getopt_default( 'body_bgcolor', 'inherit' ) ) && $val != 'inherit' ) { /* Outside BG */ $bg = $val; } if ( $bg != '' ) { if ( $editor == 'mce' ) { $put .= "{$selector_bg}{background:{$bg};padding:10px;}\n"; } // 4.0.10 - no padding for gb! else { $put .= "{$selector_bg}{background:{$bg} !important}\n"; } // Version 4.0.1 - moved dark theme to functions.php for .is-dark-theme support } // ==== text color ==== $text_color = aweaver_get_cascade_opt( '_color', 'inherit' ); // text color if ( $val != 'inherit' ) { $put .= ".editor-block-list__layout,{$selector_tr}{color:" . $text_color . ";}\n"; } // Headings - gutenberg only // content_h_font_family // ** header font size ** // content_h_font_size ( font size name ) // ** FONT STYLE / WEIGHT ** // valusew will be 'on' or 'off' or '', unless checkbox // wrapper_bold, wrapper_italic, container_bold, container_italic, content_bold, content_italic, page_title_italic, page_title_nomral ( weight - checkbox ) // content_h_italic, content_h_nomral ( weight, checkbox ) if ( $editor == 'gutenberg' ) { // we will just use the default font size for the headings - not worth it to calcuate 6 sizes here... // ---- bold if ( aweaver_getopt_checked( 'content_h_normal' ) ) // bold off? { $put .= ".wp-block-heading h1,.wp-block-heading h2,.wp-block-heading h3,.wp-block-heading h4,.wp-block-heading h5,.wp-block-heading h6,.mce-content-body h1,.mce-content-body h2,.mce-content-body h3,.mce-content-body h4,.mce-content-body h5,.mce-content-body h6{font-weight:normal;}\n"; } // ---- italic $italic = aweaver_getopt( 'content_h_italic' ); if ( $italic == 'off' ) { $put .= ".wp-block-heading h1,.wp-block-heading h2,.wp-block-heading h3,.wp-block-heading h4,.wp-block-heading h5,.wp-block-heading h6,.mce-content-body h1,.mce-content-body h2,.mce-content-body h3,.mce-content-body h4,.mce-content-body h5,.mce-content-body h6{font-style:normal;}\n"; } elseif ( $italic == 'on' ) { $put .= ".wp-block-heading h1,.wp-block-heading h2,.wp-block-heading h3,.wp-block-heading h4,.wp-block-heading h5,.wp-block-heading h6,.mce-content-body h1,.mce-content-body h2,.mce-content-body h3,.mce-content-body h4,.mce-content-body h5,.mce-content-body h6{font-style:italic;}\n"; } // ---- editor spacing fix-up - not perfect, but closer to reality $put .= ".wp-block-heading h1,.wp-block-heading h2,.wp-block-heading h3,.wp-block-heading h4,.wp-block-heading h5,.wp-block-heading h6{line-height:1;margin-bottom:-.5em;margin-top:0;}\n"; } // ====== PAGE TITLE ( Don't use post values ) ====== // page_title_bgcolor, page_title_color, page_title_font_size, page_title_font_family, page_title_normal ( weight/checkbox ), page_title_italic if ( $editor == 'gutenberg' ) { // Gutenberg shows the page title $font_family = aweaver_getopt_default( 'page_title_font_family', 'inherit' ); $font_style = ''; if ( $font_family != 'inherit' ) { $fonts = aweaver_get_font_family(); if ( isset( $fonts[ $font_family ] ) ) { $font = $fonts[ $font_family ]; $font_style .= "font-family:{$font} !important;"; //$put .= ".edit-post-layout .editor-post-title textarea{font-family:{$font} !important;}\n"; } } $title_color = aweaver_getopt_default( 'page_title_color', 'inherit' ); if ( $title_color == 'inherit' ) { $title_color = aweaver_get_cascade_opt( '_color', 'inherit' ); } $font_style .= "color:{$title_color} !important;"; //$put .= ".edit-post-layout .editor-post-title textarea{color:{$title_color} !important;}\n"; $title_bgcolor = aweaver_getopt_default( 'page_title_bgcolor', 'inherit' ); if ( $title_bgcolor != 'inherit' ) { $font_style .= "background-color:{$title_bgcolor} !important;"; //$put .= ".edit-post-layout .editor-post-title textarea{background-color:{$title_bgcolor} !important;}\n"; } $title_css = aweaver_getopt( 'page_title_bgcolor_css' ); if ( $title_css ) { $font_style .= $title_css; //$put .= ".edit-post-layout .editor-post-title textarea{$title_css}\n"; } $font_size = aweaver_getopt_default( 'page_title_font_size', 'xl-font-size-title' ); $em_fontmult = aweaver_fontsize_mult( $font_size, 'title' ); $em_font_size = ( $base_font_px / 16.0 ) * $em_fontmult; $font_style .= 'font-size:' . $em_font_size . 'em;height:1.8em;'; //$put .= ".edit-post-layout .editor-post-title textarea{font-size:" . $em_font_size . "em;}\n"; if ( aweaver_getopt_checked( 'page_title_normal' ) ) { // bold off? $font_style .= 'font-weight:normal;'; //$put .= ".edit-post-layout .editor-post-title textarea{font-weight:normal;}\n"; } $italic = aweaver_getopt( 'page_title_italic' ); if ( $italic == 'off' ) { $font_style .= 'font-style:normal;'; //$put .= ".edit-post-layout .editor-post-title textarea{font-style:normal;}\n"; } elseif ( $italic == 'on' ) { $font_style .= 'font-style:italic;'; //$put .= ".edit-post-layout .editor-post-title textarea{font-style:italic;}\n"; } // bar under some titles if ( ( $val = ( int) aweaver_getopt( 'page_title_underline_int' ) ) ) { if ( $title_color == '' || $title_color == 'inherit' ) { $title_color = '#222'; } /* if they want a border, this is the fallback color */ $font_style .= "border-bottom: {$val}px solid {$title_color}"; //$put .= ".edit-post-layout .editor-post-title textarea{border-bottom: {$val}px solid {$title_color};}\n"; } $put .= '.edit-post-layout .editor-post-title textarea{' . $font_style . "}\n"; } // End if(). // ====== OTHER ELEMENTS ====== if ( ( $val = aweaver_getopt( 'input_bgcolor' ) ) ) { // input area $put .= 'input, textarea, ins, pre{background:' . $val . ";}\n"; } if ( ( $val = aweaver_getopt( 'input_color' ) ) ) { $put .= 'input, textarea, ins, del, pre {color:' . $val . ";}\n"; } // ====== TABLES ====== /* aweaver_tables */ $table = aweaver_getopt( 'aweaver_tables' ); if ( $table == 'wide' ) { // make backward compatible with 1.4 and before when Twenty Ten was default $put .= "{$content_body}table {border: 1px solid #e7e7e7 !important;margin: 0 -1px 24px 0;text-align: left;width: 100%%;} tr th, thead th {color: #888;font-size: 12px;font-weight: bold;line-height: 18px;padding: 9px 24px;} {$content_body} tr td {border-style:none !important; border-top: 1px solid #e7e7e7 !important; padding: 6px 24px;} tr.odd td {background: rgba( 0,0,0,0.1 );}\n"; } elseif ( $table == 'bold' ) { $put .= "{$content_body}table {border: 2px solid #888 !important;} tr th, thead th {font-weight: bold;} {$content_body}tr td {border: 1px solid #888 !important;}\n"; } elseif ( $table == 'noborders' ) { $put .= "{$content_body}table {border-style:none !important;} {$content_body}tr th, {$content_body}thead th {font-weight: bold;border-bottom: 1px solid #888 !important;background-color:transparent;} {$content_body}tr td {border-style:none !important;}\n"; } elseif ( $table == 'fullwidth' ) { $put .= "table {width:100%%;} tr th, thead th {font-weight:bold;}\n"; } elseif ( $table == 'plain' ) { $put .= "{$content_body}table {border: 1px solid #888 !important;text-align:left;margin: 0 0 0 0;width:auto;} tr th, thead th {color: inherit;background:none;font-weight:normal;line-height:normal;padding:4px;} {$content_body}tr td {border: 1px solid #888 !important; padding:4px;}\n"; } // ====== LISTS ====== if ( ( $val = aweaver_getopt( 'contentlist_bullet' ) ) ) { // list bullet if ( $val != '' && $val != 'disc' ) { if ( $val != 'custom' ) { $put .= "ul {list-style-type:{$val};}\n"; } } } if ( ( $val = aweaver_getopt( 'content_p_list_dec' ) ) ) { // list/paragraph margin if ( $val != '' ) { $put .= "ul, ol, p {margin-bottom:{$val}em !important;}\n"; } } if ( ( $val = aweaver_getopt( 'content_block_margin_T' ) ) ) { // block top if ( $val != '' ) { $put .= "*[class^=\"wp-block-\"]{margin-top:{$val}em !important;}\n"; } } if ( ( $val = aweaver_getopt( 'content_block_margin_B' ) ) ) { // block bottom if ( $val != '' ) { $put .= "*[class^=\"wp-block-\"]{margin-bottom:{$val}em !important;}\n"; } } // ====== images ====== // these work for both tinyMCD and Gutenberg if ( ( $val = aweaver_getopt( 'caption_color' ) ) ) { // image caption, border color, width $put .= ".wp-caption p.wp-caption-text,.wp-caption-dd, figure.wp-block-image figcaption, .wp-block-gallery .blocks-gallery-image figcaption, .wp-block-gallery .blocks-gallery-item figcaption {color:{$val};}\n"; } if ( ( $val = aweaver_getopt( 'media_lib_border_color' ) ) ) { $put .= ".wp-caption, img {background:{$val};}\n"; } if ( ( $val = aweaver_getopt( 'media_lib_border_int' ) ) ) { $caplr = $val - 5; if ( $caplr < 0 ) { $caplr = 0; } $put .= "img {padding:{$val}px;}\n"; $put .= sprintf( ".wp-caption {padding: %dpx %dpx %dpx %dpx;}\n", $val, $caplr, $val, $caplr ); } if ( aweaver_getopt_checked( 'show_img_shadows' ) ) { $put .= 'img {box-shadow: 0 0 2px 1px rgba( 0,0,0,0.25 ) !important;}' . "\n"; } // ======