diff --git a/goldens/material/checkbox/index.api.md b/goldens/material/checkbox/index.api.md index 9e72c1808591..4eb98f892047 100644 --- a/goldens/material/checkbox/index.api.md +++ b/goldens/material/checkbox/index.api.md @@ -63,7 +63,6 @@ export class MatCheckbox implements AfterViewInit, OnChanges, ControlValueAccess get inputId(): string; // (undocumented) _isRippleDisabled(): boolean; - _labelElement: ElementRef; labelPosition: 'before' | 'after'; name: string | null; // (undocumented) @@ -94,8 +93,6 @@ export class MatCheckbox implements AfterViewInit, OnChanges, ControlValueAccess _onInteractionEvent(event: Event): void; _onLabelTextChange(): void; _onTouched: () => any; - // (undocumented) - _onTouchTargetClick(): void; _preventBubblingFromLabel(event: MouseEvent): void; // (undocumented) registerOnChange(fn: (value: any) => void): void; diff --git a/src/material/checkbox/checkbox.html b/src/material/checkbox/checkbox.html index a5101aa584c8..e32a8240523f 100644 --- a/src/material/checkbox/checkbox.html +++ b/src/material/checkbox/checkbox.html @@ -1,10 +1,11 @@ -
-
+
- - -
+ + diff --git a/src/material/checkbox/checkbox.scss b/src/material/checkbox/checkbox.scss index c07c0b111e55..0bf883c03ad2 100644 --- a/src/material/checkbox/checkbox.scss +++ b/src/material/checkbox/checkbox.scss @@ -44,6 +44,9 @@ $fallbacks: m3-checkbox.get-tokens(); label { cursor: default; + } + + .mat-internal-form-field-label { color: token-utils.slot(checkbox-disabled-label-color, $fallbacks); @include cdk.high-contrast { @@ -54,7 +57,7 @@ $fallbacks: m3-checkbox.get-tokens(); // The MDC styles result in extra padding if the label is present but empty. To fix this we hide // the label when it is empty. - label:empty { + .mat-internal-form-field-label:empty { display: none; } diff --git a/src/material/checkbox/checkbox.ts b/src/material/checkbox/checkbox.ts index f009b4bc8ef8..103390066fb3 100644 --- a/src/material/checkbox/checkbox.ts +++ b/src/material/checkbox/checkbox.ts @@ -205,9 +205,6 @@ export class MatCheckbox /** The native `` element */ @ViewChild('input') _inputElement!: ElementRef; - /** The native `