Skip to content

Commit

Permalink
feat(ui5-tabcontainer): add tabstrip Shadow Part (#7989)
Browse files Browse the repository at this point in the history
adds tabstrip CSS Shadow Part to allow styling of the respective element - mostly its padding.

Fixes: #6035
  • Loading branch information
ilhan007 authored Dec 12, 2023
1 parent a265a65 commit 0cbbd16
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/main/src/TabContainer.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class="{{classes.header}}"
id="{{_id}}-header"
@focusin="{{_onHeaderFocusin}}"
part="tabstrip"
>
<div
class="ui5-tc__overflow ui5-tc__overflow--start"
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/TabContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ interface TabContainerTabInOverflow extends CustomListItem {
* <br>
* The <code>ui5-tabcontainer</code> exposes the following CSS Shadow Parts:
* <ul>
* <li>tabstrip - Used to style the tabstrip of the component</li>
* <li>content - Used to style the content of the component</li>
* </ul>
*
Expand Down
31 changes: 31 additions & 0 deletions packages/main/test/pages/TabContainer.html
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,37 @@ <h3>Add new selected tab programmatically</h3>

</section>


<section>
<h3>Custom padding</h3>
<style>
.customPadding::part(tabstrip) {
padding: 0;
}
.customPadding::part(content) {
padding: 0;
}
</style>
<ui5-tabcontainer class="customPadding">
<ui5-tab text="One">
<ui5-button>Button 1</ui5-button>
</ui5-tab>
<ui5-tab-separator>
<ui5-button>Button 2</ui5-button>
</ui5-tab-separator>
<ui5-tab text="Two">
<ui5-button>Button 3</ui5-button>
</ui5-tab>
<ui5-tab text="Three">
<ui5-button>Button 4</ui5-button>
</ui5-tab>
<ui5-tab text="Four">
<ui5-button>Button 5</ui5-button>
</ui5-tab>
<ui5-tab text="Five">Tab Content</ui5-tab>
</ui5-tabcontainer>
</section>

<script>
document.getElementById("tabContainer1").addEventListener("ui5-tab-select", async function (event) {
result.innerHTML = event.detail.tab.text;
Expand Down

0 comments on commit 0cbbd16

Please sign in to comment.