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: is It SSR Ready ? #1

Closed
kiuKisas opened this issue Apr 16, 2021 · 4 comments
Closed

Question: is It SSR Ready ? #1

kiuKisas opened this issue Apr 16, 2021 · 4 comments

Comments

@kiuKisas
Copy link

Hi, thank's for this port, probably gonna use it on my project :)
However, I was wondering if it's SSR ready ?
By that, I mean calculating the font-size during SSR but having a pre-calculate fixed size on client side
I'll give a try anyway, just wanted to ask before.
If not, do you have an idea of the effort to make it compatible ? Depending on that, I can take time to make a PR if needed (as I plan to use it on my project)

@kiuKisas
Copy link
Author

kiuKisas commented Apr 16, 2021

You should replace '=' by ':' in your examples btw

@micha-lmxt
Copy link
Owner

Thanks, I updated the readme file.

Regarding SSR, I must say that I don't know. I'd guess that actions are not executed at the server level, but if so, it would fail, since the window object is used.

@kiuKisas
Copy link
Author

Yeay, I understand later that it was a dumb question since it really on the DOM.. Sorry for this useless issue ^^

@retani
Copy link

retani commented Jul 18, 2022

I can confirm that it doesn't work in svelte kit. Here is an example repository: https://github.com/retani/-svelte-textfit-issue

Reproduce:

npm create svelte@latest fit
npm i svelte-textfit
  • copy example to src/routes/index.svelte

I tried to wrap it in onMount and use browser variable from $app/env, but didn't succeed.

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

3 participants