Fixed incorrect darkening of email-cta button on hover with some colours

refs https://github.com/TryGhost/Team/issues/928

- the background color of the button was incorrectly applied to the original accent colour rather than the adjusted accent color
- added adjustment of text color on hover too in case it went outside of a visible range
This commit is contained in:
Kevin Ansfield 2021-07-29 15:10:06 +01:00
parent 8db674191d
commit 503845ce59
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,6 @@
import {Color, textColorForBackgroundColor} from '@tryghost/color-utils';
import {helper} from '@ember/component/helper';
export default helper(function hexContrast([hex]) {
return textColorForBackgroundColor(Color(hex)).hex();
});

View File

@ -55,8 +55,8 @@
}
.email-cta-button-text-input:hover,
.gh-btn-accent:hover {
color: {{hex-adjust this.ui.textColorForAdjustedAccentBackground l=-15}};
background-color: {{hex-adjust this.settings.accentColor l=-15}}
color: {{hex-contrast this.ui.adjustedAccentColor}};
background-color: {{hex-adjust this.ui.adjustedAccentColor l=-15}}
}
.email-cta-button-text-input::placeholder {
{{!-- TODO: saturation adjustment for white/black doesn't work --}}