-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Use math.div instead of slash for sass #9508
Conversation
✔️ Deploy Preview for carbon-react-next ready! 🔨 Explore the source changes: fc2772b 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-react-next/deploys/612e63f3d4bf7d0008bf5e98 😎 Browse the preview: https://deploy-preview-9508--carbon-react-next.netlify.app |
DCO Assistant Lite bot All contributors have signed the DCO. |
✔️ Deploy Preview for carbon-elements ready! 🔨 Explore the source changes: fc2772b 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/612e63f3bda69400070b7d2b 😎 Browse the preview: https://deploy-preview-9508--carbon-elements.netlify.app |
✔️ Deploy Preview for carbon-components-react ready! 🔨 Explore the source changes: fc2772b 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/612e63f3d3f58a0008be5dec 😎 Browse the preview: https://deploy-preview-9508--carbon-components-react.netlify.app |
I have read the DCO document and I hereby sign the DCO. |
Hi there @egriff38! 👋 Thanks so much for the first-time contribution! 🙏 We're so excited that you were able to take the time to make this PR. I think currently @tay1orjones was taking a look at in in our sprint. I think our specific challenge is how to support both One option for this could be that anytime we want to update a file to use |
Hi @joshblack, thanks for the welcome! I'm not familiar with the Besides the fix you mentioned, I'm unaware of any ways to make my change backwards compatible besides just leaving the files as they are and running the division migrator to maintain 2 separate versions (Though that would mean double the stylesheets to test...). I used the migrator for part of my PR and it worked much better than my find and replace to generate the changes. |
@egriff38 I think that's very fair to ask and will try my best to answer, let me know if there is anything else that I can help to clarify!
Unfortunately yes, the majority of teams using Carbon are still using This is where that |
I think I understand what you mean. Do you think there could be some kind of polyfill module/import specifically for division that resolves to |
@egriff38 Thanks for this PR! I took the liberty of riffing on this a bit to see if we could come up with something to satisfy the requirement of supporting
I avoided the idea of a polyfill because it's a bit of a logistical challenge. We'd need to have it available across these various different packages via a new package or copy/pasting the same polyfill in all the different packages. Using separate @joshblack The downside here is that we now have two implementations of the same file that we have to maintain. Worth noting that in v11 that will no longer be the case since we'll be using sass modules in Let me know what you both think - I'm happy to field any questions and improve this further to meet the need. |
@tay1orjones, I definitely understand your reasoning on not using the polyfill, and your changes make sense to me; so long as dart-sass doesn't yell at me when I include the bundles I'll be happy. How soon do you anticipate v11 being published? |
I just pushed another update to clear up some deprecation warnings stemming from the
@egriff38 Totally agree 😄 From my testing we no longer get any dart-sass division deprecation warnings in our own builds. Should have the same impact for you.
Full details and updated timelines can be found in the v11 Release issue. A beta is available and we're aiming to publish a second beta soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For anyone running into the
|
Closes #8746
This PR attempts to replace all instances of sass division by slash with
math.div
. First time contributor 😄Changelog
Changed
*.scss
file slash division$var1 / $var2
over tomath.div($var1, $var2)
@use 'sass:math'
where necessary, below imports.Testing / Reviewing
yarn build
passedyarn lint
passedyarn test
fails, but only for the one line packages/layout/scss/_convert.scss#24. I suspect it may be an issue with node-sass?