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

refactor(tabs): align component with UI kits #14889

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@

$item-min-width: rem(90px);
$item-max-width: rem(360px);
$item-min-height: map.get((
'material': rem(48px),
'fluent': rem(44px),
'bootstrap': rem(48px),
'indigo': rem(40px)
), $variant);

$tabs-animation-function: cubic-bezier(.35, 0, .25, 1);

Expand Down Expand Up @@ -354,10 +360,11 @@
@include ripple($button-ripple-theme);
@include css-vars($button-ripple-theme);

@if $variant == 'indigo' {
igx-icon {
--component-size: 2;
}
igx-icon {
$icon-size: #{if($variant == 'indigo', rem(16px), rem(24px))};

--ig-icon-size: #{$icon-size};
--igx-icon-size: #{$icon-size};
}

[dir='rtl'] & {
Expand All @@ -378,7 +385,7 @@
align-items: center;
min-width: $item-min-width;
max-width: $item-max-width;
min-height: #{if($variant == 'indigo', rem(40px), rem(42px))};
min-height: $item-min-height;
word-wrap: break-word;
// Flex basis & shrink are Needed for IE11
flex-basis: auto;
Expand Down Expand Up @@ -497,6 +504,12 @@
}
}

@if $variant == 'fluent' {
%tabs-header-item-inner > [igxtabheaderlabel] {
font-weight: 600;
}
}

@if $indigo-theme {
&:hover,
&:focus-visible {
Expand Down Expand Up @@ -635,7 +648,7 @@
@mixin tabs-typography($categories: (label: 'button')) {
$label: map.get($categories, 'label');

%tabs-header-item-inner > [igxtabheaderlabel]{
%tabs-header-item-inner > [igxtabheaderlabel] {
@include type-style($label) {
margin-top: 0;
margin-bottom: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@
@include switch-typography($categories: (
label: 'body-2'
));
@include tabs-typography();
@include tabs-typography($categories: (
label: 'body-2'
));
@include time-picker-typography();
@include stepper-typography();
@include toast-typography($categories: (
Expand Down
16 changes: 15 additions & 1 deletion src/app/tabs/tabs.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h3 class="sample-title">Different size tabs</h3>
</div>
<igx-tabs
#tabsNew
[selectedIndex]="3"
[selectedIndex]="2"
(selectedIndexChanging)="tabsSelectedIndexChanging($event)"
(selectedItemChange)="tabsSelectedItemChange($event)"
>
Expand Down Expand Up @@ -221,6 +221,20 @@ <h3 class="sample-title">Alignment</h3>
</igx-tabs>
</div>

<div>
<h3 class="sample-title">Short Tabs with scroll</h3>
<igx-tabs>
<igx-tab-item *ngFor="let tab of scrollableTabs;">
<igx-tab-header>
<span igxTabHeaderLabel>Lorem ipsum. {{tab}}</span>
</igx-tab-header>
<igx-tab-content>
Content of {{tab}}
</igx-tab-content>
</igx-tab-item>
</igx-tabs>
</div>

<div>
<h3 class="sample-title">Tabs with scroll</h3>
<igx-tabs>
Expand Down
Loading