Skip to content

TailwindCSS not working with AMP #1310

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

Closed
jerriclynsjohn opened this issue May 3, 2021 · 4 comments
Closed

TailwindCSS not working with AMP #1310

jerriclynsjohn opened this issue May 3, 2021 · 4 comments
Labels
bug Something isn't working help wanted PRs welcomed. The implementation details are unlikely to cause debate
Milestone

Comments

@jerriclynsjohn
Copy link

jerriclynsjohn commented May 3, 2021

Describe the bug
When I turn on the amp option in the config, the tailwindcss stops working and I'm guessing that's because of the AMP requirement to have styles either inline or in the head.

To Reproduce
Here is a sample repo with the AMP option turned on and also with Tailwind JIT

Expected behavior
Would absolutely love it if tailwind classes could be mentioned in head

Severity
Our entire project is built using tailwind and wanted to use AMP pages for our content and now literally all our pages have no styles because of this.

@babichjacob
Copy link
Member

It seems like you've missed providing the repo link. Also, why exactly is Tailwind relevant? Isn't it just any external stylesheet will be ignored for AMP?

@jerriclynsjohn
Copy link
Author

jerriclynsjohn commented May 3, 2021

I was hoping there could be a way for the svelte kit to emit CSS of a page and then add that to the header like mentioned here https://www.storyblok.com/tp/tailwindcss-express-js-amp-sites. Also edited to add the link to the repo. If you see the AMP documentation they have mentioned how they use a pre-processor to add the CSS necessary for the page using templating language https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/style_pages/#using-css-preprocessors

This is pretty much applicable for any css preprocessors

@jerriclynsjohn
Copy link
Author

Any idea on how to get this working.

@Rich-Harris Rich-Harris added this to the whenever milestone Apr 23, 2022
@Rich-Harris Rich-Harris added bug Something isn't working help wanted PRs welcomed. The implementation details are unlikely to cause debate labels Apr 23, 2022
@mrkishi
Copy link
Member

mrkishi commented May 22, 2022

I just confirmed this is no longer an issue, at least since #4710.

Following the directions in the docs and installing Tailwind normally yields in properly inlined CSS.

@mrkishi mrkishi closed this as completed May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted PRs welcomed. The implementation details are unlikely to cause debate
Projects
None yet
Development

No branches or pull requests

4 participants