Make WordPress Core

Ticket #25563: 25563.DRAFT.diff

File 25563.DRAFT.diff, 1.7 KB (added by celloexpressions, 11 years ago)

Apply the custom accent color to the TinyMCE editor. Need to determine an action to hook into for this, so patch won't work but is nearly code-complete.

  • wp-content/themes/twentyfourteen/editor-style.css

     
    282282        outline: 0;
    283283}
    284284
     285::-moz-selection {
     286        background: #24890d;
     287}
     288
     289::selection {
     290        background: #24890d;
     291}
     292
    285293/**
    286294 * 5.0 Alignment
    287295 * ----------------------------------------------------------------------------
  • wp-content/themes/twentyfourteen/inc/customizer.php

     
    212212
    213213        wp_add_inline_style( 'twentyfourteen-style', $css );
    214214}
    215 add_action( 'wp_enqueue_scripts', 'twentyfourteen_customizer_styles' );
    216  No newline at end of file
     215add_action( 'wp_enqueue_scripts', 'twentyfourteen_customizer_styles' );
     216
     217/**
     218* Outputs the custom accent color CSS for the editor.
     219*/
     220function twentyfourteen_customizer_editor_styles() {
     221        $accent_color = get_theme_mod( 'accent_color' );
     222        $accent_much_lighter = get_theme_mod( 'accent_much_lighter' );
     223       
     224        echo '<style type="text/css">
     225                a, a:vistited {
     226                        color: ' . $accent_color . ';
     227                }
     228                a:hover, a:focus {
     229                        color: ' . $accent_much_lighter . ';
     230                }
     231                ::-moz-selection {
     232                        background: ' . $accent_color . ';
     233                }
     234                ::selection {
     235                        background: ' . $accent_color . ';
     236                }
     237        </style>';
     238}
     239add_action( 'some_action_related_to_tinymce', 'twentyfourteen_customizer_editor_styles' );
     240 No newline at end of file