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

The styles are not being applied for non-p tags #23

Open
hero9991 opened this issue Feb 27, 2022 · 9 comments
Open

The styles are not being applied for non-p tags #23

hero9991 opened this issue Feb 27, 2022 · 9 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@hero9991
Copy link

The styles are not being applied for non-p tags.

Screenshot 2022-02-27 at 16 49 56

I deal with it by explicit style changes using useEffect, but I believe it's not so effective:

Screenshot 2022-02-27 at 16 55 28

@altmshfkgudtjr
Copy link
Owner

Oh let's check it out!

@codeporan
Copy link

@altmshfkgudtjr is this issue fixed?

@altmshfkgudtjr
Copy link
Owner

@altmshfkgudtjr is this issue fixed?

Not Yet

@altmshfkgudtjr
Copy link
Owner

@hero9991

I need more information.

Is there a value to set font-size among the tag styles in the photo shown as an example?

@hero9991
Copy link
Author

@altmshfkgudtjr

Sorry I haven't been online for a while.

Yes, I found that there is a class which applies some styles, as shown below:
.text_1 {
font-size: 1.33333em; // when I disable this option, the font size is corrected
line-height: 1.2;
}

@altmshfkgudtjr
Copy link
Owner

This is the part I have been thinking about since making the library!

In fact, tags such as <p>, <span>, <h1>, and <h2> vary depending on how they are made, so it is difficult to apply the font size to all tags at once.

So, currently, it is applied only to the p tag, but I am thinking about applying the style to the HTML document.

However, if you do that, you can usually adjust the font size in %, em, or rem units, but it will be difficult to adjust it to exactly a few px.

Which one is the better choice?

@hero9991
Copy link
Author

hero9991 commented Apr 3, 2022

If I understand correctly, you propose as a solution to set the main font-size to HTML document and adjust it for different tags in relative units.
Sounds good to me, but I have one concern. I'm not so familiar with EPUB books and don't know how they are made (what kind of tags are used and for what purposes). So, if we could apply the correct font-size for text, title and so onб it would be excellentб even if it would be in relative units.

@altmshfkgudtjr
Copy link
Owner

I agree. 👍

In my opinion, it is ideal to specify the main font size in the HTML document, and each tag has a relative font size!
I think there's a reason Epub creators use absolute units like px. However, I am still confused. It is necessary to discuss how the policy of react-epub-viewer should be set.

For example, it is currently implemented so that the px value can be adjusted, but in the future, it may be necessary to allow the font size to be adjusted with a relative value rather than the px value.

We need your opinion on which one will give the user a more optimal experience.

@hero9991
Copy link
Author

I agree as well.
The option with relative font sizes is totally fine. 👌

@altmshfkgudtjr altmshfkgudtjr added the enhancement New feature or request label Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Development

No branches or pull requests

3 participants