-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: 补充web 设置 px 转 rem时的文档 #3098
Conversation
Walkthrough文档更新增加了关于 NutUI-React 框架下 CSS 单位转换的指导,阐述如何将 px 转换为 rem。新指导特别强调在 PostCSS 配置中,需通过 Changes
Suggested reviewers
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #3098 +/- ##
==========================================
Coverage 86.48% 86.49%
==========================================
Files 280 280
Lines 18489 18492 +3
Branches 2774 2774
==========================================
+ Hits 15991 15994 +3
Misses 2493 2493
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
src/sites/sites-react/doc/docs/react/start-react.md (2)
153-155
: 文本说明清晰,建议补充细节说明
文档中新增的说明已经清楚地指出了在进行 px 转 rem 转换时,需要通过配置selectorBlackList: ['nut-']
来排除 NutUI 相关的样式。建议增加一句解释:说明为何(例如防止组件样式被错误转换)需要排除以nut-
开头的类名,以及这样做对项目布局或样式带来的好处。
156-165
: 代码块建议添加语言标识
静态分析工具提示未为代码块指定语言,这可能影响代码高亮与可读性。建议修改为:-``` +```js这样可以提高代码示例的可读性,并符合 markdownlint 的要求。
src/sites/sites-react/doc/docs/react/start-react.en-US.md (2)
151-155
: Documentation text clarity and language refinement
The updated text clearly explains that when converting px to rem, NutUI-related CSS classes should be excluded by configuring the postcss plugin appropriately. However, the phrase “Be attention” is non-standard in English; consider using “Please note” or “Note that” to improve clarity and professionalism.
156-165
: Add code block language for enhanced readability
Similar to the Chinese version, the fenced code block lacks a language specifier. It is recommended to specify the language (e.g., ```js) for better syntax highlighting and to comply with markdownlint guidelines.-``` +```js🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
156-156: Fenced code blocks should have a language specified
null(MD040, fenced-code-language)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/sites/sites-react/doc/docs/react/start-react.en-US.md
(1 hunks)src/sites/sites-react/doc/docs/react/start-react.md
(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
src/sites/sites-react/doc/docs/react/start-react.en-US.md
156-156: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taro 目录中的也可以改一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/sites/sites-react/doc/docs/taro/start-react.en-US.md (1)
196-211
: 新增 “CSS units” 节,文档描述清晰明确。新增部分详细说明了组件使用的 CSS 单位(px),同时指出 Taro 在编译时会对样式执行尺寸转换操作,并提醒用户在配置中将 NutUI 相关样式加入黑名单,防止转换。这部分示例代码(config/index.js 的 postcss 配置)规范且直观。建议增加对
pxtransform
插件的简单说明或提供链接,帮助用户进一步了解相关配置细节。src/sites/sites-react/doc/docs/taro/start-react.md (1)
200-215
: 新增 “样式单位转化” 节,内容详实且易于理解。文档中新增的“样式单位转化”节说明了组件采用 px 作为 CSS 单位,并解释了 Taro 编译过程中如何进行单位转换,同时详细展示了在配置文件中如何通过
postcss
的pxtransform
配置与黑名单selectorBlackList
来排除 NutUI 相关样式。示例代码和注释均表达清楚用途。建议检查文档内各部分描述的一致性,以保证英文版和中文版的信息相互补充,并考虑加入更多关于配置场景的说明。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/sites/sites-react/doc/docs/react/start-react.en-US.md
(1 hunks)src/sites/sites-react/doc/docs/taro/start-react.en-US.md
(1 hunks)src/sites/sites-react/doc/docs/taro/start-react.md
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/sites/sites-react/doc/docs/react/start-react.en-US.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit