-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(input): correctly apply placeholder styles #11107
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐
&:placeholder-shown { | ||
@apply text-ellipsis; | ||
} | ||
} | ||
|
||
// Placeholder styles | ||
// Do not combine these style rules. The browser interprets the rule as one. Properties like -webkit can not be found in Firefox, thus the whole line is rendered as an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: for clarity, maybe use one of the placeholder vendor prefixes instead of -webkit
?
&:placeholder-shown { | ||
@apply text-ellipsis; | ||
} | ||
} | ||
|
||
// Placeholder styles | ||
// Do not combine these style rules. The browser interprets the rule as one. Properties like -webkit can not be found in Firefox, thus the whole line is rendered as an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thus the whole line is rendered as an error.
Suggestion: thus the whole selector is invalidated and is ignored.
// Do not combine these style rules. The browser interprets the rule as one. Properties like -webkit can not be found in Firefox, thus the whole line is rendered as an error. | ||
:-ms-input-placeholder { | ||
@apply font-normal; | ||
color: var(--calcite-input-placeholder-text-color, var(--calcite-color-text-3)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a mixin or placeholder to DRY these styles a bit? This can be done in a follow-up.
Related Issue: #8967
Summary
Breaks the placeholder styles into separate lines to avoid a browser specific selector erroring out the whole line.
BEGIN_COMMIT_OVERRIDE
END_COMMIT_OVERRIDE