Skip to content
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

[Emotion] Convert EuiFilePicker #7833

Merged
merged 17 commits into from
Jun 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix truncation on mobile/short widths for large displays
cee-chen committed Jun 13, 2024
commit 662f15f3e970a0f1cdd9adc796d55090f2bf61ab
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ export const euiFilePickerStyles = (euiThemeContext: UseEuiTheme) => {
const { euiTheme } = euiThemeContext;
const formStyles = euiFormControlStyles(euiThemeContext);
const formVariables = euiFormVariables(euiThemeContext);
const { fontSize, lineHeight } = euiFontSize(euiThemeContext, 's');

return {
euiFilePicker: css`
@@ -88,8 +89,8 @@ export const euiFilePickerStyles = (euiThemeContext: UseEuiTheme) => {

euiFilePicker__prompt: css`
pointer-events: none; /* Don't block the user from dropping files onto the filepicker */
font-size: ${euiFontSize(euiThemeContext, 's').fontSize};
line-height: 1;
font-size: ${fontSize};
line-height: 1; /* Vertically centers default display text */
${euiTextTruncate()}
color: ${euiTheme.colors.text};
border: ${euiTheme.border.width.thick} dashed
@@ -114,6 +115,12 @@ export const euiFilePickerStyles = (euiThemeContext: UseEuiTheme) => {
flex-direction: column;
align-items: center;
justify-content: center;

/* Child text truncation needed on prompt text due to flex display */
.euiFilePicker__promptText {
${euiTextTruncate()}
line-height: ${lineHeight}; /* Fix descenders getting cut off */
}
`,
// Static heights so that surrounding contents don't shift around
uncompressed: `