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

Support for Astro.build #812

Open
shellwhale opened this issue Dec 31, 2022 · 2 comments
Open

Support for Astro.build #812

shellwhale opened this issue Dec 31, 2022 · 2 comments

Comments

@shellwhale
Copy link

shellwhale commented Dec 31, 2022

About docs

The docs provide an example to make Geist work with Next.js but not for Astro

Description

I can't figure out how to make Geist work with Astro, there is an example for Next.js but not for Astro.

Page Links (Optional)

https://geist-ui.dev/en-us/guide/installation

@diploidal
Copy link

Hey @shellwhale 👋,
Have You tried this Astro documentation -> https://docs.astro.build/en/guides/integrations-guide/react/ ?

It looks straight forward but I didn't have time to try it out myself.

@unreadabullshit
Copy link

Assuming you've already installed astro's react integration; You can create a default layout for your pages that injects the geist css on the server side, like this:

RootLayout.astro

code

You may notice that this example resembles geist's custom server example, the difference being that i use .flushToHTML() method instead of .flush since they are being injected to a astro component not jsx, also to get the styles to the <head> tag you'll have to use the set:html property because the style tags will be on plain string(<head>{styles}<head/> won't work).

note: I tried creating this RootLayout as a .tsx file as well, but I couldn't get it to work correctly despite supposedly making all the necessary adjustments.

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