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

Add support for global() function in CSS Modules animation names #860

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jantimon
Copy link

lightningcss localalizes animations for css modules with quite well - for example

Input:

  animation: baz 2s;

Output:

  animation: EgL3uq_baz 2s;

However in some cases we were running into issues with animation names getting localized when we didn't want them to. This is problamatic when using third-party animation libraries or sharing animations across components.

For selectors there is the :global specifier so we added support for a global() function that can be used directly in animation properties to match with postcss-modules-local-by-default: css-modules/postcss-modules-local-by-default#76

Input:

  animation: global(baz) 2s;

Output:

  animation: baz 2s;

The current solution handles the global function in properties/custom.rs but I'm open to moving it if there's a better spot for this logic

Please let me know what you think

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