Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font sizes at Frontend vs Editor #70

Open
JohnPixle opened this issue Nov 13, 2023 · 7 comments
Open

Font sizes at Frontend vs Editor #70

JohnPixle opened this issue Nov 13, 2023 · 7 comments

Comments

@JohnPixle
Copy link
Contributor

JohnPixle commented Nov 13, 2023

I remember coming across this one before, and it looks like the font sizes are different in the frontend vs what the user sees in the editor.

You can try it at any page including this one: https://raft.vertisite.cloud/patterns/features/

Here's a magic logic link.

Here at the frontend, let's take the example of the hero heading, which is Huge size and declared as 56pixels.
However in the editor, the font sizes are different:

Screenshot 2023-11-13 at 3 06 34 PM

Why / where are these declarations for Huge and normal sizes?

@HardeepAsrani Let me know if you have any insights!
Thanks!

@JohnPixle JohnPixle added this to the 1.1.0 milestone Nov 21, 2023
@JohnPixle
Copy link
Contributor Author

@HardeepAsrani Hey, whenever you can take a look into this, I have no idea where these font size styles are added.

@HardeepAsrani
Copy link
Member

Hey @JohnPixle, for me it looks same on both end. It's set as default size in the editor which is --huge? We've set it as huge as default for Heading Block: https://github.com/Codeinwp/raft/blob/master/theme.json#L247

And the font sizes are defined here: https://github.com/Codeinwp/raft/blob/master/theme.json#L177-L179

@JohnPixle
Copy link
Contributor Author

@HardeepAsrani Hey, I insist on this one :)

Here is a screenshot from the editor and the frontend (bottom). Reference Page.

Screenshot 2023-11-23 at 12 01 52 PM

The Huge and Normal Sizes are overriden by this code:

@HardeepAsrani
Copy link
Member

Hey @JohnPixle,

It seems the Core defines the variables later than the theme so they're being used when the font size isn't explicitly being defined. And since we use the same slugs as the core, it causes this issue. I tried to see if we can do something to fix it but I couldn't find anything.

I saw the same issue happening on Core themes if we define same names for the variables.

Screenshot 2023-11-24 at 9 05 17 AM

@JohnPixle
Copy link
Contributor Author

@HardeepAsrani oh, that's too bad, but thanks for looking into it.
I assume that if we attempt to change these slugs now, all hell will break loose. I just tried and it did break things, sadly 😭

@JohnPixle JohnPixle removed this from the 1.1.0 milestone Dec 7, 2023
@JohnPixle
Copy link
Contributor Author

Looking into the situation, I will add this to the backlog and see if we can do something about it in the near future.

@HardeepAsrani
Copy link
Member

Hey @JohnPixle

I spent some time here trying to see what we can do, but sadly, not much. Whatever I did, didn't really work. Also one weird thing is that if you use a website with Raft and Otter, this issue doesn't appear. I am assuming Otter isn't the only plugin, might be an issue only if theme is being used without any block libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants