-
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
Style home page header and other misc design tweaks #72481
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.homSolutionsPanel { | ||
margin-top: -$euiSizeXL*2; | ||
margin-top: -$euiSizeXL; | ||
|
||
.homeSolutionsPanel--restrictHalfWidth { | ||
Comment on lines
1
to
4
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. Out of curiosity, any reason/difference between use of class prefix 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. Catherine will clean this one up. |
||
max-width: 50%; | ||
|
@@ -24,97 +24,72 @@ | |
} | ||
} | ||
|
||
.homSolutionsPanel__header { | ||
border-radius: $euiBorderRadius 0 0 $euiBorderRadius; | ||
color: $euiColorEmptyShade; | ||
|
||
img { | ||
position: absolute; | ||
width: auto; | ||
} | ||
} | ||
|
||
.homSolutionsPanel__enterpriseSearch { | ||
.homSolutionsPanel__enterpriseSearchHeader { | ||
background-color: #017d73; | ||
color: $euiColorEmptyShade; | ||
|
||
.homSolutionsPanel__enterpriseSearchTopLeftImage { | ||
.euiImage__img { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
margin-top: $euiSizeS; | ||
height: $euiSizeXL; | ||
width: auto; | ||
} | ||
|
||
.homSolutionsPanel__enterpriseSearchTopLeftImage img { | ||
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 these panel patterns/images are purely cosmetic, would it be better to use CSS background images instead? 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. Probably, yeah. I did a little consolidating of styles here, but the images need more attention. By re-slicing the images, we could simplify the styles further - if the padding was baked in, then we could set all the |
||
top: $euiSizeS; | ||
left: 0; | ||
height: $euiSizeXL; | ||
} | ||
|
||
.homSolutionsPanel__enterpriseSearchBottomRightImage { | ||
.euiImage__img { | ||
position: absolute; | ||
right: 0; | ||
bottom: 0; | ||
height: $euiSizeXL; | ||
width: auto; | ||
margin-bottom: $euiSizeS; | ||
margin-right: $euiSizeS; | ||
} | ||
.homSolutionsPanel__enterpriseSearchBottomRightImage img { | ||
right: $euiSizeS; | ||
bottom: $euiSizeS; | ||
height: $euiSizeXL; | ||
} | ||
} | ||
} | ||
|
||
.homSolutionsPanel__observability { | ||
.homSolutionsPanel__observabilityHeader { | ||
background-color: #c42373; | ||
color: $euiColorEmptyShade; | ||
|
||
.homSolutionsPanel__observabilityTopRightImage { | ||
.euiImage__img { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
height: $euiSizeXL; | ||
width: auto; | ||
margin-top: $euiSizeS; | ||
margin-right: $euiSizeS; | ||
} | ||
|
||
.homSolutionsPanel__observabilityTopRightImage img { | ||
top: $euiSizeS; | ||
right: $euiSizeS; | ||
height: $euiSizeXL; | ||
} | ||
} | ||
} | ||
|
||
.homSolutionsPanel__securitySolution { | ||
.homSolutionsPanel__securitySolutionHeader { | ||
background-color: #343741; | ||
color: $euiColorEmptyShade; | ||
|
||
.homSolutionsPanel__securitySolutionTopLeftImage { | ||
.euiImage__img { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
height: $euiSizeXXL; | ||
width: auto; | ||
margin-top: $euiSize; | ||
margin-left: $euiSize; | ||
} | ||
|
||
.homSolutionsPanel__securitySolutionTopLeftImage img { | ||
top: $euiSizeS; | ||
left: $euiSizeS; | ||
height: $euiSizeXXL; | ||
} | ||
} | ||
} | ||
|
||
.homSolutionsPanel__kibana { | ||
.homSolutionsPanel__kibanaHeader { | ||
background-color: #006bb4; | ||
color: $euiColorEmptyShade; | ||
|
||
.homSolutionsPanel__kibanaTopLeftImage { | ||
.euiImage__img { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
height: $euiSizeXXL * 4; | ||
width: auto; | ||
} | ||
|
||
.homSolutionsPanel__kibanaTopLeftImage img { | ||
top: 0; | ||
left: 0; | ||
height: $euiSizeXXL * 4; | ||
} | ||
|
||
.homSolutionsPanel__kibanaBottomRightImage { | ||
.euiImage__img { | ||
position: absolute; | ||
right: 0; | ||
bottom: 0; | ||
height: $euiSizeXXL * 4; | ||
width: auto; | ||
} | ||
.homSolutionsPanel__kibanaBottomRightImage img { | ||
right: 0; | ||
bottom: 0; | ||
height: $euiSizeXXL * 4; | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
*/ | ||
|
||
import React, { FunctionComponent } from 'react'; | ||
import { EuiButtonEmpty, EuiText } from '@elastic/eui'; | ||
import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { HOME_APP_BASE_PATH } from '../../../../common/constants'; | ||
import { getServices } from '../../kibana_services'; | ||
|
@@ -32,20 +32,26 @@ export const ChangeHomeRoute: FunctionComponent<Props> = ({ defaultRoute }) => { | |
const changeDefaultRoute = () => uiSettings.set('defaultRoute', defaultRoute); | ||
|
||
return ( | ||
<EuiText> | ||
<p> | ||
<FormattedMessage | ||
id="home.changeHomeRouteText" | ||
defaultMessage="Would you prefer to have an alternate home page for this Elastic space? " | ||
/> | ||
<EuiButtonEmpty iconType="home" onClick={changeDefaultRoute}> | ||
<EuiFlexGroup className="homPage__footer" alignItems="center" gutterSize="s"> | ||
<EuiFlexItem grow={false}> | ||
<EuiText size="s" color="subdued"> | ||
<p> | ||
<FormattedMessage | ||
id="home.changeHomeRouteText" | ||
defaultMessage="Would you prefer to have an alternate home page for this Elastic space? " | ||
/> | ||
</p> | ||
</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiButtonEmpty size="xs" iconType="home" onClick={changeDefaultRoute}> | ||
<FormattedMessage | ||
id="home.changeHomeRouteLink" | ||
defaultMessage="Change your home page route" | ||
/> | ||
</EuiButtonEmpty> | ||
</p> | ||
</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
Comment on lines
+35
to
+54
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. I'm wondering if it would be better to not utilize Would it be better to have the button appear inline with the paragraph text, so that if/when the line is broken, the button also moves to the second line (thus avoiding the above odd layout)? 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. Probably so and its worth tinkering with it. The reason I swapped it to use the flex components was to get the text and empty button to align vertically. It was visually misaligned when the button was inlined in the paragraph. |
||
); | ||
}; | ||
|
||
|
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.
Is it necessary to define a fixed height for the home page header here? Ideally, the height of the header would scale to its contents. If only being used to account for the
min-height
in.homPageContainer
, perhaps we can use a flexbox solution instead?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.
This is also worth tinkering with. This fixed height made it simpler, in the end, to account for some of the shaded background color that was showing at the bottom of the screen. In other words, I was able to also use this value to resolve that issue. That said, it might be the culprit that generated the bottom 'band' 🤔