Skip to content

Conversation

@S8A
Copy link

@S8A S8A commented Feb 13, 2025

This PR modifies the plugin to register the hook on the :post_write event of the :site, instead of the :post_write event of the :pages, to make sure that PostCSS processing is executed after the whole site is written to disk.

Previously, when using Tailwind CSS, for example, several classes would not be detected and added to the output CSS on first build because the source CSS file was processed in between the rest of the pages of site, so the subsequent pages would have missing styles, thus requiring two build steps to deploy to GitHub Pages. With these changes, CSS files marked with Front Matter are processed by this plugin after the whole site is written to disk, which ensures that all Tailwind CSS classes are detected, processed, and added to the output file. These fixes should fix similar problems with other PostCSS plugins but I haven't tested that.

I think this should close issue #2

Thanks to @bglw for creating this plugin. Hope you have some spare time to review and approve this PR.

S8A added 2 commits February 13, 2025 11:28
To process CSS only after generating all the pages of the site
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

Successfully merging this pull request may close these issues.

1 participant