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

Embed Clerk React components to site with root's element font-size 1px; #633

Closed
visortelle opened this issue Dec 24, 2022 · 3 comments
Closed
Labels

Comments

@visortelle
Copy link

visortelle commented Dec 24, 2022

Hi!

For our site we have the following global CSS:

:root, 
:host {
  font-size: 1px;
}

We do it to use clear sizes like 12rem, 18rem, 24rem in our styles. We don't want to sit with a calculator for 0.35rem, 0.68rem, etc.

This is how <UserProfile /> component looks on our page.

Screenshot 2022-12-24 at 9 33 53 AM

I'm not CSS pro, but probably you can consider switching to custom units like those described here:
w3c/csswg-drafts#7613
w3c/csswg-drafts#7379

I mean something like:

:root {
  --cl-px: 1rem; /* Your customer can override this variable in his code. */
}

/* In your code it could look like it. */
.cl-card {
  max-width: calc(320 * var(--cl-px));
}

This way you can don't worry anymore that some customers for some reason use non-16px rems.

If you know a less ugly way to fix it on our side, please tell me.

Now we'll just spend a couple of hours rewriting our CSS to px. Not a big deal for the current project, but it would be great if we could use Clerk React components in other projects without rewriting our styles.

Thank you.

@clerk-cookie
Copy link
Collaborator

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@clerk-cookie
Copy link
Collaborator

This issue was closed because it has been stalled for 10 days with no activity.

@clerk-cookie clerk-cookie closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2023
@clerk-cookie
Copy link
Collaborator

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@clerk clerk locked as resolved and limited conversation to collaborators Jun 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants