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

Expand comma separated selectors to maintain specificity #129

Merged
merged 2 commits into from
Nov 29, 2022
Merged

Expand comma separated selectors to maintain specificity #129

merged 2 commits into from
Nov 29, 2022

Conversation

brandongregoryscott
Copy link
Contributor

Resolves #124

One thing to note about this implementation is the lack of any sanitization/trimming of each "part" of the selector. This means the whitespace that is before a selector will be maintained - [data-foo] is not the same as [data-foo]. I originally implemented it in a way that would trim each part, but that approach seemed a little too opinionated (and isn't what glamor does anyway). So the example in the issue should actually be slightly tweaked to have the space removed for the intended effect:

const animationStyles = {
-  '&[data-state="entering"], &[data-state="entered"]': {
+  '&[data-state="entering"],&[data-state="entered"]': {
    animation: `${openAnimation} ${ANIMATION_DURATION}ms ${animationEasing.spring} both`
  }
}

@brandongregoryscott brandongregoryscott merged commit ef1cbea into segmentio:master Nov 29, 2022
@brandongregoryscott brandongregoryscott deleted the support-comma-separated-selectors branch November 29, 2022 15:18
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.

Support for multiple selectors in one key
2 participants