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

Prevent sass deprecation warnings #3615

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

jcushman
Copy link
Contributor

@jcushman jcushman commented Oct 7, 2024

As a bit of housekeeping, this prevents deprecation notices during sass compile from using slash as a division operator and using minus-sign-variable without parens.

As suggested by sass, I did

npm install -g sass-migrator
sass-migrator division static/css/*.scss
sass-migrator strict-unary static/css/*.scss

and then went and cleaned up the changes.

Fun fact for division: these are mostly in an early section of the css that must have an interesting story behind it. There's a bunch of stuff like .col-sm-10by3 { width: 100% * math.div(5, 18); // 10/3 width } that looks like it was copied from bootstrap, modified, and in some cases not currently used. I didn't go down the rabbit hole of figuring out what should be imported from bootstrap or deleted.

Fun fact for unary negation: I believe the rules strict-unary updated were in fact not operating as intended, which of course is why they started printing warnings about them. There's stuff in here like margin: 0 -$grid $double -$grid; which apparently would have been parsed as margin: (0-$grid) ($double-$grid), which I'm sure can't be what the author meant. I arbitrarily chose to have these do what they read like rather than how browsers have been interpreting them, by updating to margin: 0 (-$grid) $double (-$grid);, so at least the authorial intent will be visible if anyone ever goes back to revise. I looked at the affected elements (the single-link menu dropdown, and the link browser item-containers) and they look fine to me.

@jcushman jcushman requested a review from a team as a code owner October 7, 2024 21:24
@jcushman jcushman requested review from rebeccacremona and removed request for a team October 7, 2024 21:24
Copy link
Contributor

@rebeccacremona rebeccacremona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😁 This is such a good one.... we'll never know. Thanks for doing this!

@bensteinberg bensteinberg merged commit 250f240 into harvard-lil:develop Oct 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants