[TW5] Font family CSS for the editor not working

115 views
Skip to first unread message

mondayrobot

unread,
Jan 5, 2017, 9:45:51 AM1/5/17
to TiddlyWiki
Do you guys have any ideas how can I change the editor font? Until the last version it was simple, just adding the right CSS for the tc-edit-texteditor class in my stylesheet, but now it's not working anymore (I just started using the last TW5 version). Other text areas with the same CSS code work just fine (ex tags, search).

Thanks !

Mark S.

unread,
Jan 5, 2017, 10:16:08 AM1/5/17
to TiddlyWiki
Is there some particular font property not coming across? I see there's a lot of local "style" tags which might override the class in some cases. In my quick test, everything was obedient to tc-edit-texteditor except line height. I could force that with ! important.

Maybe try ! important on the properties you want ?

Good luck!
Mark

mondayrobot

unread,
Jan 6, 2017, 6:01:26 AM1/6/17
to TiddlyWiki
Hey Mark, thanks for the advice.

Tried it with !important, but it didn't work.

I finally managed to isolate the problem, it seems that in the last version I can't use embedded fonts for the editor (other classes are fine). System fonts work, so as a backup solution I installed the font I wanted to use and changed the stylesheet.

Thanks again !

Jeremy Ruston

unread,
Jan 6, 2017, 8:00:01 AM1/6/17
to tiddl...@googlegroups.com
Hi MondayRobot

The new text editor with the toolbar embeds the underlying <textarea> in an iframe; this is necessary to prevent clicks on the toolbar from stealing focus from the text editor. To handle styling, the system creates a dummy, hidden textarea and then copies all of the styles to the embedded textarea.

As you’ve discovered, that process doesn’t take into account custom fonts that are available in the main page, but unavailable in the iframe.

So, right now, if you want to use a custom font you’ll have to disable the new editor (there’s a checkbox in “Settings” in control panel).

Best wishes

Jeremy

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a4dc0008-602f-4222-9f7c-0c6ee0929027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages