Skip to content

Commit a97ba3f

Browse files
mfranzkegithub-actions[bot]Copilot
authored
fix(input): styling of "placeholder" content for date related types (#5251)
* fix(input): styling of "placeholder" content for date and datetime-local types * auto update snapshots (#5252) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Apply suggestion from @mfranzke * refactor: prettier * Update packages/components/src/styles/internal/_form-components.scss Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/components/src/styles/internal/_form-components.scss Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4679916 commit a97ba3f

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed
606 Bytes
Loading
912 Bytes
Loading
907 Bytes
Loading

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@ $db-min-inline-size: var(
7171
[id$="-placeholder"] {
7272
@content;
7373
}
74+
75+
// Workaround until the :blank pseudo-class is widely supported; then prefer targeting that pseudo-class.
76+
#{$selector} {
77+
&:is(
78+
[type="date"],
79+
[type="datetime-local"],
80+
[type="month"],
81+
[type="week"],
82+
[type="time"]
83+
):not(:user-valid)::-webkit-datetime-edit {
84+
@content;
85+
}
86+
}
7487
}
7588

7689
@mixin set-floating-label-overwrites($selector) {

0 commit comments

Comments
 (0)