refactor: Tree checkbox style (#35389)

* fix: Checkbox inner disabled color

* refactor: Tree checkbox style

* refactor: adjust tree checkbox span

* refactor: adjust tree checkbox span

* refactor: remove useless `&`
This commit is contained in:
miracles1919 2022-05-06 15:58:32 +08:00 committed by GitHub
parent 7460c95b65
commit 6b6c8cb6b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -226,7 +226,7 @@ export const genCheckboxStyle: GenerateStyle<CheckboxToken> = token => {
borderColor: token.colorBorder,
'&:after': {
borderColor: token.colorBorder,
borderColor: token.colorTextDisabled,
},
},

View File

@ -256,7 +256,11 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject =>
},
// >>> Title
[`& ${treeCls}-node-content-wrapper`]: {
// add `${treeCls}-checkbox + span` to cover checkbox `${checkboxCls} + span`
[`
${treeCls}-node-content-wrapper,
${treeCls}-checkbox + span
`]: {
display: 'flex',
flexWrap: 'nowrap',
position: 'relative',
@ -467,6 +471,8 @@ export const genTreeStyle = (prefixCls: string, token: DerivativeToken): CSSInte
// ============================== Export ==============================
export default genComponentStyleHook('Tree', (token, { prefixCls }) => [
getCheckboxStyle(`${prefixCls}-checkbox`, token),
{
[token.componentCls]: getCheckboxStyle(`${prefixCls}-checkbox`, token),
},
genTreeStyle(prefixCls, token),
]);