Skip to content

feat: ✨ config-provider 支持customClass 与 customeStyle#535

Merged
Moonofweisheng merged 1 commit intoMoonofweisheng:masterfrom
git-lt:feature/provider-add-custom-style-config
Aug 19, 2024
Merged

feat: ✨ config-provider 支持customClass 与 customeStyle#535
Moonofweisheng merged 1 commit intoMoonofweisheng:masterfrom
git-lt:feature/provider-add-custom-style-config

Conversation

@git-lt
Copy link
Contributor

@git-lt git-lt commented Aug 19, 2024

🤔 这个 PR 的性质是?(至少选择一个)

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

🔗 相关 Issue

💡 需求背景和解决方案

用于自定义设置布局组件根节点的样式

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

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

  • 文档已补充或无须补充
  • 无须提供
  • TypeScript 定义已补充或无须补充

Summary by CodeRabbit

  • 新功能

    • 增加了对 ConfigProvider 主题变量的外部样式类支持,允许用户自定义主题和样式。
    • 改进了 wd-config-provider 组件的功能,支持更多配置选项和动态样式处理。
  • 文档

    • 更新了 config-provider.md 文档,新增了关于 custom-classcustom-style 的说明及其使用要求。

@netlify
Copy link

netlify bot commented Aug 19, 2024

Deploy Preview for wot-design-uni ready!

Name Link
🔨 Latest commit ac2a171
🔍 Latest deploy log https://app.netlify.com/sites/wot-design-uni/deploys/66c2ff10f3cb3a000806b1aa
😎 Deploy Preview https://deploy-preview-535--wot-design-uni.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vercel
Copy link

vercel bot commented Aug 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wot-design-uni ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2024 8:16am

@coderabbitai
Copy link

coderabbitai bot commented Aug 19, 2024

Walkthrough

此次更改增强了 ConfigProvider 组件的文档和功能。新增的样式类文档条目提供了更好的主题和样式自定义选项,同时在代码中引入了额外的属性以扩展配置灵活性。themeClassthemeStyle 的计算逻辑经过改进,使组件能够更好地处理用户自定义的样式,提升了其适应性与可配置性。

Changes

文件 更改摘要
docs/component/config-provider.md 新增“外部样式类”小节,记录 custom-classcustom-style 的用途及最低版本要求。
src/.../wd-config-provider/types.ts 修改 configProviderProps,引入 baseProps 的属性以增强配置选项。
src/.../wd-config-provider/wd-config-provider.vue 修改 themeClassthemeStyle 的计算逻辑,支持自定义样式和动态样式的结合。

Poem

🐰 在风中跳跃,快乐无比,
新样式、新功能,如春花盛开。
自定义的魔法,缤纷多彩,
让每个组件,都有它的精彩!
兔子祝贺,欢声笑语,
让我们共同期待,未来的奇遇! 🌼✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cb6be3e and ac2a171.

Files selected for processing (3)
  • docs/component/config-provider.md (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-config-provider/types.ts (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-config-provider/wd-config-provider.vue (1 hunks)
Additional comments not posted (5)
src/uni_modules/wot-design-uni/components/wd-config-provider/wd-config-provider.vue (3)

30-30: 引入 objToStyle 工具函数

引入的 objToStyle 函数用于将样式对象转换为 CSS 字符串,确保其正确使用。


35-35: themeClass 计算属性的增强

themeClass 计算属性现在包括 props.customClass,这允许用户添加自定义类以增强样式灵活性。


39-40: themeStyle 计算属性的增强

themeStyle 计算属性现在使用 objToStyle 将主题变量映射到 CSS 变量,并与 props.customStyle 结合。这提供了更大的样式灵活性和动态性。

docs/component/config-provider.md (1)

133-138: 新增外部样式类文档

文档中新增了 custom-classcustom-style 的条目,清晰地说明了这些类的用途和最低版本要求。这有助于用户更好地理解和使用这些自定义样式功能。

src/uni_modules/wot-design-uni/components/wd-config-provider/types.ts (1)

7-7: 合并 basePropsconfigProviderProps

通过合并 basePropsconfigProviderProps 扩展了配置选项。这增强了组件的灵活性,同时保持了现有结构。

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.

2 participants