Skip to content
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

PostCSS Global Data #841

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.

plugins/postcss-global-data/src/index.ts Outdated Show resolved Hide resolved
plugins/postcss-global-data/test/basic.css Outdated Show resolved Hide resolved
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 :)

plugins/postcss-global-data/docs/README.md Outdated Show resolved Hide resolved
plugins/postcss-global-data/test/examples/example.css Outdated Show resolved Hide resolved
plugins/postcss-global-data/package.json Outdated Show resolved Hide resolved
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
6 checks passed
@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
2 participants