Skip to content

Commit

Permalink
fix(styles): bring Slider tooltip styling from fund-ngx [ci visual] (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
InnaAtanasova authored Sep 7, 2024
1 parent 25c7d30 commit 9603557
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/styles/src/popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ body.fd-overlay-active::before {
}

.#{$block} {
--fdPopover_Display: inline-block;


@include fd-reset();

position: relative;
display: inline-block;
max-width: 100%;
position: relative;
display: var(--fdPopover_Display);

&__modal {
position: relative;
Expand Down Expand Up @@ -536,6 +539,11 @@ body.fd-overlay-active::before {
}
}

// Modifier class for Slider Tooltip and Input
&--slider {
--fdPopover_Display: block;
}

// @deprecated, fd-popover__body--input-message-group to be used instead
&--input-message-group {
.#{$block}__body,
Expand Down
52 changes: 52 additions & 0 deletions packages/styles/src/slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ $slider-side-padding: calc((var(--fdSlider_Handle_Width) * 0.5) + #{$handle-outl
position: relative;
z-index: 1;
box-shadow: inset 0 0 0 var(--fdSlider_Track_Border_Width) var(--fdSlider_Track_Border_Color);

.#{$block}__handle {
@include fd-focus() {
z-index: 2;
-webkit-touch-callout: none; /* iOS Safari */
user-select: none; /* Safari */
}
}

.#{$fd-namespace}-popover-custom {
display: none;
}
}

&__track-range {
Expand Down Expand Up @@ -124,6 +136,8 @@ $slider-side-padding: calc((var(--fdSlider_Handle_Width) * 0.5) + #{$handle-outl
@include fd-flex() {
justify-content: space-between;
}

height: var(--fdSlider_Tick_Height);
}

&__labels {
Expand All @@ -136,6 +150,10 @@ $slider-side-padding: calc((var(--fdSlider_Handle_Width) * 0.5) + #{$handle-outl
position: relative;
height: 1rem;
top: 0.5rem;

.#{$block}__label {
white-space: nowrap;
}
}

&__tick {
Expand Down Expand Up @@ -394,4 +412,38 @@ $slider-side-padding: calc((var(--fdSlider_Handle_Width) * 0.5) + #{$handle-outl
}
}
}

&.#{$block}--with-labels {
padding-bottom: 2rem;
}

// Overstyle of Popover body, needed for Tooltip and Input inside Tooltip (ngx implementation)
&-tooltip-popover {
&.#{$fd-namespace}-popover__body {
height: 1rem;
border: none;
padding-block: 0;
overflow: hidden;
padding-inline: 0.5rem;
border-radius: 0.0625rem;
top: -0.4375rem !important;
background: var(--sapBackgroundColor);
box-shadow: var(--sapContent_Shadow1);

.#{$block}-tooltip {
line-height: 1rem;
text-align: center;
color: var(--sapTextColor);
font-family: var(--sapFontFamily);
font-size: var(--sapFontSmallSize);
}

&:has(input) {
width: auto;
height: auto;
box-shadow: none;
padding-inline: 0;
}
}
}
}

0 comments on commit 9603557

Please sign in to comment.