Skip to content
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

fix(styles): design fixes for tool header [ci visual] #4688

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
310 changes: 301 additions & 9 deletions packages/styles/src/tool-header.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import "./new-settings";
@import "./mixins";
@import "./mixins/button/button-helper";

$block: #{$fd-namespace}-tool-header;
$fd-tool-header-height: 2.75rem !default;
Expand Down Expand Up @@ -68,6 +69,9 @@ $fd-tool-header-object-status-semantic-values: (
);

.#{$block} {
// Paddings
$fd-tool__header-item-spacing: 0.5rem !default;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for SCSS variables we only use -. For example: $fd-tool-header-item-spacing


@include fd-reset();

@include fd-flex-vertical-center() {
Expand All @@ -84,6 +88,20 @@ $fd-tool-header-object-status-semantic-values: (
&__group {
@include fd-reset();
@include fd-flex-vertical-center();

&--center {
display: none;
justify-content: center;
margin: 0 $fd-tool__header-item-spacing;

.#{$block}__action {
width: 100%;
}

@include fd-media-xl() {
display: inline-block;
}
}
}

&__element {
Expand Down Expand Up @@ -244,21 +262,295 @@ $fd-tool-header-object-status-semantic-values: (
}
}

.#{$block}__input-group {
background: var(--sapShellColor);
border: 0.0625rem solid var(--sapShell_InteractiveBorderColor);
.#{$block}__search-field {
--fdSelect_Text_Content_Color: var(--fdShellbar_Select_Content_Color);
--fdInputGroup_Input_Border: var(--fdShellbar_Input_Border);
--fdInputGroup_Input_Color: var(--fdShellbar_Input_Color);
--fdInputGroup_Input_Placeholder_Color: var(--fdShellbar_Input_Placeholder_Color);
--fdInputGroup_Input_Placeholder_Style: var(--fdShellbar_Input_Placeholder_Style);
--fdInputGroup_Background: none;
--fdInputGroup_Background_Color: var(--fdShellbar_Input_Background);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the variables starting with --fdShellbar.... should be duplicated for Tool Header, in my opinion. They should be moved to their own files and renamed to --fdToolHeader....
This will avoid the situation where the design for ShellBar changes but for Tool Header doesn't. By using the same CSS variables you are making Tool Header dependant on ShellBar, and they shouldn't be.

--fdInputGroup_Hover_Background: none;
--fdInput_Group_Button_Box_Shadow: none;
--fdInput_Box_Shadow_Hover: none;

box-shadow: none;
border: var(--fdShellbar_Search_Border);
border-radius: var(--fdShellbar_Input_Border_Radius);
position: relative;
cursor: text;

&-helper {
display: var(--fdShellbar_Helper_Display);

&::before,
&::after {
position: absolute;
content: "";
z-index: 20;
pointer-events: none;
box-shadow: var(--sapField_Shadow);
border-radius: var(--fdShellbar_Input_Border_Radius);

@include fd-set-equal-positions(0);
}

input {
color: var(--sapShell_TextColor);
&::after {
box-shadow: var(--fdShellbar_Helper_Bottom_Shadow);
border-radius: 0;
}
}

&-input {
position: relative;

@include fd-set-paddings-x-equal(var(--fdShellbar_Search_Input_X_Padding));

@include fd-hover() {
--fdInputGroup_Hover_Input_Background: var(--fdShellbar_Input_Hover_Background);
--fdInputGroup_Addon_Background: var(--fdShellbar_Search_Container_Hover_Background);
& ~ .#{$block}__search-field-addon {
--fdInputGroup_Addon_Background: var(--fdShellbar_Search_Container_Hover_Background);
}

& ~ .#{$block}__search-field-helper {
&::after {
box-shadow: inset 0 -0.0625rem 0 var(--sapField_Hover_BorderColor);
}
}
}

@include fd-focus() {
--fdInputGroup_Input_Color: var(--fdShellbar_Input_Focus_Color);
--fdInputGroup_Input_Background: var(--fdShellbar_Input_Focus_Background);
}

&:placeholder-shown {
& ~ .#{$block}__search-cancel {
display: none;
}
}

&:not(:placeholder-shown) {
& ~ .#{$block}__search-submit {
> * {
--fdButtonBackgroundColor: var(--fdShellbar_Search_Active_Button_Background);
--fdButtonColor: var(--fdShellbar_Search_Active_Button_Color);
--fdShellbar_Button_Active_Background: var(--fdButtonBackgroundColor);
--fdShellbar_Button_Active_Color: var(--fdShellbar_Search_Active_Button_Color);

@include fd-set-border-left(var(--fdShellbar_Button_Left_Border));

&:hover {
--fdButtonBackgroundColor: var(--fdShellbar_Search_Active_Button_Hover_Background);
}
}
}
}

&--select {
@include fd-flex-vertical-center();

font-style: normal;
height: 100%;
flex: 0 1;
}
}

&-addon {
@include fd-flex-vertical-center() {
height: 100%;
flex: 0 1;
}

.#{$block}__button {
--fdButton_Outline_Offset: 0;
--fdButton_Focus_Border_Radius: var(--fdShellbar_Input_Border_Radius);

height: var(--fdShellbar_Input_Addon_Dimension);
min-width: var(--fdShellbar_Input_Addon_Dimension);
border-radius: var(--fdShellbar_Input_Border_Radius);
border-width: var(--fdShellbar_Input_Addon_Border_Width);

@include fd-hover () {
@include fd-set-border-left(var(--fdShellbar_Button_Left_Border));

--fdButtonBackgroundColor: var(--fdShellbar_Search_Button_Hover_Background);
}

@include fd-active() {
border-color: var(--fdShellbar_Button_Active_Border_Color);
}
}
}

.#{$block}__search-field-category {
flex-shrink: 0;

@include fd-hover() {
--fdInputGroup_Addon_Background: var(--fdShellbar_Input_Background);
& ~ .#{$block}__search-field-input,
& ~ .#{$block}__search-field-addon {
--fdInputGroup_Addon_Background: var(--fdShellbar_Input_Background);
--fdInputGroup_Input_Background: var(--fdShellbar_Input_Background);
}

.#{$block}__search-category {
box-shadow: var(--sapContent_Interaction_Shadow);
}

&::placeholder {
color: var(--sapShell_InteractiveTextColor);
.#{$block}__search-dropdown {
background-color: var(--fdShellbar_Search_Category_Button_Hover_Background);
}
}

> * {
@include fd-set-margin-right(var(--fdShellbar_Search_Category_Offset_Right));
@include fd-set-margins-y-equal();
}
.#{$block}__search-dropdown {
background-color: var(--fdShellbar_Input_Background);
outline: none;
position: static;

--fdInput_Group_Button_Background: transparent;
--fdInput_Group_Button_Text_Color: var(--sapShell_InteractiveTextColor);

@include fd-focus() {
&::after {
display: none;
}
}
}
.#{$block}__search-category {
--fdSelect_Background: transparent;
--fdSelect_Hover_Background: transparent;
--fdSelect_Focus_Background: transparent;
--fdSelect_Background_Color: var(--fdShellbar_Input_Background);
--fdSelect_Hover_Background_Color: var(--fdShellbar_Input_Background);

border: var(--fdShellbar_Search_Category_Border);
border-width: var(--fdShellbar_Search_Category_Border_width);
border-radius: 0;
min-height: var(--fdShellbar_Input_Addon_Dimension);
height: var(--fdShellbar_Input_Addon_Dimension);
margin: 0;
position: relative;

@include fd-set-margin-left(var(--fdShellbar_Search_Category_Offset_Left));

&::after {
box-shadow: none;
}

&::before {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
background: var(--sapShell_InteractiveBorderColor);
width: 0.0625rem;
display: var(--fdShellbar_Search_Separator_Display);
}

@include fd-rtl() {
&::before {
left: 0;
right: auto;
}
}

@include fd-focus() {
--fdSelect_Text_Content_Color: var(--sapButton_Active_TextColor);
--fdShellbar_Input_Background: var(--fdShellbar_Search_Category_Button_Hover_Background);
--fdSelect_Focus_Background: var(--fdShellbar_Search_Container_Hover_Background);

border-radius: var(--fdShellbar_Input_Border_Radius);
outline-color: var(--sapButton_Lite_Active_BorderColor);
outline-width: 0.0625rem;
outline-offset: -0.0625rem;

.#{$block}__search-dropdown {
--fdInput_Group_Button_Text_Color: var(--sapButton_Active_TextColor);
}

&::before {
display: none;
}
}
}
}

@include fd-hover() {
background: var(--sapShell_Hover_Background);
border-color: var(--sapShell_InteractiveBorderColor);
--fdInputGroup_Hover_Background_Color: var(--fdShellbar_Search_Container_Hover_Background);

.#{$block}__search-field-helper {
&::before {
box-shadow: var(--sapField_Hover_Shadow);
}

&::after {
box-shadow: var(--fdShellbar_Hover_Helper_Bottom_Shadow);
}
}

.#{$block}__search-field {
&-category .#{$block}__search-category {
--fdSelect_Background_Color: var(--fdShellbar_Search_Container_Hover_Background);
--fdSelect_Hover_Background_Color: var(--fdShellbar_Search_Container_Hover_Background);

@include fd-hover() {
border-radius: var(--fdShellbar_Input_Border_Radius);

&::before {
display: none;
}
}
}
}

.#{$block}__search-field-category:not(:hover) {
.#{$block}__search-dropdown {
background-color: var(--fdShellbar_Search_Container_Hover_Background);
}
}
}

@include fd-focus() {
outline: none;
box-shadow: var(--fdShellbar_Active_Shadow);
background-color: var(--fdShellbar_Active_Background);

.#{$block}__search-field-helper {
&::before {
outline: var(--fdShellbar_Search_Active_Outline);
outline-offset: -0.125rem;
}

&::after,
&::before {
box-shadow: none;
}
}

.#{$block}__search-field-addon {
--fdInputGroup_Addon_Background: var(--fdShellbar_Search_Hover_Background);
}

.#{$block}__search-category {
background-color: var(--fdShellbar_Search_Hover_Background);

&::before {
// display: none;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not needed, please remove

}

.#{$block}__search-field-category {
.#{$block}__search-dropdown {
background-color: var(--fdShellbar_Search_Hover_Category_Button_Background);
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,19 @@ <h4>Size XL (3rem)</h4>
</button>
</div>
</div>
<div class="fd-tool-header__group">
<div class="fd-tool-header__group--center">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't have a modifier class like fd-tool-header__group--center without the base class fd-tool-header__group. It should be:

fd-tool-header__group fd-tool-header__group--center

<div class="fd-tool-header__element">
<div class="fd-input-group fd-tool-header__input-group">
<input class="fd-input fd-input-group__input" type="text" id="aqwsdewfwfw" name="" placeholder="Search...">
<div class="fd-input-group fd-tool-header__input-group fd-tool-header__search-field">
<input class="fd-input fd-input-group__input fd-tool-header__search-field-input" type="text" id="aqwsdewfwfw" name="" placeholder="Search...">
<span class="fd-input-group__addon fd-input-group__addon--button">
<button class="fd-input-group__button fd-button fd-button--icon fd-button--transparent fd-tool-header__button" aria-label="Select">
<i class="sap-icon--navigation-down-arrow"></i>
<button class="fd-input-group__button fd-button fd-button--icon fd-button--transparent fd-tool-header__button" aria-label="Search">
<i class="sap-icon--search"></i>
</button>
</span>
</span>
</div>
</div>
</div>
<div class="fd-tool-header__group">
<div class="fd-tool-header__element">
<button class="fd-button fd-button--transparent fd-tool-header__button" aria-label="notification">
<i class="sap-icon--bell"></i>
Expand Down
11 changes: 7 additions & 4 deletions packages/styles/stories/Components/tool-header/menu.example.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@ <h4 class="fd-title fd-title--h5 fd-tool-header__title">Product Name</h4>
<label class="fd-text fd-tool-header__text" for="input-1">Description (Text Element)</label>
</div>
</div>
<div class="fd-tool-header__group">
<div class="fd-tool-header__group--center">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above comment

<div class="fd-tool-header__element">
<div class="fd-input-group fd-tool-header__input-group">
<input class="fd-input fd-input-group__input" type="text" id="aqwsdewfwfw" name="" placeholder="Search...">
<div class="fd-input-group fd-tool-header__input-group fd-tool-header__search-field">
<input class="fd-input fd-input-group__input fd-tool-header__search-field-input" type="text" id="aqwsdewfwfw" name="" placeholder="Search...">
<span class="fd-input-group__addon fd-input-group__addon--button">
<button class="fd-input-group__button fd-button fd-button--icon fd-button--transparent fd-tool-header__button" aria-label="Search">
<i class="sap-icon--search"></i>
</button>
</span>
</span>
</div>
</div>
</div>
<div class="fd-tool-header__group">

<div class="fd-tool-header__element">
<button class="fd-button fd-button--transparent fd-tool-header__button" aria-label="task">
<i class="sap-icon--circle-task"></i>
Expand Down
Loading