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

Edge case: property can take coma-separated values #8

Closed
meduzen opened this issue Sep 17, 2021 · 2 comments · Fixed by #9 or #12
Closed

Edge case: property can take coma-separated values #8

meduzen opened this issue Sep 17, 2021 · 2 comments · Fixed by #9 or #12
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@meduzen
Copy link
Owner

meduzen commented Sep 17, 2021

Considering this:

.my-class {
  transition-property: var(--transition-properties, opacity, visibility)
}

This is not possible to get the same result with v() because it will wrap opacity as custom property name (var(--opacity). In this case, v() shouldn’t be used. See next comment. 🤓

@meduzen meduzen added the documentation Improvements or additions to documentation label Sep 17, 2021
meduzen added a commit that referenced this issue Oct 21, 2021
@meduzen
Copy link
Owner Author

meduzen commented Jan 1, 2023

Actually it’s possible by wrapping them in quotes:

.my-class {
  transition-property: v(transition-properties, 'opacity, visibility')
}

@meduzen meduzen reopened this Jan 21, 2023
@meduzen meduzen added the bug Something isn't working label Jan 21, 2023
@meduzen
Copy link
Owner Author

meduzen commented Jan 21, 2023

It turns out the previous example is wrong because it generates:

.my-class {
  transition-property: var(--transition-properties, 'opacity, visibility');
}

As described on MDN (or just before example 12 in the spec), the quotes are not valid.

This should be generated instead:

.my-class {
  transition-property: var(--transition-properties, opacity, visibility);
}

I think there are two futures for this issue:

  1. Mark the multiple fallbacks as unsupported.
  2. Unquote the fallback parameter in such use cases.

I’d rather give a try at option 2 in order to improve the package.

@meduzen meduzen changed the title Document edge case: property can take coma-separated values Edge case: property can take coma-separated values Jan 21, 2023
@meduzen meduzen pinned this issue Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
1 participant