-
Notifications
You must be signed in to change notification settings - Fork 841
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
Fixing styles for euiKeyPadMenu
#8294
base: eui-theme/borealis
Are you sure you want to change the base?
Conversation
Preview staging links for this PR:
|
💚 Build Succeeded
|
selected: css` | ||
background-color: ${euiTheme.components | ||
.keyPadMenuItemBackgroundDisabledSelect}; | ||
selected: hasVisColorAdjustment |
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.
Let's update this to ensure that all styles are part of the Emotion css
, prevent the lint error and we can also simplify as it's the same style rule:
selected: css`
background-color: ${hasVisColorAdjustment
? euiTheme.components.keyPadMenuItemBackgroundDisabledSelect
: euiTheme.colors.backgroundBaseDisabled};
`
|
||
${euiCanAnimate} { | ||
transition: background-color ${euiTheme.animation.fast} ease-in, | ||
box-shadow ${euiTheme.animation.fast} ease-in; | ||
} | ||
`, | ||
enabled: css` | ||
/* stylelint-disable no-extra-semicolons */ |
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.
We can remove this comment by rewriting the styles a bit. Generally assuring the style rule is set and only values are condition seems to work better in those cases.
I'll add suggestions per line.
transform: translateY(0); | ||
} | ||
} | ||
${hasVisColorAdjustment |
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.
Here we can prevent the Emotion-related semicolon lint error by separating multiline styles into a standalone variable.
const focusTransformStyles = `
${euiShadow(euiThemeContext, 's')};
${euiCanAnimate} {
.euiKeyPadMenuItem__icon {
transform: translateY(0);
}
}
`;
// usage
${hasVisColorAdjustment
? focusTransformStyles
: `background-color: ${euiTheme.colors.backgroundBaseInteractiveHover}`}
box-shadow: none; | ||
|
||
${hasVisColorAdjustment |
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.
We can prevent the lint error by using it this way:
background-color: ${
hasVisColorAdjustment
? euiTheme.focus.backgroundColor
: euiTheme.colors.backgroundBaseInteractiveHover
};
background-color: ${euiTheme.focus.backgroundColor}; | ||
color: ${euiTheme.colors.textHeading}; | ||
|
||
${hasVisColorAdjustment |
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.
Let's update to this to prevent the lint error:
background-color: ${hasVisColorAdjustment
? euiTheme.focus.backgroundColor
: ''};
color: ${euiTheme.colors.primaryText}; | ||
color: ${euiTheme.colors.textPrimary}; | ||
|
||
${hasVisColorAdjustment |
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.
Let's update to this to prevent the lint error:
background-color: ${!hasVisColorAdjustment
? euiTheme.colors.backgroundBaseInteractiveSelect
: ''};
|
||
.euiKeyPadMenuItem__icon { | ||
filter: grayscale(100%); | ||
|
||
${hasVisColorAdjustment ? `filter: grayscale(100%);` : ``} |
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.
We can update to:
filter: ${hasVisColorAdjustment ? 'grayscale(100%)' : ''};
@@ -0,0 +1,6 @@ | |||
- Updates styles for keypad menu in Borealis |
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.
We don't add changelogs to changes on eui-theme/borealis as it's a feature branch.
You can add the 'skip-chagelog` label.
We'll add a changelog when merging Borealis to main for any relevant changes.
|
||
**Accessibility** | ||
|
||
- Made keypad menu items in Dark mode visible on hover |
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.
Was this actually done? I don't see any dark mode specific changes 🤔
Summary
This PR fixes an issue mentioned in issue #158. Based on the discussion there and also on Borealis new color token rules, the changes include:
Changes made for Borealis include:
Showcasing:
Amsterdam
![CleanShot 2025-01-27 at 10 27 04](https://private-user-images.githubusercontent.com/36230123/406863778-7b3ccc4d-066f-4e18-9cfd-aa1e2b606fd2.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NjQzNjAsIm5iZiI6MTczODg2NDA2MCwicGF0aCI6Ii8zNjIzMDEyMy80MDY4NjM3NzgtN2IzY2NjNGQtMDY2Zi00ZTE4LTljZmQtYWExZTJiNjA2ZmQyLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE3NDc0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY2ZmEwMTYzODBlYzQ3MDdmMTIxNjZmNmU4Y2FhMTE3N2U3MWY3NThkMGI0MGNhYTI4ZTkyOWY1MzQzOTliZmUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.rMUe-WzyohzJjzI6knUE1G-DUjdW-aJoRyaFkqDf1KM)
Borealis
![CleanShot 2025-01-27 at 10 35 07](https://private-user-images.githubusercontent.com/36230123/406869161-69248935-7336-4050-bd00-70b9bec79df0.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NjQzNjAsIm5iZiI6MTczODg2NDA2MCwicGF0aCI6Ii8zNjIzMDEyMy80MDY4NjkxNjEtNjkyNDg5MzUtNzMzNi00MDUwLWJkMDAtNzBiOWJlYzc5ZGYwLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE3NDc0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY0MDJiMDMyNTljZjc5YWY0ZWQ0NzZmMDNjZThiNjk2ZjExYjZkYWViMjA2MmY0MWRlZTExNmE0N2M1NTk4NzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.dSyVbJqwCnGTQez-9gsr9MQLBQf_J-VzQdDt4NWBNiA)
QA:
@default
if default values are missing) and playground toggles