Open amerzad opened 4 years ago
SSG is supported with global css. So no problem there. AMP on the other hand is a completely different story as it doesn't allow external CSS at all. See https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/style_pages/.
@benbender Do you mean that example can be used as it is for SSG?
Anyway, I was successful in using Tailwind with both SSG and AMP but with some low DX, but not with the same way done in the example.
The example in this repo is very outdated. As its using next 9.2 and SSG was introduced in 9.3 it can't be used as it is.
But tailwind and SSG have no direct reference or dependency on each other. You are statically generating HTML with SSG - which may or may not contain a reference to a CSS-file which may or may not be generated by tailwind. This HTML is sent to your browser. Thats it.
For AMP: you may be able to generate AMP-pages with tailwind in it - But they most likely won't be valid AMP.
@benbender Thanks for your input. For the Tailwind and AMP, I can confirm that you can pretty well do a valid AMP with Tailwind if you just used the base and the utilities and forgot about the components, which are not needed with AMP for most of the cases.
And I think you confirm that the example is outdated, so, what is the process to update it with something official from Next.js team? Isn't it enough what I did of filing this issue?
I think including the main css in _app.js does not support AMP nor SSG. Any other example which can work completely right with Next.js?