Nick Ginanto
Nick Ginanto

Reputation: 32130

how to use tinymce content.css in rails

I need to provide tinymce a css file to take the styles from, but if I set in any file something like

body{
    font-size: 14px;
}

it will set the webapp's body to that style and not only tinymce's input box.

How do I give tinymce a content.css file with the asset pipeline involved?

Upvotes: 1

Views: 2067

Answers (1)

Nick Ginanto
Nick Ginanto

Reputation: 32130

the proper format for this is to write

body.mceContentBody {
    font-size: 14px;

}

or in TinyMCE 4.x (class name changed)

body.mce-content-body {
    font-size: 14px;
}

and the tinymce (if using the gem) should be

<%= tinymce :content_css => asset_path('application.css')%>

Upvotes: 9

Related Questions