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

[Question] Root html element font-size affects library offsets calculated in rem #1755

Open
1 task done
socaseinpoint opened this issue Jun 5, 2023 · 12 comments
Open
1 task done
Assignees
Labels
enhancement Something could be made better styling A change in the UI styles

Comments

@socaseinpoint
Copy link

Current Behavior

My web application has an overridden font size on HTML element, this affects the paddings and font size inside the shadow dom created by the library since the calculation of the size of the indents is specified through rem, which always relies on the value on the root element.

The library has the ability to override styles via css variables, so i can fix brocken paddings and font size by using em instead of rem, but there is some values that has no css variables. Can you provide more css variables in this library or suggest any other fix for that problem?

Expected Behavior

No response

Steps To Reproduce

No response

What package is effected by this issue?

@web3-onboard/react

Is this a build or a runtime issue?

Runtime, N/A

Package Version

2.9.0

Node Version

No response

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Anything else?

No response

Sanity Check

  • If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.
@leightkt
Copy link
Contributor

leightkt commented Jun 5, 2023

@socaseinpoint Can you provide a code pen or link to a repo that demos the issue you're having?

@socaseinpoint
Copy link
Author

@taylorjdawson
Copy link
Contributor

@socaseinpoint Is this what you are looking for? Let us know which styles there are missing that you need for you application.

@socaseinpoint
Copy link
Author

this There are many css properties that are defined in rem, and that I can't customize by passing css-custom-properties

Examples:
[packages/co](padding: 1rem;)

@gesquinca
Copy link
Contributor

Hey @socaseinpoint can you apply your font-size to the body element instead of the root html element? This would be the easiest way to resolve on your end.

@gesquinca gesquinca added styling A change in the UI styles enhancement Something could be made better and removed bug Something isn't working labels Jun 8, 2023
@socaseinpoint
Copy link
Author

Rem units allow you to set sizes relative to the root element.
As I understand it's only possible to define font size for rem calculation

@leightkt leightkt mentioned this issue Aug 4, 2023
1 task
@mvdschee
Copy link

I have tried, and it's impossible to get this to work as expected without changing the font-size outside of the web component, it would have been an easy fix if they did keep consistency throughout their whole component by using css variables, but I found 153 cases where they hardcoded a rem value.

a rewrite to pixel would be best in this case.

@zhangxiangqiang
Copy link

Is there any progress on this issue? The style is disordered and cannot be used on the mobile end

@Tobechukwu-fieldlabs
Copy link

Has this issue been resolved?

@Tobechukwu-fieldlabs
Copy link

@socaseinpoint were you able to fix this?

@maverick-n
Copy link

我也遇到了此问题,应该怎么解决

@elbaroudiabderahim
Copy link

https://t.me/c/2205886174/29926### [__](

  • url

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something could be made better styling A change in the UI styles
Projects
None yet
Development

No branches or pull requests