nutui-react icon indicating copy to clipboard operation
nutui-react copied to clipboard

feat: update sass version

Open xiaoyatong opened this issue 10 months ago • 1 comments

🤔 这个变动的性质是?

sass 升级,解除 deprecation。

  • [ ] 新特性提交
  • [ ] 日常 bug 修复
  • [ ] 站点、文档改进
  • [ ] 演示代码改进
  • [ ] 组件样式/交互改进
  • [ ] TypeScript 定义更新
  • [ ] 包体积优化
  • [ ] 性能优化
  • [ ] 功能增强
  • [ ] 国际化改进
  • [ ] 重构
  • [ ] 代码风格优化
  • [ ] 测试用例
  • [ ] 分支合并
  • [ ] 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项。⚠️

  • [ ] 文档已补充或无须补充
  • [ ] 代码演示已提供或无须提供
  • [ ] TypeScript 定义已补充或无须补充
  • [ ] fork仓库代码是否为最新避免文件冲突
  • [ ] Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

• 样式改进
 - 日历组件调整为垂直布局并优化自适应展示,提升视觉整洁度。
 - 卡片、对话框、菜单、侧边栏、选项卡及上传等组件的样式进行了统一升级,呈现更现代的视觉风格。
 - 文档页面(包括标题、导航及主题部分)的配色和排版经过优化,改善了阅读体验。

xiaoyatong avatar Feb 08 '25 02:02 xiaoyatong

Walkthrough

本次提交主要对项目配置和样式文件进行了调整。package.json 中新增了中文描述,更新了 lint-staged 配置和开发脚本,并移除了 sass 分辨率的版本锁定;多个 SCSS 文件统一将旧的 @import 替换为更现代的 @use 语法,引入并更新了变量与 mixin 的导入方式,同时对部分组件的布局和颜色变量进行了微调;vite 配置文件中的 SCSS 预处理选项也同步作出了相应更新。

Changes

文件/模块 修改描述
package.json 新增 description(中文描述)、更新 lint-staged 配置、修改 dev:rtl 与 dev:jrkf 脚本(由 vite 改为 npm run dev)、移除 sass 分辨率版本。
src/packages/calendar/*.scss 为 .nut-calendar 类添加了 flex-direction: column 和 flex: 1 属性。
src/packages/{card, dialog, menu, uploader}/*.scss 将旧的 @import 导入 text-ellipsis mixin 的方式替换为 @use 语法(dialog 文件仅聚焦导入 text-ellipsis),确保样式模块化。
src/packages/{sidebar, tabs}/*.scss 移除了对 mixins 的 @import 导入。
src/sites/assets/styles/highlight.scss 新增 @use 导入 variables,新增 -webkit-font-smoothing 属性及为 pre 内 p 元素添加 margin-top。
src/sites/assets/styles/md-style.scss 删除了对 highlight.scss 的 @import,新增 @use 'sass:color' 和 @use './variables.scss',更新了颜色调整方法(由 mix 改为 color.adjust)。
src/sites/assets/styles/variables.scss 新增颜色变量($color-title、$white、$black),并更新了 $doc-default-header-color 与 $doc-default-nav-bg 以使用 $white。
src/sites/doc/{App.scss, components/header/header.scss, components/nav/nav.scss} 添加 @use 导入 variables 模块,并将样式中原有的变量引用更新为带 namespaces 的引用。
src/sites/mobile/App.scss 将 @import '../../styles/jd-font.scss' 更换为 @use '../../styles/jd-font.scss'。
src/sites/theme/{components/header/header.scss, components/nav/nav.scss, mainTheme.tsx} 在主题相关文件中统一引入并使用 variables 模块,更新颜色、尺寸等变量的引用,同时在 mainTheme.tsx 中新增 highlight.scss 的导入。
src/styles/mixins/index.scss 移除了对 make-animation.scss 和 text-ellipsis.scss 的导入。
vite.config.ts 更新 SCSS 预处理器配置:将内嵌的 @import 替换为 @use 语法,并注释掉 silenceDeprecations 选项。

Possibly related PRs

  • jdf2e/nutui-react#2674: 与本次提交中 dev:jrkf 脚本的修改相关,二者在开发命令配置上存在一定关联。

Suggested reviewers

  • oasis-cloud
  • Alex-huxiyang

Poem

嗨,我是一只欢快的小兔,
轻蹦跃过代码的森林。
配置更新、样式更迭,
模块化让一切更有序。
代码如诗,在指尖舞动,
跟我一起欢庆这美好的变革!

✨ Finishing Touches
  • [ ] 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Feb 08 '25 02:02 coderabbitai[bot]