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(ui5-tab): semantic icon is properly aligned in high contrast themes #10467

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
12 changes: 6 additions & 6 deletions packages/main/src/themes/TabInOverflow.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
display: none;
}

.ui5-tab-semantic-icon {
position: absolute;
inset-inline-start: -0.25rem;
}

.ui5-tab-overflow-item--positive:not(.ui5-tab-overflow-item--disabled) .ui5-tab-overflow-itemContent {
color: var(--_ui5_tc_overflowItem_positive_color);
}
Expand All @@ -45,9 +40,14 @@
}

.ui5-tab-overflow-itemContent-wrapper {
padding-inline-start: calc(var(--_ui5-tab-indentation-level) * 0.5rem + var(--_ui5-tab-extra-indent, 0) * var(--_ui5_tc_overflowItem_extraIndent));
padding-inline-start: calc(var(--_ui5-tab-indentation-level) * var(--_ui5-tab-indent-multiplier) + var(--_ui5-tab-extra-indent, 0) * var(--_ui5_tc_overflowItem_extraIndent));
}

.ui5-tab-overflow-item .ui5-tab-semantic-icon {
position: absolute;
inset-inline-start: -1.5rem;
}

.ui5-tab-overflow-item--selectedSubTab {
background-color: var(--sapList_SelectionBackgroundColor);
}
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/themes/base/TabContainer-parameters.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
--_ui5_tc_overflowItem_critical_color: var(--sapCriticalColor);
--_ui5_tc_overflowItem_focus_offset: 0.125rem;
--_ui5_tc_overflowItem_extraIndent: 0rem;
--_ui5-tab-indent-multiplier: 0.5rem;

/* Header Item icons */
--_ui5_tc_headerItemIcon_border: 1px solid var(--sapHighlightColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
--_ui5_tc_overflowItem_critical_color: var(--sapGroup_TitleTextColor);
--_ui5_tc_overflowItem_default_color: var(--sapGroup_TitleTextColor);
--_ui5_tc_overflowItem_current_color: var(--_ui5_tc_overflowItem_default_color);
--_ui5_tc_overflowItem_extraIndent: 1rem;
--_ui5_tc_overflowItem_extraIndent: 1.5rem;
--_ui5-tab-indent-multiplier: 1.5rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
--_ui5_tc_overflowItem_critical_color: var(--sapGroup_TitleTextColor);
--_ui5_tc_overflowItem_default_color: var(--sapGroup_TitleTextColor);
--_ui5_tc_overflowItem_current_color: var(--_ui5_tc_overflowItem_default_color);
--_ui5_tc_overflowItem_extraIndent: 1rem;
--_ui5_tc_overflowItem_extraIndent: 1.5rem;
--_ui5-tab-indent-multiplier: 1.5rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
--_ui5_tc_overflowItem_critical_color: var(--sapTextColor);
--_ui5_tc_overflowItem_default_color: var(--sapTextColor);
--_ui5_tc_overflowItem_current_color: var(--_ui5_tc_overflowItem_default_color);
--_ui5_tc_overflowItem_extraIndent: 1rem;
--_ui5_tc_overflowItem_extraIndent: 1.5rem;
--_ui5-tab-indent-multiplier: 1.5rem;

/* Overflow Buttons*/
--_ui5_tc_overflow_text_color: var(--sapTextColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
--_ui5_tc_overflowItem_critical_color: var(--sapTextColor);
--_ui5_tc_overflowItem_default_color: var(--sapTextColor);
--_ui5_tc_overflowItem_current_color: var(--_ui5_tc_overflowItem_default_color);
--_ui5_tc_overflowItem_extraIndent: 1rem;
--_ui5_tc_overflowItem_extraIndent: 1.5rem;
--_ui5-tab-indent-multiplier: 1.5rem;

/* Overflow Buttons*/
--_ui5_tc_overflow_text_color: var(--sapTextColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
--_ui5_tc_overflowItem_critical_color: var(--sapTextColor);
--_ui5_tc_overflowItem_default_color: var(--sapTextColor);
--_ui5_tc_overflowItem_current_color: var(--_ui5_tc_overflowItem_default_color);
--_ui5_tc_overflowItem_extraIndent: 1rem;
--_ui5_tc_overflowItem_extraIndent: 1.5rem;
--_ui5-tab-indent-multiplier: 1.5rem;

/* Overflow Buttons*/
--_ui5_tc_overflow_text_color: var(--sapTextColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
--_ui5_tc_overflowItem_critical_color: var(--sapTextColor);
--_ui5_tc_overflowItem_default_color: var(--sapTextColor);
--_ui5_tc_overflowItem_current_color: var(--_ui5_tc_overflowItem_default_color);
--_ui5_tc_overflowItem_extraIndent: 1rem;
--_ui5_tc_overflowItem_extraIndent: 1.5rem;
--_ui5-tab-indent-multiplier: 1.5rem;

/* Overflow Buttons*/
--_ui5_tc_overflow_text_color: var(--sapTextColor);
Expand Down
26 changes: 26 additions & 0 deletions packages/main/test/pages/TabContainer.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,32 @@ <h2>Text only End Overflow</h2>
</ui5-tabcontainer>
</section>

<section>
<h2>Semantic States Overflow</h2>
<ui5-tabcontainer id="semanticOverflow">
<ui5-tab design="Positive" text="Home"></ui5-tab>
<ui5-tab design="Critical" text="Notifications"></ui5-tab>
<ui5-tab design="Negative" text="Settings"></ui5-tab>
<ui5-tab design="Positive" text="One"></ui5-tab>

<ui5-tab design="Critical" text="Two">
<ui5-tab design="Positive" slot="items" text="nested one"></ui5-tab>
<ui5-tab design="Positive" slot="items" text="nested two"></ui5-tab>
</ui5-tab>

<ui5-tab text="Three"></ui5-tab>
<ui5-tab design="Negative" text="Four">
<ui5-tab design="Positive" slot="items" text="four one">
<ui5-tab design="Positive" slot="items" text="4.1.1."></ui5-tab>
<ui5-tab design="Critical" slot="items" text="4.1.2."></ui5-tab>
</ui5-tab>
<ui5-tab design="Positive" slot="items" text="four two"></ui5-tab>
</ui5-tab>

<ui5-tab design="Negative" text="Five"></ui5-tab>
</ui5-tabcontainer>
</section>

<section>
<h2>Text only Start And End Overflow</h2>
<ui5-tabcontainer id="tabContainerStartAndEndOverflow" overflow-mode="StartAndEnd" collapsed>
Expand Down
Loading