Equal styling in edit modus.

About the template and stylesheet - and changing the menu
Post Reply
Tata
Posts: 2716
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Equal styling in edit modus.

Post by Tata » Mon Apr 03, 2017 5:38 pm

I can't find the reason why the font-size in edit modus doesn't keep the same size like in preview or after login.
I have in template

Code: Select all

<body <?php echo onload();?>>
<div class="body">
     <div class="wrapper">
          <div class="main">
          <div class="content">    
          ...
and

Code: Select all

body{...
font-size: 1rem;}
in stylesheet.
After logging in the font in the editor is about 75% of the font-size set in body selector.

EDIT:
I managed to make to font about the same size like in preview only via adding

Code: Select all

 font-size: 85%;
in tinyMCE content.css body.
I don't consider this to be the right way.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 12649
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Equal styling in edit modus.

Post by cmb » Mon Apr 03, 2017 9:39 pm

Tata wrote:I can't find the reason why the font-size in edit modus doesn't keep the same size like in preview or after login.
[…]

Code: Select all

body{...
font-size: 1rem;}
`rem` refers to the the font-size of the root element (i.e. <html>). It is possible that this is different for TinyMCE's editor contents.
Tata wrote:[…] in tinyMCE content.css body.
I don't consider this to be the right way.
It is certainly not the best idea to modify TinyMCE's stylesheets directly. I suggest you try to work around that by adding rules for body and .body in the template's stylesheet. .body applies only to the actual page, body applies to the page as well as to the editor.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

Tata
Posts: 2716
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Equal styling in edit modus.

Post by Tata » Mon Apr 03, 2017 10:16 pm

Well.
I have found the fault. I have two files in the template.
stylesheet.css with classes to be shown in enditor style list and the rest in another CSS file referenced directly in template.htm. I fiddled with settings only in the other CSS file. Now, adding the classes into the stylesheet.css, everything works. fine.
Thank you for the hint, Chris.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Post Reply