-
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?
Changes from 15 commits
8cf9416
41be68a
01d5063
2d9d520
9c1a52d
1e7b2c3
13d6222
438323e
64fa8da
b75e430
2935a42
8a14638
7c9c9df
347994e
7d6a816
084465e
73fd31f
0eb9955
6ad4f00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,7 +9,9 @@ | |||||||||||
|
||||||||||||
import React from 'react'; | ||||||||||||
import { Position } from '@elastic/charts'; | ||||||||||||
import { EuiFlexGroup, EuiIcon, EuiIconProps, EuiText } from '@elastic/eui'; | ||||||||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||
import type { | ||||||||||||
IconPosition, | ||||||||||||
ReferenceLineDecorationConfig, | ||||||||||||
|
@@ -143,12 +145,12 @@ function NumberIcon({ number }: { number: number }) { | |||||||||||
return ( | ||||||||||||
<EuiFlexGroup | ||||||||||||
justifyContent="spaceAround" | ||||||||||||
className="xyAnnotationNumberIcon" | ||||||||||||
css={styles.xyAnnotationNumberIcon} | ||||||||||||
data-test-subj="xyVisGroupedAnnotationIcon" | ||||||||||||
gutterSize="none" | ||||||||||||
alignItems="center" | ||||||||||||
> | ||||||||||||
<EuiText color="ghost" className="xyAnnotationNumberIcon__text"> | ||||||||||||
<EuiText color="ghost" css={[useEuiFontSize('xxxs'), styles.xyAnnotationNumberIconText]}> | ||||||||||||
{number < 10 ? number : `9+`} | ||||||||||||
</EuiText> | ||||||||||||
</EuiFlexGroup> | ||||||||||||
|
@@ -176,12 +178,14 @@ export const AnnotationIcon = ({ | |||||||||||
if (!iconConfig) { | ||||||||||||
return null; | ||||||||||||
} | ||||||||||||
|
||||||||||||
return ( | ||||||||||||
<EuiIcon | ||||||||||||
{...rest} | ||||||||||||
data-test-subj="xyVisAnnotationIcon" | ||||||||||||
type={iconConfig.icon || type} | ||||||||||||
className={iconConfig.shouldRotate ? rotateClassName : undefined} | ||||||||||||
css={styles.xyAnnotationIconRotate90} | ||||||||||||
mariairiartef marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
/> | ||||||||||||
); | ||||||||||||
}; | ||||||||||||
|
@@ -221,3 +225,24 @@ export function Marker({ | |||||||||||
} | ||||||||||||
return null; | ||||||||||||
} | ||||||||||||
|
||||||||||||
const styles = { | ||||||||||||
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({ | ||||||||||||
Comment on lines
+236
to
+248
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As you have done in the |
||||||||||||
'&.xyAnnotationIcon_rotate90': { | ||||||||||||
transform: 'rotate(90deg) !important', | ||||||||||||
transformOrigin: 'center', | ||||||||||||
}, | ||||||||||||
}), | ||||||||||||
}; |
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:
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