-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EuiHorizontalRule] convert horizontal rule to emotion (#5815)
* converted EuiHorizontalRule to emotion * changelog * Update upcoming_changelogs/5815.md Co-authored-by: Constance <constancecchen@users.noreply.github.com> * Update upcoming_changelogs/5815.md Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src/components/horizontal_rule/horizontal_rule.styles.ts Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src/components/horizontal_rule/horizontal_rule.styles.ts Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * Update src/components/horizontal_rule/horizontal_rule.styles.ts Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> * include a shouldRenderCustomStyles test Co-authored-by: Constance <constancecchen@users.noreply.github.com> Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
- Loading branch information
1 parent
3c427b1
commit e26811a
Showing
9 changed files
with
72 additions
and
45 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,54 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { css } from '@emotion/react'; | ||
import { UseEuiTheme } from '../../services'; | ||
|
||
export const euiHorizontalRuleStyles = ({ euiTheme }: UseEuiTheme) => ({ | ||
euiHorizontalRule: css` | ||
border: none; | ||
height: ${euiTheme.border.width.thin}; | ||
background-color: ${euiTheme.border.color}; | ||
flex-shrink: 0; // Ensure when used in flex group, it retains its size | ||
flex-grow: 0; // Ensure when used in flex group, it retains its size | ||
`, | ||
|
||
// Sizes | ||
full: css` | ||
width: 100%; | ||
`, | ||
half: css` | ||
width: 50%; | ||
margin-inline: auto; | ||
`, | ||
quarter: css` | ||
width: 25%; | ||
margin-inline: auto; | ||
`, | ||
|
||
// Margins | ||
none: '', | ||
xs: css` | ||
margin-block: ${euiTheme.size.s}; | ||
`, | ||
s: css` | ||
margin-block: ${euiTheme.size.m}; | ||
`, | ||
m: css` | ||
margin-block: ${euiTheme.size.base}; | ||
`, | ||
l: css` | ||
margin-block: ${euiTheme.size.l}; | ||
`, | ||
xl: css` | ||
margin-block: ${euiTheme.size.xl}; | ||
`, | ||
xxl: css` | ||
margin-block: ${euiTheme.size.xxl}; | ||
`, | ||
}); |
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
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,4 @@ | ||
**CSS-in-JS conversions** | ||
|
||
- Converted `EuiHorizontalRule` to emotion; Removed `$ruleMargins` | ||
|