Skip to content

Commit

Permalink
Fixed placeholder text color for more browsers (elastic#2113)
Browse files Browse the repository at this point in the history
* Make mixin for placeholder and use in disabled
  • Loading branch information
cchaos authored and snide committed Jul 15, 2019
1 parent 465bc58 commit 947c7a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Removed time from default `dateFormat` of `EuiDatePicker` ([#1820](https://github.com/elastic/eui/pull/1820))
- Fixed `EuiPopover` from catching and preventing propagation of keydown events when closed ([#2089](https://github.com/elastic/eui/pull/2089))
- Fixed padding sizes between `EuiModal` header, body, and footer ([#2088](https://github.com/elastic/eui/pull/2088))
- Fixed placeholder text color for more browsers ([#2113](https://github.com/elastic/eui/pull/2113))

**Deprecations**

Expand Down
15 changes: 13 additions & 2 deletions src/components/form/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
@mixin euiPlaceholderPerBrowser {
// sass-lint:disable-block no-vendor-prefixes
// Each prefix must be it's own content block
&::-webkit-input-placeholder { @content; }
&::-moz-placeholder { @content; }
&:-ms-input-placeholder { @content; }
&:-moz-placeholder { @content; }
&::placeholder { @content; }
}

@function euiFormControlGradient($color: $euiColorPrimary) {
@return linear-gradient(to top,
Expand All @@ -19,7 +28,8 @@
line-height: 1em; // fixes text alignment in IE
color: $euiTextColor;

&::placeholder {
// sass-lint:disable-block mixins-before-declarations
@include euiPlaceholderPerBrowser {
color: $euiColorDarkShade;
}
}
Expand Down Expand Up @@ -132,7 +142,8 @@
background: $euiFormBackgroundDisabledColor;
box-shadow: inset 0 0 0 1px $euiFormBorderDisabledColor;

&::placeholder {
// sass-lint:disable-block mixins-before-declarations
@include euiPlaceholderPerBrowser {
color: $euiFormControlDisabledColor;
}
}
Expand Down

0 comments on commit 947c7a1

Please sign in to comment.