forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SecuritySolution] Onboarding page centralize duplicated styles (elas…
…tic#202229) ## Summary There is no visual change, just a refactor to remove duplicate code from cards to centralized places.
- Loading branch information
1 parent
d217a19
commit 15510b8
Showing
9 changed files
with
87 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...on/public/onboarding/components/onboarding_body/cards/common/card_content_panel.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { css } from '@emotion/css'; | ||
import { COLOR_MODES_STANDARD, useEuiTheme } from '@elastic/eui'; | ||
import { useDarkPanelStyles } from '../../onboarding_card_panel.styles'; | ||
|
||
export const NESTED_PANEL_CLASS_NAME = 'onboardingCardContentPanelNested'; | ||
|
||
export const useCardContentPanelStyles = () => { | ||
const { euiTheme, colorMode } = useEuiTheme(); | ||
const darkPanelStyles = useDarkPanelStyles(colorMode === COLOR_MODES_STANDARD.dark); | ||
|
||
return css` | ||
padding-top: 0; | ||
${darkPanelStyles} | ||
.${NESTED_PANEL_CLASS_NAME} { | ||
padding-top: ${euiTheme.size.s}; | ||
${darkPanelStyles} | ||
} | ||
`; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
..._solution/public/onboarding/components/onboarding_body/cards/common/card_subdued_text.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React, { type PropsWithChildren } from 'react'; | ||
import { EuiText, useEuiTheme, COLOR_MODES_STANDARD, type EuiTextProps } from '@elastic/eui'; | ||
|
||
export type CardSubduedTextProps = PropsWithChildren<EuiTextProps>; | ||
export const CardSubduedText = React.memo<CardSubduedTextProps>(({ children, ...props }) => { | ||
const { colorMode } = useEuiTheme(); | ||
const isDarkMode = colorMode === COLOR_MODES_STANDARD.dark; | ||
return ( | ||
<EuiText {...props} color={isDarkMode ? 'text' : 'subdued'}> | ||
{children} | ||
</EuiText> | ||
); | ||
}); | ||
CardSubduedText.displayName = 'CardSubduedText'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters