-
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
Create abstraction for safer math.div
usage
#9857
Comments
This comment patternfly/patternfly#4096 (comment) is essentially what we'd be aiming for. I'm not sure if there's a difference between |
@tay1orjones could we list |
@joshblack Yep, that would be my preference. It sounds like you agree, so I'll close this. For now we'll stick with the conditionals that were added in #9850. In v11 we can remove them. |
…-design-system#9857) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [karma-spec-reporter](https://togithub.com/tmcgee123/karma-spec-reporter) | [`0.0.35` -> `0.0.36`](https://renovatebot.com/diffs/npm/karma-spec-reporter/0.0.35/0.0.36) | [![age](https://badges.renovateapi.com/packages/npm/karma-spec-reporter/0.0.36/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/karma-spec-reporter/0.0.36/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/karma-spec-reporter/0.0.36/compatibility-slim/0.0.35)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/karma-spec-reporter/0.0.36/confidence-slim/0.0.35)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>tmcgee123/karma-spec-reporter</summary> ### [`v0.0.36`](https://togithub.com/tmcgee123/karma-spec-reporter/compare/v0.0.35...v0.0.36) [Compare Source](https://togithub.com/tmcgee123/karma-spec-reporter/compare/v0.0.35...v0.0.36) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "every weekend" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/carbon-design-system/carbon-for-ibm-dotcom). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43MS4wIiwidXBkYXRlZEluVmVyIjoiMzQuNzEuMCJ9-->
Pointed out in #9850,
math.div
is only available in sass>=1.33.0
. The Sass module system was introduced in1.23.0
. So it's possible for projects to be using sass modules, but still not havemath.div
available.For these cases, it makes sense to wrap
math.div
usage in a conditional, usingmath.div
when it's available, otherwise using legacy division:Unfortunately there is not a clean way to ensure this conditional is always used moving forward. Linting has a shortfall - the
stylelint-scss
plugin we use for stylelint rejected the proposal of a rule for no-division.One way we could ensure correct usage would be to:
div(dividend, divisor)
math.div
and legacy division.math.div
is used across various different packages in the monorepo. To facilitate reuse, the helper needs to be published as it's own new package in the monorepo.math.div
is never used directly by disallowing it via Stylelint'sfunction-disallowed-list
rule.math.div
Using math.div is not allowed, please use div() from @carbon/packageName instead
The text was updated successfully, but these errors were encountered: