-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
toolbar using REM can cause a problem #20099
Comments
I spent a lot of time looking into this today and I'm not sure there's anything we want to do here. What I'd really love is our own custom CSS unit e.g.
This might come to CSS in the future but the issue is stagnating for now. Because shadow doms inherit colors & font sizes we have no way of overriding the Have we ever considered inserting the toolbar as an iframe rather than a shadow dom? I don't know how possible that is if it needs to interact with elements on the page but it would isolate the styles |
Sadly we don't have access to the contents of the iframe in this case. Could we just switch all of posthog to use pixels instead? We have an immutable 1:1 mapping between pixels and rem-s, so why not update the tailwind config to just output pixels instead? |
I don't have much context on why we use Maybe @Twixes knows more since he did the work on Tailwind? |
|
Sounds good 👍 I think the only thing that wouldn't account for is custom CSS used in the shared Lemon components. |
the 😈 approach would be when toolbar starts it checks if the font-size < 8px and logs a warning that it might be invisible then we hope that very few people set font-size smaller on their sites only 50% joking |
A customer reported they have font-size set to 1px on their site to make rem calculations easier in their CSS https://posthoghelp.zendesk.com/agent/tickets/9837
Since we use rem in posthog, and toolbar shares styling with posthog, toolbar picks up the font-size from html...
On that customers site that meant the toolbar was 16x smaller than normal
We need to either
The text was updated successfully, but these errors were encountered: