-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens/SCSS] Delete and migrate annotations.scss
file
#209074
base: main
Are you sure you want to change the base?
Conversation
6967caf
to
1cd57cc
Compare
1cd57cc
to
9c1a52d
Compare
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
annotations.scss
file
annotations.scss
fileannotations.scss
file
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.
Thanks, @mariairiartef! I left a couple of small questions/suggestions below for your review, but otherwise this looks good to me. Assuming you're able to address those, approving now so that I don't hold you up.
src/platform/plugins/shared/chart_expressions/expression_xy/public/helpers/annotations.tsx
Outdated
Show resolved
Hide resolved
src/platform/plugins/shared/chart_expressions/expression_xy/public/helpers/annotations.tsx
Outdated
Show resolved
Hide resolved
src/platform/plugins/shared/chart_expressions/expression_xy/public/helpers/annotations.tsx
Show resolved
Hide resolved
const styles = { | ||
xyAnnotationTooltip: css({ | ||
borderRadius: '0 !important', | ||
}), | ||
xyAnnotationTooltipRows: css({ | ||
// maxHeight: '60vh', | ||
overflowY: 'hidden', | ||
}), | ||
xyAnnotationTooltipRow: ({ euiTheme }: UseEuiTheme) => | ||
css({ | ||
fontWeight: euiTheme.font.weight.regular, | ||
padding: `${euiTheme.size.s} ${euiTheme.size.m} ${euiTheme.size.s} ${euiTheme.size.s}`, | ||
borderRadius: '0 !important', | ||
}), | ||
xyAnnotationTooltipExtraFields: ({ euiTheme }: UseEuiTheme) => | ||
css({ | ||
color: euiTheme.colors.darkShade, | ||
marginTop: euiTheme.size.s, | ||
}), | ||
xyAnnotationTooltipExtraFieldsKey: css({ | ||
overflowWrap: 'anywhere', | ||
hyphens: 'auto', | ||
}), | ||
xyAnnotationTooltipExtraFieldsValue: css({ | ||
textAlign: 'right', | ||
overflowWrap: 'anywhere', | ||
hyphens: 'auto', | ||
}), | ||
xyAnnotationTooltipSkippedCount: ({ euiTheme }: UseEuiTheme) => | ||
css({ | ||
position: 'relative', | ||
textAlign: 'right', | ||
fontWeight: euiTheme.font.weight.regular, | ||
}), | ||
}; |
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.
I don't think it makes sense to keep the whole prefix-y name. The styles are collocated so it's ok to simplify:
const styles = { | |
xyAnnotationTooltip: css({ | |
borderRadius: '0 !important', | |
}), | |
xyAnnotationTooltipRows: css({ | |
// maxHeight: '60vh', | |
overflowY: 'hidden', | |
}), | |
xyAnnotationTooltipRow: ({ euiTheme }: UseEuiTheme) => | |
css({ | |
fontWeight: euiTheme.font.weight.regular, | |
padding: `${euiTheme.size.s} ${euiTheme.size.m} ${euiTheme.size.s} ${euiTheme.size.s}`, | |
borderRadius: '0 !important', | |
}), | |
xyAnnotationTooltipExtraFields: ({ euiTheme }: UseEuiTheme) => | |
css({ | |
color: euiTheme.colors.darkShade, | |
marginTop: euiTheme.size.s, | |
}), | |
xyAnnotationTooltipExtraFieldsKey: css({ | |
overflowWrap: 'anywhere', | |
hyphens: 'auto', | |
}), | |
xyAnnotationTooltipExtraFieldsValue: css({ | |
textAlign: 'right', | |
overflowWrap: 'anywhere', | |
hyphens: 'auto', | |
}), | |
xyAnnotationTooltipSkippedCount: ({ euiTheme }: UseEuiTheme) => | |
css({ | |
position: 'relative', | |
textAlign: 'right', | |
fontWeight: euiTheme.font.weight.regular, | |
}), | |
}; | |
const styles = { | |
tooltip: css({ | |
borderRadius: '0 !important', | |
}), | |
rows: css({ | |
// maxHeight: '60vh', | |
overflowY: 'hidden', | |
}), | |
row: ({ euiTheme }: UseEuiTheme) => | |
css({ | |
fontWeight: euiTheme.font.weight.regular, | |
padding: `${euiTheme.size.s} ${euiTheme.size.m} ${euiTheme.size.s} ${euiTheme.size.s}`, | |
borderRadius: '0 !important', | |
}), | |
extraFields: ({ euiTheme }: UseEuiTheme) => | |
css({ | |
color: euiTheme.colors.darkShade, | |
marginTop: euiTheme.size.s, | |
}), | |
extraFieldKey: css({ | |
overflowWrap: 'anywhere', | |
hyphens: 'auto', | |
}), | |
extraFieldValue: css({ | |
textAlign: 'right', | |
overflowWrap: 'anywhere', | |
hyphens: 'auto', | |
}), | |
skippedCount: ({ euiTheme }: UseEuiTheme) => | |
css({ | |
position: 'relative', | |
textAlign: 'right', | |
fontWeight: euiTheme.font.weight.regular, | |
}), | |
}; |
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.
Ok! I've only removed the xyAnnotation
prefix here since the first style refers to the tooltip and the rest are related. Let me know if it makes sense too
import { EuiFlexGroup, EuiIcon, EuiIconProps, EuiText, useEuiFontSize } from '@elastic/eui'; | ||
import { css } from '@emotion/react'; | ||
import { UseEuiTheme } from '@elastic/eui'; |
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.
import { EuiFlexGroup, EuiIcon, EuiIconProps, EuiText, useEuiFontSize } from '@elastic/eui'; | |
import { css } from '@emotion/react'; | |
import { UseEuiTheme } from '@elastic/eui'; | |
import { EuiFlexGroup, EuiIcon, EuiIconProps, EuiText, useEuiFontSize, UseEuiTheme } from '@elastic/eui'; | |
import { css } from '@emotion/react'; |
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.
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
|
src/platform/plugins/shared/chart_expressions/expression_xy/public/helpers/annotations.tsx
Show resolved
Hide resolved
xyAnnotationNumberIcon: ({ euiTheme }: UseEuiTheme) => | ||
css({ | ||
borderRadius: euiTheme.size.base, | ||
minWidth: euiTheme.size.base, | ||
height: euiTheme.size.base, | ||
backgroundColor: 'currentColor', | ||
}), | ||
xyAnnotationNumberIconText: ({ euiTheme }: UseEuiTheme) => | ||
css({ | ||
fontWeight: euiTheme.font.weight.medium, | ||
letterSpacing: '-.5px', | ||
}), | ||
xyAnnotationIconRotate90: css({ |
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.
As you have done in the src/platform/plugins/shared/chart_expressions/expression_xy/public/components/annotations.tsx
file you can probably remove the xyAnnotation
prefix on each style
Summary
Part of #208908
Replaces scss to css-in-js.
Checklist
release_note:*
label is applied per the guidelines