You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me give an example to explain why lifecycle hooks are needed in Tailwind.
First, I used the Tailwind plugin to integrate Material Symbols, allowing users to render the corresponding icons using classes like msi-face.
After that, I traversed the syntax tree of the tailwind.css file using a CSS parser and identified all the class-selectors starting with msi- (along with some CSS variants used, which I’ll omit here).
Next, I used the clipping API provided by font.googleapis to extract the used Material Symbols, removing the unused icons (since Material Symbols is a large file).
Although I can develop lifecycle hooks in Vite, Rollup, or esbuild, this always feels like a strange behavior. My plugin mainly relies on the output from Tailwind, so if Tailwind itself could provide lifecycle hooks, it would be the most intuitive for development and could help avoid the complexity of the plugin system (especially since in Vite, the serve and build modes are different, which often confuses me).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Let me give an example to explain why lifecycle hooks are needed in Tailwind.
msi-face
.tailwind.css
file using a CSS parser and identified all the class-selectors starting withmsi-
(along with some CSS variants used, which I’ll omit here).font.googleapis
to extract the used Material Symbols, removing the unused icons (since Material Symbols is a large file).Although I can develop lifecycle hooks in Vite, Rollup, or esbuild, this always feels like a strange behavior. My plugin mainly relies on the output from Tailwind, so if Tailwind itself could provide lifecycle hooks, it would be the most intuitive for development and could help avoid the complexity of the plugin system (especially since in Vite, the
serve
andbuild
modes are different, which often confuses me).Beta Was this translation helpful? Give feedback.
All reactions