Skip to content

Commit

Permalink
feat(ui5-tabcontainer): Responsive paddings are now supported
Browse files Browse the repository at this point in the history
fixes SAP#2539
  • Loading branch information
TeodorTaushanov committed Feb 5, 2021
1 parent e687879 commit aaf40e0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/base/src/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ const _getCurrentRange = (name, width = window.innerWidth) => {
}
}

return query.names[i];
return querySet.names[i];
};

const _setMedia = () => {
Expand Down
22 changes: 20 additions & 2 deletions packages/main/src/themes/TabContainer.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
position: relative;
display: flex;
height: calc(100% - var(--_ui5_tc_header_height)); /* the header height (tabs with icons and text) */
padding: 1rem;
padding: 1rem 2rem;
background-color: var(--sapGroup_ContentBackground);
border-bottom: var(--_ui5_tc_content_border_bottom);
box-sizing: border-box;
Expand All @@ -124,7 +124,7 @@
}

.ui5-tc__contentItem {
max-height: 100%;
max-height: 100%;
display: flex;
flex-grow: 1;
overflow: auto;
Expand All @@ -134,6 +134,24 @@
display: none;
}

/*** Responsive paddings ***/

:host([size="S"]) .ui5-tc__header {
padding: 0;
}

:host([size="S"]) .ui5-tc__content {
padding: 1rem;
}

:host([size="XL"]) .ui5-tc__header {
padding: 0 2rem;
}

:host([size="XL"]) .ui5-tc__content {
padding: 1rem 3rem;
}

/*** RTL ***/
[dir=rtl] .ui-tc__overflowButton {
margin-right: auto;
Expand Down
7 changes: 6 additions & 1 deletion packages/main/src/themes/TabInStrip.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@
.ui5-tab-strip-item--selected .ui5-tab-strip-item-icon-outer::after {
content: "";
position: absolute;
width: 100%;
bottom: 1px;
left: 0;
right: 0;
border-bottom: var(--_ui5_tc_headerItemContent_border_bottom);
}

.ui5-tab-strip-item--selected.ui5-tab-strip-item--textOnly .ui5-tab-strip-itemContent::after {
left: 1rem;
right: 1rem;
}

.ui5-tab-strip-item--selected .ui5-tab-strip-item-icon-outer::after {
bottom: -0.75rem;
}
Expand Down

0 comments on commit aaf40e0

Please sign in to comment.