[RFC] Support better customization with semantic classNames/styles #54505
Replies: 6 comments 16 replies
-
|
参考 https://mui.com/material-ui/customization/theme-components/#variants |
Beta Was this translation helpful? Give feedback.
-
|
怎么搞这么复杂了,props 全部配置化,最后恐怕会演变成 echarts 那种了,全部得看文档 |
Beta Was this translation helpful? Give feedback.
-
|
伪类具体会怎么实现? |
Beta Was this translation helpful? Give feedback.
-
|
conditionClass |
Beta Was this translation helpful? Give feedback.
-
最终选择以下方案方案变更 支持 function结构export type ClassNamesType =
| <Record<string, string>
| ((info: { props:Props }) => Record<string, string> | undefined);
export type StylesType =
| <Record<string, React.CSSProperties>
| ((info: {
props: Rrops;
}) => Record<ButtonSemanticName, React.CSSProperties>| undefined);classNames={info => Record<string, string>}
styles={info => Record<string, React.CSSProperties>} |
Beta Was this translation helpful? Give feedback.
-
done |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
RFC:Support better customization with semantic classNames/styles
📌 动机
🎯 目标
✅ 方案:
classNames/styles as function(结构化数组规则)适合更复杂逻辑场景,语义清晰,易于静态分析和提取。
字段说明
propsclassNames{ root: '...' }🧪 示例解析
最终选择以下方案
方案变更 支持 function
结构
💬 讨论欢迎
如果你有更好的设计思路或反馈,欢迎提出!
Beta Was this translation helpful? Give feedback.
All reactions