Skip to content

PostCSS Global Data #841

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

Merged
merged 11 commits into from
Feb 7, 2023
Merged

PostCSS Global Data #841

merged 11 commits into from
Feb 7, 2023

Conversation

Antonio-Laguna
Copy link
Member

Fixes #834

This creates a plugin that injects Global Data into the CSS. The plugin only injects nodes into the root to then, once it exits, remove them having allowed other plugins to use this data to generate output.

The tests test it specifically with custom-media and ensures that no rules are staying after it finished

Copy link
Member

@romainmenke romainmenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!

Looking at the simplicity I am a bit surprised that no one created exactly this before now. The feature felt really complex to me because it was always entangled in other plugins.

Antonio-Laguna and others added 2 commits February 6, 2023 23:22
Co-authored-by: Romain Menke <11521496+romainmenke@users.noreply.github.com>
Copy link
Member

@romainmenke romainmenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still awesome!

Left some final comments :)

Copy link
Member

@romainmenke romainmenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@Antonio-Laguna Antonio-Laguna merged commit a2c2268 into main Feb 7, 2023
@Antonio-Laguna Antonio-Laguna deleted the feature/global-data branch February 7, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I'm using Astro. Being able to use importFrom was a big deal. What is the workaround besides not upgrading to postcss-preset-env v8?
2 participants