Skip to content

Fix some SCSS warinings#1593

Open
rjmunro wants to merge 4 commits intoSofie-Automation:mainfrom
rjmunro:rjmunro/fix-scss-warinings
Open

Fix some SCSS warinings#1593
rjmunro wants to merge 4 commits intoSofie-Automation:mainfrom
rjmunro:rjmunro/fix-scss-warinings

Conversation

@rjmunro
Copy link
Contributor

@rjmunro rjmunro commented Jan 8, 2026

About the Contributor

Type of Contribution

This is a Code improvement

Current Behavior

A lot of SCSS warnings are shown, e.g. when running yarn dev on sofie-core, mostly due to deprecation of certain SCSS features.

New Behavior

Warnings from external libraries are suppressed; a few other warnings have been eliminated by changing the code where the changes are small. Many warnings still remain, mostly due to use of @import rather than @use but these are a bit harder to fix.

I have also removed a redundant and broken hidden feature from the PreviewPopup. When we hide the popup, we unmount it in React, we don't use the hidden feature. It wouldn't have worked anyway because use used visibility: none, which is not valid css, it's a confusion of visibility: hidden and display: none which are similar but slightly different concepts.

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

This affects webui.

Time Frame

  • Not urgent, but we would like to get this merged into the in-development release.

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

Summary

This PR addresses SCSS deprecation warnings that appear during development, particularly from Bootstrap 5.x and Dart Sass 2.x compatibility issues. The changes include a combination of code modernization and build-level suppression strategies.

Key Changes

vite.config.mts

  • Added SCSS preprocessor configuration to silence deprecation warnings from Bootstrap and other libraries using silenceDeprecations: ['import', 'global-builtin', 'color-functions', 'mixed-decls']
  • This suppresses warnings caused by Bootstrap 5.x not yet fully supporting Dart Sass 2.x

PreviewPopUp.scss

  • Converted @import to @use for modern SCSS syntax (@use '../../styles/itemTypeColors')
  • Updated mixin invocations from @include item-type-colors() to the namespaced form @include itemTypeColors.item-type-colors()
  • Removed the &--hidden modifier block that used invalid CSS

PreviewPopUp.tsx

  • Removed the hidden?: boolean prop from the component's public interface
  • Removed the associated preview-popUp--hidden conditional CSS class from the classNames object
  • The hidden feature was redundant since the popup is unmounted in React when not displayed

Rationale

The PR acknowledges that many SCSS warnings remain unresolved (primarily due to continued use of @import instead of @use throughout the codebase), but tackles the most impactful issues: suppressing third-party library deprecation warnings at the build level and eliminating the invalid CSS usage in the PreviewPopUp component. The removal of the unused hidden prop aligns with React best practices by eliminating unused component state and code paths.

@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

Walkthrough

Converts PreviewPopUp SCSS from @import to @use, renames mixin calls to use the namespaced form, moves/restores modifier blocks, adds Sass deprecation silencing in Vite config, and removes the hidden prop and related classname logic from the PreviewPopUp React component.

Changes

Cohort / File(s) Summary
SCSS Module Migration
packages/webui/src/client/ui/PreviewPopUp/PreviewPopUp.scss
Replace @import with @use; update mixin calls from @include item-type-colors() to @include itemTypeColors.item-type-colors(); modifier blocks (&--large, &--small, &--hidden) removed from base ruleset and re-added later in file.
Build Configuration
packages/webui/vite.config.mts
Add css.preprocessorOptions.scss.silenceDeprecations to suppress Dart Sass 2.x deprecation warnings (Bootstrap 5.x).
Component API / Logic
packages/webui/src/client/ui/PreviewPopUp/PreviewPopUp.tsx
Remove hidden?: boolean prop and eliminate usage of preview-popUp--hidden classname from classNames generation and rendering.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped from import to use so bright,
Namespaced mixins stitched day and night,
Modifiers moved and warnings hushed,
A cheeky prop was quietly brushed,
I nibble code and dance with delight.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix some SCSS warinings' contains a typo ('warinings' instead of 'warnings') and is vague; it does not clearly convey the specific changes made, such as converting @import to @use, suppressing deprecation warnings, or removing the hidden prop. Revise the title to be more specific and correct the typo, e.g., 'Fix SCSS warnings and remove hidden prop from PreviewPopUp' or 'Convert SCSS imports to @use and silence deprecation warnings'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 docstrings

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.

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@rjmunro rjmunro changed the base branch from main to release53 January 12, 2026 14:56
@rjmunro rjmunro force-pushed the rjmunro/fix-scss-warinings branch from dbc6d84 to 594929c Compare January 15, 2026 12:46
@rjmunro
Copy link
Contributor Author

rjmunro commented Jan 26, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 26, 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

@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: 1

🤖 Fix all issues with AI agents
In `@packages/webui/src/client/ui/PreviewPopUp/PreviewPopUp.scss`:
- Around line 47-49: The CSS rule for the modifier selector &--hidden in
PreviewPopUp.scss uses an invalid value `visibility: none`; update that
declaration to a valid value such as `visibility: hidden` (or `display: none` if
you want it removed from layout) so the PreviewPopUp's hidden state works
correctly; change the single `visibility` line inside the `&--hidden` block
accordingly.

The CSS was wrong and it wasn't used. We unmount the component when we
don't want to see it, which is probably a much better choice for this
component.
@rjmunro rjmunro force-pushed the rjmunro/fix-scss-warinings branch from 594929c to c9e6ccd Compare January 26, 2026 12:51
@rjmunro
Copy link
Contributor Author

rjmunro commented Jan 26, 2026

@coderabbitai review

@rjmunro rjmunro marked this pull request as ready for review January 26, 2026 13:02
@rjmunro rjmunro requested a review from a team as a code owner January 26, 2026 13:02
@coderabbitai
Copy link

coderabbitai bot commented Jan 26, 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.

@rjmunro rjmunro changed the title Fix SCSS warinings Fix some SCSS warinings Jan 27, 2026
scss: {
// Silence deprecation warnings from Bootstrap and other libraries
// These are caused by Bootstrap 5.x not yet fully supporting Dart Sass 2.x
silenceDeprecations: ['import', 'global-builtin', 'color-functions', 'mixed-decls'],
Copy link
Member

Choose a reason for hiding this comment

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

should this be quietDeps: true, instead? that seems to hide all the warnings, and might be better as it wont risk us adding any new silenced deprecations to our code?
but I'm not seeing any warnings from the other change you made, so maybe this hides too much too?

Copy link
Member

@nytamin nytamin left a comment

Choose a reason for hiding this comment

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

I'm not an expert, but LGTM :)

@PeterC89 PeterC89 changed the base branch from release53 to main February 4, 2026 12:38
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