Bugfix/checkbox style (#39974)

* 🎨 STYLE: fix indeterminate Checkbox style when disabled

* 📖 DOC: add indeterminate checkbox to disabled demo

* 🧪 TEST: update snapshots

* 🐞 FIX: don't change normal checkbox background

* 🐞 FIX: style selector
pull/40000/head
Danial Soheili 2 years ago committed by GitHub
parent 0296b4357e
commit a63789e3dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -433,6 +433,24 @@ Array [
</span>
</label>,
<br />,
<label
class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"
>
<span
class="ant-checkbox ant-checkbox-indeterminate ant-checkbox-disabled"
>
<input
aria-checked="mixed"
class="ant-checkbox-input"
disabled=""
type="checkbox"
/>
<span
class="ant-checkbox-inner"
/>
</span>
</label>,
<br />,
<label
class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"
>

@ -405,6 +405,24 @@ Array [
</span>
</label>,
<br />,
<label
class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"
>
<span
class="ant-checkbox ant-checkbox-indeterminate ant-checkbox-disabled"
>
<input
aria-checked="mixed"
class="ant-checkbox-input"
disabled=""
type="checkbox"
/>
<span
class="ant-checkbox-inner"
/>
</span>
</label>,
<br />,
<label
class="ant-checkbox-wrapper ant-checkbox-wrapper-disabled"
>

@ -5,6 +5,8 @@ const App: React.FC = () => (
<>
<Checkbox defaultChecked={false} disabled />
<br />
<Checkbox indeterminate disabled />
<br />
<Checkbox defaultChecked disabled />
</>
);

@ -268,6 +268,10 @@ export const genCheckboxStyle: GenerateStyle<CheckboxToken> = (token) => {
'& + span': {
color: token.colorTextDisabled,
},
[`&${checkboxCls}-indeterminate ${checkboxCls}-inner::after`]: {
background: token.colorTextDisabled,
},
},
},
];

Loading…
Cancel
Save