spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
815 stars 256 forks source link

Unable to change editor default font-size #198

Closed onebree closed 8 years ago

onebree commented 8 years ago

Edit - I trashed the original body of this issue, as I was looking at the wrong configuration option.

By default, the editor's input text is 11pt, but I want it to be 14pt (to match the default in Bootstrap). I tried the following methods, but neither of them worked. In both cases, I used //=require tinymce in my application.js.

I tried calling the following in my application.scss file, but it did not do anything

#tinymce.mce-content-body {
  font-size: 14px;
}
onebree commented 8 years ago

Closing the issue -- I found out how to do it without touching a style sheet

http://stackoverflow.com/a/21770878/3373470

toolbar:
  - undo redo | styleselect | bold italic underline | bullist numlist outdent indent | link image table
plugins:
  - image
  - link
  - table
menubar: false
statusbar: false
setup :
  function(ed) {
    ed.on('init', function() {
      this.getDoc().body.style.fontSize = '14px';
    });
  }