Skip to content

Commit

Permalink
feat(tabstrip): add styles for different sizes and hidden scroll buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
inikolova committed Dec 20, 2024
1 parent 220d261 commit 7603ff8
Show file tree
Hide file tree
Showing 9 changed files with 676 additions and 6 deletions.
78 changes: 77 additions & 1 deletion packages/bootstrap/scss/tabstrip/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ $kendo-tabstrip-line-height: var( --kendo-line-height, normal ) !default;
/// @group tabstrip
$kendo-tabstrip-border-width: 1px !default;

/// The font size of the small TabStrip.
/// @group tabstrip
$kendo-tabstrip-sm-font-size: var( --kendo-font-size-sm, inherit ) !default;
/// The line height of the small TabStrip.
/// @group tabstrip
$kendo-tabstrip-sm-line-height: $kendo-tabstrip-line-height !default;
/// The font size of the medium TabStrip.
/// @group tabstrip
$kendo-tabstrip-md-font-size: $kendo-tabstrip-font-size !default;
/// The line height of the medium TabStrip.
/// @group tabstrip
$kendo-tabstrip-md-line-height: $kendo-tabstrip-line-height !default;
/// The font size of the large TabStrip.
/// @group tabstrip
$kendo-tabstrip-lg-font-size: $kendo-tabstrip-md-font-size !default;
/// The line height of the large TabStrip.
/// @group tabstrip
$kendo-tabstrip-lg-line-height: $kendo-tabstrip-md-line-height !default;

/// The background color of the TabStrip wrapper.
/// @group tabstrip
$kendo-tabstrip-wrapper-bg: null !default;
Expand Down Expand Up @@ -62,6 +81,24 @@ $kendo-tabstrip-item-border-radius: k-spacing(1) !default;
/// The gap between the TabStrip items.
/// @group tabstrip
$kendo-tabstrip-item-gap: k-spacing(0) !default;
/// The horizontal padding of the small TabStrip items.
/// @group tabstrip
$kendo-tabstrip-sm-item-padding-x: k-spacing(3) !default;
/// The vertical padding of the small TabStrip items.
/// @group tabstrip
$kendo-tabstrip-sm-item-padding-y: k-spacing(1.5) !default;
/// The horizontal padding of the medium TabStrip items.
/// @group tabstrip
$kendo-tabstrip-md-item-padding-x: $kendo-tabstrip-item-padding-x !default;
/// The vertical padding of the medium TabStrip items.
/// @group tabstrip
$kendo-tabstrip-md-item-padding-y: $kendo-tabstrip-item-padding-y !default;
/// The horizontal padding of the large TabStrip items.
/// @group tabstrip
$kendo-tabstrip-lg-item-padding-x: k-spacing(5) !default;
/// The vertical padding of the large TabStrip items.
/// @group tabstrip
$kendo-tabstrip-lg-item-padding-y: k-spacing(2.5) !default;

/// The background color of the TabStrip items.
/// @group tabstrip
Expand Down Expand Up @@ -162,6 +199,32 @@ $kendo-tabstrip-content-border: $kendo-component-border !default;
/// @group tabstrip
$kendo-tabstrip-content-focus-border: $kendo-component-text !default;

/// The left and right scroll overlay of the TabStrip.
/// @group tabstrip
$kendo-tabstrip-scroll-overlay: if($kendo-enable-color-system, k-color( app-surface ), rgba( $kendo-color-white, 0)), if($kendo-enable-color-system, color-mix(in srgb, k-color( app-surface ) 0%, transparent), rgba( $kendo-color-white, 0)) !default;

/// The size map of the TabStrip.
/// @group tabstrip
$kendo-tabstrip-sizes: (
sm: (
font-size: $kendo-tabstrip-sm-font-size,
line-height: $kendo-tabstrip-sm-line-height,
item-padding-x: $kendo-tabstrip-sm-item-padding-x,
item-padding-y: $kendo-tabstrip-sm-item-padding-y
),
md: (
font-size: $kendo-tabstrip-md-font-size,
line-height: $kendo-tabstrip-md-line-height,
item-padding-x: $kendo-tabstrip-md-item-padding-x,
item-padding-y: $kendo-tabstrip-md-item-padding-y
),
lg: (
font-size: $kendo-tabstrip-lg-font-size,
line-height: $kendo-tabstrip-lg-line-height,
item-padding-x: $kendo-tabstrip-lg-item-padding-x,
item-padding-y: $kendo-tabstrip-lg-item-padding-y
)
) !default;

@forward "@progress/kendo-theme-default/scss/tabstrip/_variables.scss" with (
$kendo-tabstrip-wrapper-padding-x: $kendo-tabstrip-wrapper-padding-x,
Expand All @@ -171,6 +234,12 @@ $kendo-tabstrip-content-focus-border: $kendo-component-text !default;
$kendo-tabstrip-font-size: $kendo-tabstrip-font-size,
$kendo-tabstrip-line-height: $kendo-tabstrip-line-height,
$kendo-tabstrip-border-width: $kendo-tabstrip-border-width,
$kendo-tabstrip-sm-font-size: $kendo-tabstrip-sm-font-size,
$kendo-tabstrip-sm-line-height: $kendo-tabstrip-sm-line-height,
$kendo-tabstrip-md-font-size: $kendo-tabstrip-md-font-size,
$kendo-tabstrip-md-line-height: $kendo-tabstrip-md-line-height,
$kendo-tabstrip-lg-font-size: $kendo-tabstrip-lg-font-size,
$kendo-tabstrip-lg-line-height: $kendo-tabstrip-lg-line-height,
$kendo-tabstrip-wrapper-bg: $kendo-tabstrip-wrapper-bg,
$kendo-tabstrip-wrapper-text: $kendo-tabstrip-wrapper-text,
$kendo-tabstrip-wrapper-border: $kendo-tabstrip-wrapper-border,
Expand All @@ -182,6 +251,12 @@ $kendo-tabstrip-content-focus-border: $kendo-component-text !default;
$kendo-tabstrip-item-border-width: $kendo-tabstrip-item-border-width,
$kendo-tabstrip-item-border-radius: $kendo-tabstrip-item-border-radius,
$kendo-tabstrip-item-gap: $kendo-tabstrip-item-gap,
$kendo-tabstrip-sm-item-padding-x: $kendo-tabstrip-sm-item-padding-x,
$kendo-tabstrip-sm-item-padding-y: $kendo-tabstrip-sm-item-padding-y,
$kendo-tabstrip-md-item-padding-x: $kendo-tabstrip-md-item-padding-x,
$kendo-tabstrip-md-item-padding-y: $kendo-tabstrip-md-item-padding-y,
$kendo-tabstrip-lg-item-padding-x: $kendo-tabstrip-lg-item-padding-x,
$kendo-tabstrip-lg-item-padding-y: $kendo-tabstrip-lg-item-padding-y,
$kendo-tabstrip-item-bg: $kendo-tabstrip-item-bg,
$kendo-tabstrip-item-text: $kendo-tabstrip-item-text,
$kendo-tabstrip-item-border: $kendo-tabstrip-item-border,
Expand Down Expand Up @@ -211,5 +286,6 @@ $kendo-tabstrip-content-focus-border: $kendo-component-text !default;
$kendo-tabstrip-content-bg: $kendo-tabstrip-content-bg,
$kendo-tabstrip-content-text: $kendo-tabstrip-content-text,
$kendo-tabstrip-content-border: $kendo-tabstrip-content-border,
$kendo-tabstrip-content-focus-border: $kendo-tabstrip-content-focus-border
$kendo-tabstrip-content-focus-border: $kendo-tabstrip-content-focus-border,
$kendo-tabstrip-scroll-overlay: $kendo-tabstrip-scroll-overlay
);
78 changes: 77 additions & 1 deletion packages/classic/scss/tabstrip/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ $kendo-tabstrip-line-height: var( --kendo-line-height, normal )!default;
/// @group tabstrip
$kendo-tabstrip-border-width: 1px !default;

/// The font size of the small TabStrip.
/// @group tabstrip
$kendo-tabstrip-sm-font-size: $kendo-tabstrip-font-size !default;
/// The line height of the small TabStrip.
/// @group tabstrip
$kendo-tabstrip-sm-line-height: $kendo-tabstrip-line-height !default;
/// The font size of the medium TabStrip.
/// @group tabstrip
$kendo-tabstrip-md-font-size: $kendo-tabstrip-font-size !default;
/// The line height of the medium TabStrip.
/// @group tabstrip
$kendo-tabstrip-md-line-height: $kendo-tabstrip-line-height !default;
/// The font size of the large TabStrip.
/// @group tabstrip
$kendo-tabstrip-lg-font-size: var( --kendo-font-size-lg, inherit ) !default;
/// The line height of the large TabStrip.
/// @group tabstrip
$kendo-tabstrip-lg-line-height: var( --kendo-line-height-lg, normal ) !default;

/// The background color of the TabStrip wrapper.
/// @group tabstrip
$kendo-tabstrip-wrapper-bg: null !default;
Expand Down Expand Up @@ -62,6 +81,24 @@ $kendo-tabstrip-item-border-radius: k-border-radius(md) !default;
/// The gap between the TabStrip items.
/// @group tabstrip
$kendo-tabstrip-item-gap: k-spacing(0) !default;
/// The horizontal padding of the small TabStrip items.
/// @group tabstrip
$kendo-tabstrip-sm-item-padding-x: k-spacing(2) !default;
/// The vertical padding of the small TabStrip items.
/// @group tabstrip
$kendo-tabstrip-sm-item-padding-y: k-spacing(0.5) !default;
/// The horizontal padding of the medium TabStrip items.
/// @group tabstrip
$kendo-tabstrip-md-item-padding-x: $kendo-tabstrip-item-padding-x !default;
/// The vertical padding of the medium TabStrip items.
/// @group tabstrip
$kendo-tabstrip-md-item-padding-y: $kendo-tabstrip-item-padding-y !default;
/// The horizontal padding of the large TabStrip items.
/// @group tabstrip
$kendo-tabstrip-lg-item-padding-x: k-spacing(2) !default;
/// The vertical padding of the large TabStrip items.
/// @group tabstrip
$kendo-tabstrip-lg-item-padding-y: k-spacing(1.5) !default;

/// The background color of the TabStrip items.
/// @group tabstrip
Expand Down Expand Up @@ -162,6 +199,32 @@ $kendo-tabstrip-content-border: $kendo-component-border !default;
/// @group tabstrip
$kendo-tabstrip-content-focus-border: $kendo-component-text !default;

/// The left and right scroll overlay of the TabStrip.
/// @group tabstrip
$kendo-tabstrip-scroll-overlay: if($kendo-enable-color-system, k-color( app-surface ), rgba( $kendo-color-white, 0)), if($kendo-enable-color-system, color-mix(in srgb, k-color( app-surface ) 0%, transparent), rgba( $kendo-color-white, 0)) !default;

/// The size map of the TabStrip.
/// @group tabstrip
$kendo-tabstrip-sizes: (
sm: (
font-size: $kendo-tabstrip-sm-font-size,
line-height: $kendo-tabstrip-sm-line-height,
item-padding-x: $kendo-tabstrip-sm-item-padding-x,
item-padding-y: $kendo-tabstrip-sm-item-padding-y
),
md: (
font-size: $kendo-tabstrip-md-font-size,
line-height: $kendo-tabstrip-md-line-height,
item-padding-x: $kendo-tabstrip-md-item-padding-x,
item-padding-y: $kendo-tabstrip-md-item-padding-y
),
lg: (
font-size: $kendo-tabstrip-lg-font-size,
line-height: $kendo-tabstrip-lg-line-height,
item-padding-x: $kendo-tabstrip-lg-item-padding-x,
item-padding-y: $kendo-tabstrip-lg-item-padding-y
)
) !default;

@forward "@progress/kendo-theme-default/scss/tabstrip/_variables.scss" with (
$kendo-tabstrip-wrapper-padding-x: $kendo-tabstrip-wrapper-padding-x,
Expand All @@ -171,6 +234,12 @@ $kendo-tabstrip-content-focus-border: $kendo-component-text !default;
$kendo-tabstrip-font-size: $kendo-tabstrip-font-size,
$kendo-tabstrip-line-height: $kendo-tabstrip-line-height,
$kendo-tabstrip-border-width: $kendo-tabstrip-border-width,
$kendo-tabstrip-sm-font-size: $kendo-tabstrip-sm-font-size,
$kendo-tabstrip-sm-line-height: $kendo-tabstrip-sm-line-height,
$kendo-tabstrip-md-font-size: $kendo-tabstrip-md-font-size,
$kendo-tabstrip-md-line-height: $kendo-tabstrip-md-line-height,
$kendo-tabstrip-lg-font-size: $kendo-tabstrip-lg-font-size,
$kendo-tabstrip-lg-line-height: $kendo-tabstrip-lg-line-height,
$kendo-tabstrip-wrapper-bg: $kendo-tabstrip-wrapper-bg,
$kendo-tabstrip-wrapper-text: $kendo-tabstrip-wrapper-text,
$kendo-tabstrip-wrapper-border: $kendo-tabstrip-wrapper-border,
Expand All @@ -183,6 +252,12 @@ $kendo-tabstrip-content-focus-border: $kendo-component-text !default;
$kendo-tabstrip-item-border-radius: $kendo-tabstrip-item-border-radius,
$kendo-tabstrip-item-gap: $kendo-tabstrip-item-gap,
$kendo-tabstrip-item-bg: $kendo-tabstrip-item-bg,
$kendo-tabstrip-sm-item-padding-x: $kendo-tabstrip-sm-item-padding-x,
$kendo-tabstrip-sm-item-padding-y: $kendo-tabstrip-sm-item-padding-y,
$kendo-tabstrip-md-item-padding-x: $kendo-tabstrip-md-item-padding-x,
$kendo-tabstrip-md-item-padding-y: $kendo-tabstrip-md-item-padding-y,
$kendo-tabstrip-lg-item-padding-x: $kendo-tabstrip-lg-item-padding-x,
$kendo-tabstrip-lg-item-padding-y: $kendo-tabstrip-lg-item-padding-y,
$kendo-tabstrip-item-text: $kendo-tabstrip-item-text,
$kendo-tabstrip-item-border: $kendo-tabstrip-item-border,
$kendo-tabstrip-item-gradient: $kendo-tabstrip-item-gradient,
Expand Down Expand Up @@ -211,5 +286,6 @@ $kendo-tabstrip-content-focus-border: $kendo-component-text !default;
$kendo-tabstrip-content-bg: $kendo-tabstrip-content-bg,
$kendo-tabstrip-content-text: $kendo-tabstrip-content-text,
$kendo-tabstrip-content-border: $kendo-tabstrip-content-border,
$kendo-tabstrip-content-focus-border: $kendo-tabstrip-content-focus-border
$kendo-tabstrip-content-focus-border: $kendo-tabstrip-content-focus-border,
$kendo-tabstrip-scroll-overlay: $kendo-tabstrip-scroll-overlay
);
110 changes: 109 additions & 1 deletion packages/default/scss/tabstrip/_layout.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use "sass:map";
@use "../core/_index.scss" as *;
@use "../icons/_variables.scss" as *;
@use "./variables.scss" as *;
Expand Down Expand Up @@ -169,11 +170,94 @@
// Scrolling
.k-tabstrip-scrollable {
> .k-tabstrip-items-wrapper {

> .k-tabstrip-items {
flex-wrap: nowrap;
white-space: nowrap;
overflow: hidden;

&.k-tabstrip-items-scroll {
scrollbar-width: none;

&::-webkit-scrollbar {
display: none;
}
}
}
}

&.k-tabstrip-top,
&.k-tabstrip-bottom {
.k-tabstrip-items.k-tabstrip-items-scroll {
overflow-x: auto;
}
}

&.k-tabstrip-left,
&.k-tabstrip-right {
.k-tabstrip-items.k-tabstrip-items-scroll {
overflow-y: auto;
}
}
}

.k-tabstrip-scrollable-overlay {
.k-tabstrip-items-wrapper {
&::before,
&::after {
content: '';
position: absolute;
z-index: 3;
}
}

&.k-tabstrip-top,
&.k-tabstrip-bottom {
.k-tabstrip-items-wrapper {
&::before,
&::after {
height: 100%;
aspect-ratio: 1;
}
&::before {
inset-inline-start: 0;
}

&::after {
inset-inline-end: 0;
}
}
}

&.k-tabstrip-left,
&.k-tabstrip-right {
.k-tabstrip-items-wrapper {
&::before,
&::after {
width: 100%;
}
&::before {
inset-block-start: 0;
}

&::after {
inset-block-end: 0;
}
}
}

&.k-tabstrip-scrollable-start {
.k-tabstrip-items-wrapper {
&::before {
display: none;
}
}
}

&.k-tabstrip-scrollable-end {
.k-tabstrip-items-wrapper {
&::after {
display: none;
}
}
}
}
Expand Down Expand Up @@ -375,6 +459,30 @@

}

// TabStrip sizes
@each $size, $size-props in $kendo-tabstrip-sizes {
$_font-size: map.get( $size-props, font-size );
$_line-height: map.get( $size-props, line-height );
$_item-padding-x: map.get( $size-props, item-padding-x );
$_item-padding-y: map.get( $size-props, item-padding-y );

.k-tabstrip-#{$size} {
.k-tabstrip-items .k-link {
font-size: $_font-size;
line-height: $_line-height;
padding-block: $_item-padding-y;
padding-inline: $_item-padding-x;
}

:is(&.k-tabstrip-left, &.k-tabstrip-right):is(.k-tabstrip-scrollable-overlay) :is(.k-tabstrip-items-wrapper){
&::before,
&::after {
height: calc( ($_line-height * 1em) + ($kendo-tabstrip-border-width * 2) + ($_item-padding-y * 2) );
}
}
}
}

}


Expand Down
Loading

0 comments on commit 7603ff8

Please sign in to comment.