Skip to content

Conversation

@jantimon
Copy link
Contributor

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