Skip to content

[babel-plugin] CSS @layer code containing @property #1071

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

Open
necolas opened this issue May 21, 2025 · 1 comment · May be fixed by #1087
Open

[babel-plugin] CSS @layer code containing @property #1071

necolas opened this issue May 21, 2025 · 1 comment · May be fixed by #1087
Labels
bug Something isn't working

Comments

@necolas
Copy link
Contributor

necolas commented May 21, 2025

Describe the issue

See facebook/react-strict-dom#308 (comment)

Although this appears to be valid CSS, it causes a warning in Expo and may be tripping up some CSS validators. If we don't need the @property code in a layer, it might be a good idea to avoid that for now.

| Warning: Unknown at rule: @property (src/app/stylex.css:16:10):
|   14 |
|   15 |  @layer priority1{
| > 16 | @property --backgroundColor { syntax: "*"; inherits: false;}
|      |          ^
|   17 | @property --opacity { syntax: "*"; inherits: false;}
|   18 | @property --transform { syntax: "*"; inherits: false;}
|   19 | :root, .xxw3bu5{--primary100-x1ud21w4:black;--primary200-x19lv8z8:white;}
| Warning: Unknown at rule: @property (src/app/stylex.css:17:10):
|   15 |  @layer priority1{
|   16 | @property --backgroundColor { syntax: "*"; inherits: false;}
| > 17 | @property --opacity { syntax: "*"; inherits: false;}

Expected behavior

Compatibility with Expo would be improved if @property declarations were not nested inside @layer

Steps to reproduce

See above

Test case

No response

Additional comments

No response

@necolas necolas added the bug Something isn't working label May 21, 2025
@nmn
Copy link
Collaborator

nmn commented May 22, 2025

If we don't need the @Property code in a layer, it might be a good idea to avoid that for now.

I don't think we do. Same with @keyframes and @position-try.

necolas added a commit that referenced this issue May 30, 2025
Not all CSS validators understand @Property, @Keyframes, @position-try
inside @layer.

Fix #1071
necolas added a commit that referenced this issue May 30, 2025
Not all CSS validators understand @Property, @Keyframes, @position-try
inside @layer.

Fix #1071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants