Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

Proposed changes

Sass 1.95.0+ deprecates the if() function syntax with comparison operators. This causes deprecation warnings when building the project:

Deprecation Warning [if-function]: The Sass if() syntax is deprecated in favor of the modern CSS syntax.

Replaced deprecated if() with @if/@else control structure in arr-join() function:

Before:

$result: if(
    $i != list.length($list),
    $result#{$e}#{$glue},
    $result#{$e}
);

After:

@if $i != list.length($list) {
    $result: $result#{$e}#{$glue};
} @else {
    $result: $result#{$e};
}

Functionally equivalent, eliminates deprecation warning.

Types of changes

  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improvements to existing components or architectural decisions)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Further comments

Single file change in packages/components/src/styles/internal/_stack-components.scss. Modern @if/@else syntax is the recommended approach for conditional logic in Sass and maintains compatibility across Sass versions.

Original prompt

This section details on the original issue you should resolve

<issue_title>deprecation warning sass</issue_title>
<issue_description>### Which generators are affected?

  • All
  • HTML
  • React
  • Angular
  • Vue
  • Web components
  • Power Apps

Reproduction case

I updated DB UI to version 4.2.3 and we use SASS version 1.95.0 in our project. After the update I got a deprecation warning. See Screenshot below.

Expected Behaviour

Not to have the deprecation warning.

Screenshots

Image

Browser version

None

Add any other context about the problem here.

No response

Which DB business unit do you work for?

DB Systel GmbH (please name your customer below)

”DB Systel” please enter your customer / ”other” please enter your area or business unit.

No response

What project are you working on?

IGA</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/copilot/fix-deprecation-warning-sass

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: dfc01fd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@db-ux/core-components Patch
@db-ux/ngx-core-components Patch
@db-ux/react-core-components Patch
@db-ux/wc-core-components Patch
@db-ux/v-core-components Patch
@db-ux/core-foundations Patch
@db-ux/core-stylelint Patch
@db-ux/core-migration Patch
@db-ux/agent-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copilot AI changed the title [WIP] Fix deprecation warning for SASS in React Fix Sass if() function deprecation warning in Sass 1.95.0+ Dec 9, 2025
Copilot AI requested a review from mfranzke December 9, 2025 13:43
@mfranzke mfranzke changed the title Fix Sass if() function deprecation warning in Sass 1.95.0+ fix: Sass if() function deprecation warning in Sass 1.95.0+ Dec 9, 2025
@github-actions github-actions bot added the 📕documentation Improvements or additions to documentation label Dec 9, 2025
@mfranzke mfranzke added 👩‍👧‍👦communityFeedback Feedback from community and removed 📕documentation Improvements or additions to documentation labels Dec 9, 2025
@mfranzke mfranzke marked this pull request as ready for review December 9, 2025 15:16
@github-actions github-actions bot added the 📕documentation Improvements or additions to documentation label Dec 9, 2025
@mfranzke mfranzke enabled auto-merge (squash) December 9, 2025 15:53
@mfranzke mfranzke disabled auto-merge December 9, 2025 16:24
@mfranzke mfranzke merged commit 69961ca into main Dec 9, 2025
6 checks passed
@mfranzke mfranzke deleted the copilot/fix-deprecation-warning-sass branch December 9, 2025 16:27
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in UX Engineering Team Backlog Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👩‍👧‍👦communityFeedback Feedback from community 🏘components 📕documentation Improvements or additions to documentation

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

deprecation warning sass

2 participants