Skip to content

fix: scss import warning#7528

Open
kyangconn wants to merge 2 commits intoAstrBotDevs:masterfrom
kyangconn:fix/scss-warn
Open

fix: scss import warning#7528
kyangconn wants to merge 2 commits intoAstrBotDevs:masterfrom
kyangconn:fix/scss-warn

Conversation

@kyangconn
Copy link
Copy Markdown
Contributor

@kyangconn kyangconn commented Apr 13, 2026

通过cherry-pick dev分支中的修复提交,让lint不再向scss中的@import哈气。

Modifications / 改动点

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果


Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”

  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Update SCSS styling entrypoint and partials to use the modern @use syntax and ensure shared variables are properly imported.

Bug Fixes:

  • Resolve lint warnings related to deprecated @import usage in SCSS files.

Enhancements:

  • Standardize SCSS module imports across layout and component styles by switching to @use and explicitly including the shared variables module.

LIghtJUNction and others added 2 commits April 13, 2026 20:30
Dart Sass 3.0.0 将移除 @import,迁移到 @use 以消除弃用警告
@auto-assign auto-assign bot requested review from LIghtJUNction and Soulter April 13, 2026 19:44
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 13, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Since many partials now @use '../variables' as *;, consider creating a central variables module that @forwards your tokens and @uses that instead to reduce repetition and keep variable exports in one place.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since many partials now `@use '../variables' as *;`, consider creating a central variables module that `@forward`s your tokens and `@use`s that instead to reduce repetition and keep variable exports in one place.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dosubot dosubot bot added the area:webui The bug / feature is about webui(dashboard) of astrbot. label Apr 13, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request migrates Sass @import statements to the @use rule across various component and layout files. The review feedback identifies that the migration is incomplete, as several partials referenced in style.scss were not updated, which could lead to 'Undefined variable' errors. Additionally, the switch to @use for Vuetify styles requires the use of the with configuration syntax to maintain existing variable overrides.

Comment on lines +10 to +18
@use './components/VInput';
@use './components/VNavigationDrawer';
@use './components/VShadow';
@use './components/VTextField';
@use './components/VTabs';
@use './components/VScrollbar';
@use './components/CodeBlockDark';

@import './pages/dashboards';
@use './pages/dashboards';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The migration to @use appears to be incomplete. While several partials (like VButtons, VCard, and VShadow) were updated in this PR to include @use '../variables' as *;, others imported here—specifically VInput (line 10), VNavigationDrawer (line 11), VTextField (line 13), VScrollbar (line 15), CodeBlockDark (line 16), and dashboards (line 18)—were not included in the patch. If these files reference variables from _variables.scss, the build will fail with 'Undefined variable' errors because @use does not provide a global scope like @import did. Please ensure all partials are updated to explicitly load their dependencies.

@import './layout/container';
@import './layout/sidebar';
@use './variables';
@use 'vuetify/styles/main.sass';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Switching from @import to @use for vuetify/styles/main.sass changes how variable overrides are handled. In Sass modules, variables defined in ./variables (such as $border-radius-root or $color-pack) are no longer automatically available to the Vuetify module. If these variables were intended to customize Vuetify's default styling, you must now use the with configuration syntax or ensure the variables are forwarded correctly. For example: @use 'vuetify/styles/main.sass' with ($border-radius-root: 8px);.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants