Skip to content

Commit

Permalink
fix(styles): bring Slider tooltip styling from FNGX [ci visual]
Browse files Browse the repository at this point in the history
  • Loading branch information
InnaAtanasova committed Sep 6, 2024
1 parent d7ca723 commit 2185a88
Show file tree
Hide file tree
Showing 2 changed files with 66 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
56 changes: 56 additions & 0 deletions packages/styles/src/slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ $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 */
user-select: none; /* Konqueror HTML */
user-select: none; /* Old versions of Firefox */
user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}
}

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

&__track-range {
Expand Down Expand Up @@ -124,6 +140,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 +154,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 +416,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 2185a88

Please sign in to comment.