Page MenuHomePhabricator

Preview font size has increased in Vector 2022
Open, Stalled, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue

What happens?:

  • The font-size of the Preview is bigger than the normally rendered page

What should have happened instead?:

  • It should look the same.

Screenshot

image.png (1×1 px, 255 KB)

In T321883, @jhsoby wrote:

When editing a page using Vector-2022, the font-size for .vector-body becomes 16px instead of the default 14px. This affects everything in .vector-body, including previews, so that the previews show a bigger font-size than what the page gets when you save it.

According to the browser inspector, there is an inline style .vector-body { font-size: 100%; } which overrides the default font-size: calc(1em * 0.875); I haven't been able to figure out exactly where this inline style comes from, but it is only(?) present when you edit a page, not when you view it.

Related Objects

Event Timeline

Jdlrobson added a subscriber: Jdlrobson.

Doesnt' seem related to anything web team has been doing recently.

Iniquity renamed this task from Preview font size has increased to Preview font size has increased in Vector 2022.Mon, Oct 31, 1:48 PM

@Iniquity It doesn't just increase the preview font size. "This" change caused also the enlargement of all elements of the toolbox and the editor itself on pl wikisoource....

image.png (691×1 px, 122 KB)

image.png (590×1 px, 197 KB)

It looks like a "side effect" of T312963...

Hi @Quiddity

I haven't been able to figure out exactly where this inline style comes from

a user found out that in the preview .vector-body { font-size: 100%; } is the inline style inherited from div#bodyContent, from the embedded stylesheet number 2, line 29.
The default style font-size: calc(1em * 0.875) came from the load.php, line 3421.

The user's detailed explanation is here (in English).

The problem comes from a style ".vector-body{font-size:100%}" coming from an embedded stylesheet, minified and probably generated on the fly by some script. In this stylesheet, it is immediately followed by the styles "vector-feature-limited-width-disabled #wikiPreview,.skin-vector-disable-max-width #wikiPreview{max-width:60em;margin:auto}.vector-feature-limited-width-disabled #wikiPreview .mw-parser-output,.skin-vector-disable-max-width #wikiPreview .mw-parser-output{font-size:0.875em}" which seem to indicate a correlation with the implementation of the limited width. My guess is that the ".vector-body{font-size:100%}" had been introduced because the "max-width" is specified in em, and therefore dependent on the font size. But if I disable this precise rule, the problem disappears and the text width is not affected, so I think this precaution is useless.

Moreover, if I disable the limited width in my preferences, the "font-size:0.875em" (see above) is activated and "restores" the correct font size - but not everywhere ; for example the section titles remain with the incorrect font size. My guess is that somebody had noticed the problem and tried to correct it - but with the wrong CSS selector, so the correction is only partial. Don't blame anybody, this happens all the time.

Hope this might help.

I appreciate the investigation carried out on frwiki :), but some time ago, the closed ticket (T321883 by @jhsoby) indicated where this code came from and what change introduced it:

.vector-body { font-size: 100%;} comes from:
https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/843603/1/skinStyles/mediawiki.action.edit.less

and T312963.
@Samwilson could you look at this?

Thank you for the pointers, and apologies for wasting your time. I had only a browser to investigate, and no experience with your development tools.

What would you think about removing the two font-size specifications and using a CSS calc() function to specify the max-width ? This function seems widely supported, and the example in https://developer.mozilla.org/en-US/docs/Web/CSS/calc even mentions "width: calc(100% - 1em)".

Thank you for the pointers, and apologies for wasting your time. I had only a browser to investigate, and no experience with your development tools.

You got me wrong ... I really appreciate your persistence in finding causes. I just wanted to point out that the source is known.
I am not qualified to restore or change anything in the code, I am only a plws user, where also the change caused the inconsistency.

As any reaction can take time... you can try what plwiki do:
https://pl.wikipedia.org/w/index.php?diff=68607679

that is, temporarily patch it yourself.

Of course I know that a reaction can take time, the devs have many other things to do, and appropriate tests take quite a lot of time. About wasting your time, I just feel guilty for not having read completely (and understood) the references, that's all.

Thank you very much for the patch, I've tried it and it works perfectly well for me. I'll inform frwiki, you will have made many happy contributors.

@Jdlrobson I think this patch https://gerrit.wikimedia.org/r/845655 from T319449 affected. If I switch off 'Enable limited width mode' everything is ok.

Thanks @TheresNoTime for the tip :)

@Jdlrobson I think this patch https://gerrit.wikimedia.org/r/845655 from T319449 affected. If I switch off 'Enable limited width mode' everything is ok.

Thanks @TheresNoTime for the tip :)

I can't actually replicate that any more, so I'm thinking personally I'd forgotten to turn off a style override when testing... in T322337: Using the Vector (2022) theme in conjunction with the realtime preview beta feature makes the font size of the live preview too large. I've narrowed it down to this line, but I think we'd already figured that bit out! 😅

@Jdlrobson I think this patch https://gerrit.wikimedia.org/r/845655 from T319449 affected. If I switch off 'Enable limited width mode' everything is ok.

Thanks @TheresNoTime for the tip :)

I can't actually replicate that any more, so I'm thinking personally I'd forgotten to turn off a style override when testing... in T322337: Using the Vector (2022) theme in conjunction with the realtime preview beta feature makes the font size of the live preview too large. I've narrowed it down to this line, but I think we'd already figured that bit out! 😅

This is very strange because I can reproduce it :)

  1. Go to https://ru.wikipedia.org/wiki/Special:Preferences#mw-prefsection-gadgets
  2. Switch on 'Быстрый предпросмотр без перезагрузки страницы (альтернатива штатной возможности, включаемой на вкладке «Редактирование»)'
  3. Open https://ru.wikipedia.org/w/index.php?title=Крючкоклювы&action=edit
  4. Press button from screen

image.png (568×1 px, 75 KB)

Try to do it with 'Enable limited width mode' on and off (https://ru.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering)

Going to grab this as I'm fairly sure the patch for T322337 will also resolve this

After the last software update the preview text font size has been restored but the edit form and editnotice still have 16px font.

The fonts on preview page have been smaller then normal pages since few days ago on jawiki. I was wondering if you could check it up. thanks!

TheresNoTime changed the task status from Open to Stalled.Wed, Nov 23, 2:20 AM