Skip to content

Commit 4e52e84

Browse files
authored
Merge branch 'main' into 4652-outdated-documentation-about-overwriting-default-mappings-for-headlines
2 parents 67edd20 + 2be9529 commit 4e52e84

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

packages/components/src/styles/internal/_form-components.scss

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@use "sass:map";
22
@use "sass:string";
3+
@use "sass:list";
34
@use "@db-ux/core-foundations/build/styles/icons";
45
@use "@db-ux/core-foundations/build/styles/fonts";
56
@use "@db-ux/core-foundations/build/styles/variables";
@@ -9,6 +10,11 @@
910

1011
@forward "../visually-hidden";
1112

13+
// https://developer.mozilla.org/en-US/docs/Web/CSS/:read-only
14+
$valid-read-only-form-fields: input, textarea;
15+
// https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing
16+
$valid-field-sizing-form-fields: input, textarea;
17+
1218
$dropdown-icon-transition: transform variables.$db-transition-straight-emotional;
1319
$dropdown-icon-transform: rotate(-180deg);
1420

@@ -372,7 +378,7 @@ $input-valid-types:
372378
background-color: colors.$db-adaptive-bg-basic-transparent-semi-hovered;
373379
}
374380

375-
&:is(input, textarea) {
381+
@if list.index($valid-field-sizing-form-fields, $selector) {
376382
/* see https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing */
377383
&[data-field-sizing="content"] {
378384
field-sizing: content;
@@ -383,11 +389,13 @@ $input-valid-types:
383389
}
384390
}
385391

386-
&:is(input, textarea):not(:disabled):read-only {
387-
background-color: var(
388-
--db-textarea-read-only,
389-
#{colors.$db-adaptive-bg-basic-transparent-full-default}
390-
) !important;
392+
@if list.index($valid-read-only-form-fields, $selector) {
393+
&:not(:disabled):read-only {
394+
background-color: var(
395+
--db-#{$selector}-read-only,
396+
#{colors.$db-adaptive-bg-basic-transparent-full-default}
397+
) !important;
398+
}
391399
}
392400
}
393401

0 commit comments

Comments
 (0)