mirror of
https://github.com/material-components/material-web.git
synced 2026-01-09 07:21:09 +08:00
feat(textfield): add tokens for customizing text field selection
PiperOrigin-RevId: 568270462
This commit is contained in:
parent
d6f7220f0b
commit
49416e5c32
@ -42,6 +42,12 @@
|
||||
resize: inherit;
|
||||
}
|
||||
|
||||
.textarea::selection,
|
||||
.input::selection {
|
||||
background-color: var(--_text-selection-background-color);
|
||||
color: var(--_text-selection-color);
|
||||
}
|
||||
|
||||
@include icon.styles;
|
||||
@include input.styles;
|
||||
}
|
||||
|
||||
@ -96,6 +96,8 @@ $supported-tokens: (
|
||||
'supporting-text-line-height',
|
||||
'supporting-text-size',
|
||||
'supporting-text-weight',
|
||||
'text-selection-background-color',
|
||||
'text-selection-color',
|
||||
'trailing-icon-color',
|
||||
'trailing-icon-size',
|
||||
// go/keep-sorted end
|
||||
@ -123,14 +125,15 @@ $_default: (
|
||||
$tokens: values.validate(
|
||||
md-comp-filled-text-field.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
);
|
||||
|
||||
$tokens: map.merge(
|
||||
$tokens,
|
||||
(
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
$new-tokens: (
|
||||
// TODO(b/259455114): remove when focus tokens update to 3px
|
||||
'focus-active-indicator-height': if($exclude-hardcoded-values, null, 3px)
|
||||
'focus-active-indicator-height': if($exclude-hardcoded-values, null, 3px),
|
||||
// TODO(b/231336988): remove when text selection tokens are added
|
||||
'text-selection-background-color':
|
||||
if($exclude-hardcoded-values, null, 'Highlight'),
|
||||
'text-selection-color':
|
||||
if($exclude-hardcoded-values, null, 'HighlightText')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -88,6 +88,8 @@ $supported-tokens: (
|
||||
'supporting-text-line-height',
|
||||
'supporting-text-size',
|
||||
'supporting-text-weight',
|
||||
'text-selection-background-color',
|
||||
'text-selection-color',
|
||||
'trailing-icon-color',
|
||||
'trailing-icon-size',
|
||||
// go/keep-sorted end
|
||||
@ -114,14 +116,15 @@ $_default: (
|
||||
$tokens: values.validate(
|
||||
md-comp-outlined-text-field.values($deps, $exclude-hardcoded-values),
|
||||
$supported-tokens: $supported-tokens,
|
||||
$unsupported-tokens: $unsupported-tokens
|
||||
);
|
||||
|
||||
$tokens: map.merge(
|
||||
$tokens,
|
||||
(
|
||||
$unsupported-tokens: $unsupported-tokens,
|
||||
$new-tokens: (
|
||||
// TODO(b/259455114): remove when focus tokens update to 3px
|
||||
'focus-outline-width': if($exclude-hardcoded-values, null, 3px)
|
||||
'focus-outline-width': if($exclude-hardcoded-values, null, 3px),
|
||||
// TODO(b/231336988): remove when text selection tokens are added
|
||||
'text-selection-background-color':
|
||||
if($exclude-hardcoded-values, null, 'Highlight'),
|
||||
'text-selection-color':
|
||||
if($exclude-hardcoded-values, null, 'HighlightText')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user