You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix duplicate semicolon in built CSS styles (#13179)
<!--
☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
- Start with a verb, for example: Add, Delete, Improve, Fix…
- Give as much context as necessary and as little as possible
- Open it as a draft if it’s a work in progress
-->
### WHY are these changes introduced?
Fixes#13151 <!-- link to issue if one exists -->
Came across this issue when trying to add tailwind v4 to a Shopify app
template. Tailwind has switched CSS parsers in v4, and the vite plugin
now errors if the app imports the Polaris styles with the error:
```
[plugin:@tailwindcss/vite:generate:serve] Unexpected semicolon
.../node_modules/.pnpm/@Shopify+polaris@12.27.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@shopify/polaris/build/esm/styles.css
```
<!--
Context about the problem that’s being addressed.
-->
### WHAT is this pull request doing?
<!--
Summary of the changes committed.
Before / after screenshots are appreciated for UI changes. Make sure to
include alt text that describes the screenshot.
Include a video if your changes include interactive content.
If you include an animated gif showing your change, wrapping it in a
details tag is recommended. Gifs usually autoplay, which can cause
accessibility issues for people reviewing your PR:
<details>
<summary>Summary of your gif(s)</summary>
<img src="..." alt="Description of what the gif shows">
</details>
-->
This PR removes the semi-colons from the shopify-react mixins which
cause the double semicolons in the final built CSS file. It also removes
the semicolon from the shadow button primary variable from within
polaris-tokens, which was causing an additional duplicate semicolon.
### How to 🎩
- Storybook styling should remain unaffected
- Using the tailwindcss v4 parser should not throw errors
To test with tailwind, you should:
- Go get the latest release of tailwind on GitHub at
https://github.com/tailwindlabs/tailwindcss/releases/ and find the
appropriate one for your operating system. Make sure it is executable if
necessary.
- Write a small input.css file that imports the shopify polaris built
CSS file:
```
@import './build/esm/styles.css';
```
- Parse the file with `./tailwindcss --input input.css --output
output.css`
N.B. It should be possible to recreate the error by parsing the
styles.css before these changes were made (or in a separate existing
project that uses shopify polaris):
```
@import './node_modules/@shopify/polaris/build/esm/styles.css';
```
🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#install-dependencies-and-build-workspaces)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)
### 🎩 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
- [x] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
0 commit comments