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

Invalid CSS syntax in latest builds #11784

Closed
aaronadamsCA opened this issue Mar 26, 2024 · 9 comments · Fixed by #11917
Closed

Invalid CSS syntax in latest builds #11784

aaronadamsCA opened this issue Mar 26, 2024 · 9 comments · Fixed by #11917
Labels
Bug Something is broken and not working as intended in the system. untriaged

Comments

@aaronadamsCA
Copy link
Contributor

aaronadamsCA commented Mar 26, 2024

Summary

Since Polaris v12.22.0, our app builds fail due to invalid CSS syntax in this package.

This file: https://unpkg.com/@shopify/polaris@12.22.1/build/esm/styles.css

Contains this code:

@media (--p-breakpoints-md-up) and print{
    .Polaris-Frame--hasNav .Polaris-Frame__Main{
        padding-left:0;
    }
      }

Expected behavior

The media query should be something valid, like @media print and (min-width: 10px).

Actual behavior

The invalid media query breaks our CSS preprocessing (example).

Steps to reproduce

No response

Are you using React components?

None

Polaris version number

v12.22.1

Browser

No response

Device

No response

@aaronadamsCA aaronadamsCA added Bug Something is broken and not working as intended in the system. untriaged labels Mar 26, 2024
@bluedge
Copy link

bluedge commented Apr 8, 2024

Any update on this?
We cannot upgrade because of this. We have to stick to 12.20.0

@bluedge
Copy link

bluedge commented Apr 19, 2024

This is still an issue on the last version @shopify/polaris: 13.1.0

kyledurand added a commit that referenced this issue Apr 19, 2024
### WHY are these changes introduced?

Fixes #11784

### WHAT is this pull request doing?

Print css wasn't working here, the nesting was odd. To tophat go to
render settings in dev tools and emulate print media in prod or
storybook.


![image](https://github.com/Shopify/polaris/assets/6844391/3e1b0a53-5dc5-4d94-be83-151003856ae3)

### 🎩 checklist

- [ ] Tested a
[snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases)
- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
@bluedge
Copy link

bluedge commented Apr 19, 2024

We just tried the v13.1.1 it does not seems to fix the issue. @kyledurand

-- inner error --
Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
expected media condition in parentheses.
     ╷
8332 │ @media (--p-breakpoints-md-up) and print{

@kyledurand
Copy link
Contributor

It wasn't included in 13.1.1 because that version needed to ship as a standalone revert. It will be included in the next version which you can follow along with here

@kyledurand
Copy link
Contributor

If you want to test the snapshot that was just created: "@shopify/polaris": "0.0.0-snapshot-20240419190223"

If that works I can ship that as a patch today

@bluedge
Copy link

bluedge commented Apr 19, 2024

@kyledurand Thank you for the clarification. It works fine with 0.0.0-snapshot-20240419190223

@kyledurand
Copy link
Contributor

Thanks all and sorry this took so long. Didn't see the issue til today. v13.1.2 should be out in < 5 mins and your builds should be 🟢

@bluedge
Copy link

bluedge commented Apr 19, 2024

@kyledurand v13.1.2 works great - Thank you!

@RenFraser
Copy link

For anyone else that stumbles across this, I could use v12 by adjusting my webpack config.

I was using the css-loader and sass-loader for css files and sass/scss. After splitting the into two "test" objects, one for css, one for sass/scss and using the respective loaders, the files could be parsed correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system. untriaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants