Closed ianzone closed 2 weeks ago
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.
:white_check_mark: liuyib
:white_check_mark: ianzone
:x: crazylxr
You have signed the CLA already but the status is still pending? Let us recheck it.
很有意思的一个 hook,麻烦提一个 RFC,我们先在 issue 里面详细讨论一下 api 的设计呢
请问还有要改的吗?
需要再许可一次
一般做动态主题时,会给 html 加上特定类名(如 .dark
)或者特定属性(data-theme="dark"
) 等,来实现动态换肤,所以这个 hook 应该还需要加个回调参数 onChange
,这样 theme 变动时,用户可以自己完成上述这些操作。@ianzone 你觉着呢?
代码我更新了一部分,你改之前 pull 一下
一般做动态主题时,会给 html 加上特定类名(如
.dark
)或者特定属性(data-theme="dark"
) 等,来实现动态换肤,所以这个 hook 应该还需要加个回调参数onChange
,这样 theme 变动时,用户可以自己完成上述这些操作。@ianzone 你觉着呢?代码我更新了一部分,你改之前 pull 一下
改好了
还有哪里需要改的吗?
还望及时处理,不然一直落后于主分支。
落后于主分支不用关注,merge的那一下会有人同步主分支的
------------------ Original ------------------ From: Yiheng @.> Date: Mon,Aug 12,2024 1:48 PM To: alibaba/hooks @.> Cc: 云泥 @.>, Comment @.> Subject: Re: [alibaba/hooks] feat: add useTheme (PR #2617)
还望及时处理,不然一直落后于主分支。
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
一般做动态主题时,会给 html 加上特定类名(如
.dark
)或者特定属性(data-theme="dark"
) 等,来实现动态换肤,所以这个 hook 应该还需要加个回调参数onChange
,这样 theme 变动时,用户可以自己完成上述这些操作。@ianzone 你觉着呢?代码我更新了一部分,你改之前 pull 一下
这个 onChange 是不是也可以不加呢,直接监听 theme 的变化就好了?
另外这个 hook 叫 useTheme 是不是不太合适呢,看到这个 hook 的名称无法很明确的知道这个 hook 干什么的,这个跟 darkMode 比较相关,是不是可以考虑 hook 的名字结合一下这个
一般做动态主题时,会给 html 加上特定类名(如
.dark
)或者特定属性(data-theme="dark"
) 等,来实现动态换肤,所以这个 hook 应该还需要加个回调参数onChange
,这样 theme 变动时,用户可以自己完成上述这些操作。@ianzone 你觉着呢? 代码我更新了一部分,你改之前 pull 一下这个 onChange 是不是也可以不加呢,直接监听 theme 的变化就好了?
赞同
另外这个 hook 叫 useTheme 是不是不太合适呢,看到这个 hook 的名称无法很明确的知道这个 hook 干什么的,这个跟 darkMode 比较相关,是不是可以考虑 hook 的名字结合一下这个
但是这个hooks包括了light, dark, system 三种mode,而且确实和主题相关,所以我认为命名合适
没问题的话可否合并一下?我需要用这个钩子。
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
☑️ Self Check before Merge
⚠️ Please check all items below before review. ⚠️