WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to preserve editor style css? (11 posts)

  1. roiabrazaldo
    Member
    Posted 7 months ago #

    I am using reset.css on my style.css, thus this also affects the editor.
    it affects the editor in a way that, what you format while "editing"/"writing" a content, would not show exactly as that on the actual page.

    is there a way to preserve the css for editor?

  2. roiabrazaldo
    Member
    Posted 7 months ago #

    or do you guys use reset.css?

  3. stephencottontail
    Member
    Posted 7 months ago #

    You can use editor styling to affect how the post edit screen appears. All you need to do is call add_editor_style with the path to a stylesheet as the only argument. Usually you would call it in functions.php.

  4. roiabrazaldo
    Member
    Posted 7 months ago #

    so i really need to call the editor.css again?

  5. stephencottontail
    Member
    Posted 7 months ago #

    Probably. I'm having a bit of trouble envisioning what's going on. Do you call reset.css from your style.css using something like @import?

  6. roiabrazaldo
    Member
    Posted 7 months ago #

    its not working..

    I added this lines:

    function preserve_editor() {
        add_editor_style( home_url( '/' ) + '/wp-includes/css/editor.css' );
    }
    add_action( 'init', 'preserve_editor' );

    still not working.

  7. stephencottontail
    Member
    Posted 7 months ago #

    You don't need the / in home_url, and also use . to concatenate strings instead of +.

  8. roiabrazaldo
    Member
    Posted 7 months ago #

    Yes..

    my style.css :

    @import reset
    @import transition
    @import hover
    
    so on..
  9. roiabrazaldo
    Member
    Posted 7 months ago #

    btw.. im not trying to edit the looks of "post edit screen".
    im trying to preserve what is was and what its content looks like, even after applying reset.css

    example
    the default css for blockqoute shown by editor is, it has padding..
    what I see in the actual page is also has padding..

    the problem comes when I apply reset.css

    the blockqoute on editor has padding, but in the actual page, its unformated. it has blockqoute tags, but no padding, because the reset.css overrides it.

    so is there a way to preserve what the editors showing me to the actual page?

    or the editor is the one that needs to adjust?

  10. roiabrazaldo
    Member
    Posted 7 months ago #

    nvm.. i give this one up..

    Im gonna use

    http://html5reset.org/

  11. roiabrazaldo
    Member
    Posted 7 months ago #

    ok, solution to this is use normalize instead.

    the tinymce content.css is initiated before the reset.css thats why it is initialized back to 0. everything.

Reply

You must log in to post.

About this Topic