Skip to content

fix(bootstrap-utilities): update sass in bootstrap utilities files #68#93

Open
airikej wants to merge 2 commits intorcfrom
fix/68-resolve-deprecation-warnings-due-to-sass-upgrade
Open

fix(bootstrap-utilities): update sass in bootstrap utilities files #68#93
airikej wants to merge 2 commits intorcfrom
fix/68-resolve-deprecation-warnings-due-to-sass-upgrade

Conversation

@airikej
Copy link
Copy Markdown
Contributor

@airikej airikej commented Apr 17, 2026

Summary by CodeRabbit

  • Refactor
    • Modernized Sass conditional expressions across utility functions for improved code consistency and maintainability.

@airikej airikej linked an issue Apr 17, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

Warning

Rate limit exceeded

@airikej has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 45 minutes and 11 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 45 minutes and 11 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: febb3803-7ddc-42b0-b54c-4e0c74743c54

📥 Commits

Reviewing files that changed from the base of the PR and between 61c72ae and c6c7d6c.

📒 Files selected for processing (1)
  • src/bootstrap-utility/_mixin-utilities.scss
📝 Walkthrough

Walkthrough

This pull request modernizes Sass syntax across three utility files by replacing deprecated if() function calls with the new ternary-style conditional syntax using sass() wrappers. The changes apply to breakpoint functions, grid mixins, and utility mixins without altering functional behavior.

Changes

Cohort / File(s) Summary
Sass Conditional Syntax Modernization
src/bootstrap-utility/_breakpoints.scss, src/bootstrap-utility/_grid.scss, src/bootstrap-utility/_mixin-utilities.scss
Converted deprecated if() expressions to explicit sass() wrapping with ternary-style if(...): ...; else: ... branching throughout breakpoint functions, grid mixins, and utility mixin logic. All conditional evaluations updated for consistency with modern Sass syntax standards.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • Resolve deprecation warnings due to sass upgrade #68: This PR directly addresses the Sass if() deprecation fixes across the same files (_breakpoints.scss, _grid.scss, and related utility functions), implementing the modernization to sass() ternary syntax as specified in that issue.

Poem

🐰 Sass hops to new syntax with glee,
Old if() calls now dance wild and free,
With sass() ternary bounds so tight,
Our bootstrap utilities take flight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating Sass usage in Bootstrap utilities files to fix deprecation warnings from a Sass upgrade.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/68-resolve-deprecation-warnings-due-to-sass-upgrade

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@airikej
Copy link
Copy Markdown
Contributor Author

airikej commented Apr 17, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/bootstrap-utility/_mixin-utilities.scss (1)

1-95: ⚠️ Potential issue | 🟠 Major

Add minimum Dart Sass version constraint for consumers.

The code now uses if(sass(...): ...; else: ...) syntax which requires Dart Sass 1.95.0+. This minimum version needs to be communicated to library consumers via:

  1. Add "sass": "^1.95.0" to peerDependencies in package.json
  2. Update the engines field in package.json to include the Sass version requirement
  3. Document the minimum Sass version in README

Currently, Sass is only in devDependencies and the requirement is not documented anywhere, which means consumers could use incompatible versions and encounter compilation failures.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bootstrap-utility/_mixin-utilities.scss` around lines 1 - 95, The mixin
generate-utility uses the new if(sass(...): ...; else: ...) syntax (see
occurrences of if(sass(...)) in _mixin-utilities.scss), so add a peer dependency
"sass": "^1.95.0" to package.json, update package.json.engines to include a Sass
requirement (e.g. "sass": ">=1.95.0"), and document the minimum Dart Sass
version (Dart Sass 1.95.0+) in the README; ensure Sass remains in
devDependencies for development but communicate the peer requirement to
consumers to avoid compilation failures.
🧹 Nitpick comments (1)
src/bootstrap-utility/_mixin-utilities.scss (1)

33-33: Consider extracting the inner conditional for readability.

The nested if() syntax is valid and fully supported by Dart Sass—the inner semicolon correctly stays within parentheses. However, the line is complex and hard to parse at a glance. Extracting the inner condition into a temporary variable improves maintainability:

♻️ Suggested readability refactor
-    $property-class-modifier: if(sass($key): if(sass($property-class == '' and $infix == ''): ''; else: '-') + $key; else: '');
+    $separator: if(sass($property-class == '' and $infix == ''): ''; else: '-');
+    $property-class-modifier: if(sass($key): $separator + $key; else: '');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bootstrap-utility/_mixin-utilities.scss` at line 33, Extract the complex
nested if() inside the $property-class-modifier assignment into a temporary
variable to improve readability: compute the inner expression that currently
reads if(sass($property-class == '' and $infix == ''): ''; else: '-') + $key (or
the entire sass($key): ... branch as appropriate) into a clearly named local
variable (e.g. $property-class-suffix or $key-suffix) and then use that variable
inside the $property-class-modifier expression; update references to $key and
the sass() checks (the symbols $property-class-modifier, $property-class,
$infix, $key and sass()) so the original logic is preserved but the outer
assignment becomes a simple composition of the temp variable and $key.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/bootstrap-utility/_mixin-utilities.scss`:
- Line 41: The current Sass if() call sets $value to null unconditionally
because the else branch is missing; change the expression in the assignment that
uses if(sass($val == rfs-fluid-value($value)) ...) so it returns null when true
but returns the original $value when false (restore the three-argument form),
ensuring $value remains non-null when appropriate and allowing the subsequent
`@if` $value != null guard to work correctly.
- Line 76: The `@each` $pseudo in $state block uses the bare variable
$enable-important-utilities which is defined in the vars module; update that
usage to reference the namespaced variable (vars.$enable-important-utilities) so
it matches the import and avoids an undefined variable error—search for the
$enable-important-utilities use inside the `@each` $pseudo in $state block and
replace it with vars.$enable-important-utilities to match the pattern used
elsewhere (e.g., the existing line that uses vars.$enable-important-utilities).

---

Outside diff comments:
In `@src/bootstrap-utility/_mixin-utilities.scss`:
- Around line 1-95: The mixin generate-utility uses the new if(sass(...): ...;
else: ...) syntax (see occurrences of if(sass(...)) in _mixin-utilities.scss),
so add a peer dependency "sass": "^1.95.0" to package.json, update
package.json.engines to include a Sass requirement (e.g. "sass": ">=1.95.0"),
and document the minimum Dart Sass version (Dart Sass 1.95.0+) in the README;
ensure Sass remains in devDependencies for development but communicate the peer
requirement to consumers to avoid compilation failures.

---

Nitpick comments:
In `@src/bootstrap-utility/_mixin-utilities.scss`:
- Line 33: Extract the complex nested if() inside the $property-class-modifier
assignment into a temporary variable to improve readability: compute the inner
expression that currently reads if(sass($property-class == '' and $infix == ''):
''; else: '-') + $key (or the entire sass($key): ... branch as appropriate) into
a clearly named local variable (e.g. $property-class-suffix or $key-suffix) and
then use that variable inside the $property-class-modifier expression; update
references to $key and the sass() checks (the symbols $property-class-modifier,
$property-class, $infix, $key and sass()) so the original logic is preserved but
the outer assignment becomes a simple composition of the temp variable and $key.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b324994d-98e5-43d3-8a20-8df741817c4d

📥 Commits

Reviewing files that changed from the base of the PR and between 28413b0 and 61c72ae.

📒 Files selected for processing (3)
  • src/bootstrap-utility/_breakpoints.scss
  • src/bootstrap-utility/_grid.scss
  • src/bootstrap-utility/_mixin-utilities.scss

Comment thread src/bootstrap-utility/_mixin-utilities.scss Outdated
Comment thread src/bootstrap-utility/_mixin-utilities.scss
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.

Resolve deprecation warnings due to sass upgrade

1 participant