Thanks to visit codestin.com
Credit goes to github.com

Skip to content

@media only screen and (...) output not compatible with lightningcss #1408

@sumanbh

Description

@sumanbh

Describe the issue

StyleX's output for @media only screen and (max-width: 38em) is incompatible with lightningcss.

In this case, StyleX outputs css with parenthesis around screen (playground):

@media only (screen) and (max-width: 38em){.xfk655p.xfk655p{display:flex}}

which lightningcss does not like (playground):

Unexpected token Ident("only")

This is specifically an issue when using turbopack with Next.js since lightningcss's config is not exposed (so I can't set errorRecovery option to true as a workaround).

Expected behavior

Output shouldn't have parenthesis around screen.

Steps to reproduce

Open links to playground.

Test case

No response

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions