Skip to content

Commit

Permalink
Popover and Tooltip restyle, add arrow (#25779)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Bulychev <[email protected]>
  • Loading branch information
iBat and Alexander Bulychev authored Oct 12, 2023
1 parent c4ed197 commit 64fb0b4
Show file tree
Hide file tree
Showing 43 changed files with 25 additions and 15 deletions.
8 changes: 4 additions & 4 deletions packages/devextreme/scss/widgets/base/popover/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@use "sass:math";

@mixin dx-popover-arrow-size($width) {
@mixin dx-popover-arrow-size($width, $popover-arrow-offset: 0) {
$sqrt-2: 1.4142;
$popover-arrow-width: $width;
$popover-arrow-heiht: math.div($popover-arrow-width, 2);
$popover-arrow-height: math.div($popover-arrow-width, 2);

.dx-popover-wrapper {
.dx-popover-arrow::after {
Expand All @@ -15,14 +15,14 @@
&.dx-position-bottom {
.dx-popover-arrow {
width: $popover-arrow-width;
height: $popover-arrow-heiht;
height: $popover-arrow-height + $popover-arrow-offset;
}
}

&.dx-position-right,
&.dx-position-left {
.dx-popover-arrow {
width: $popover-arrow-heiht;
width: $popover-arrow-height + $popover-arrow-offset;
height: $popover-arrow-width;
}
}
Expand Down
4 changes: 0 additions & 4 deletions packages/devextreme/scss/widgets/fluent/popover/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,4 @@
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}

.dx-popover-arrow {
display: none;
}
}
3 changes: 3 additions & 0 deletions packages/devextreme/scss/widgets/fluent/slider/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@use "sizes" as *;
@use "../sizes" as *;
@use "../../base/slider";
@use "../../base/popover/mixins" as *;

// adduse

Expand All @@ -15,6 +16,8 @@ $fluent-slider-disabled-tooltip-top-margin: 5px;

.dx-slider-wrapper {
height: $fluent-slider-wrapper-height;

@include dx-popover-arrow-size(14px, 2px);
}

.dx-slider-bar {
Expand Down
11 changes: 8 additions & 3 deletions packages/devextreme/scss/widgets/fluent/tooltip/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@ $tooltip-color: null !default;
* $type color
*/
$tooltip-bg: null !default;

$tooltip-shadow-color: null !default;
$tooltip-border-radius: $base-border-radius !default;
$overlay-content-shadow-color: null !default;

@if $mode == "light" {
$tooltip-color: $base-inverted-text-color !default;
$tooltip-bg: #616161 !default;
$tooltip-color: $base-text-color !default;
$tooltip-bg: $base-bg !default;
$tooltip-shadow-color: 0 0 2px 0 rgba(0, 0, 0, 0.12), 0 4px 8px 0 rgba(0, 0, 0, 0.14) !default;
}

@if $mode == "dark" {
$tooltip-color: $base-text-color !default;
$tooltip-bg: rgba(0, 0, 0, 1) !default;
$tooltip-bg: $base-neutral-background1-hover !default;
$tooltip-shadow-color: 0 0 2px 0 rgba(0, 0, 0, 0.24), 0 4px 8px 0 rgba(0, 0, 0, 0.28) !default;
}

9 changes: 6 additions & 3 deletions packages/devextreme/scss/widgets/fluent/tooltip/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@
.dx-overlay-content {
background-color: $tooltip-bg;
color: $tooltip-color;
box-shadow: none;
box-shadow: $tooltip-shadow-color;
border-radius: $tooltip-border-radius;
min-height: auto;

.dx-popup-content {
padding: $fluent-tooltip-padding;
font-size: 12px;
font-size: $fluent-tooltip-font-size;
}
}

&.dx-popover-wrapper .dx-popover-arrow {
display: none;
&::after {
box-shadow: $tooltip-shadow-color;
background: $tooltip-bg;
}
}
}
5 changes: 4 additions & 1 deletion packages/devextreme/scss/widgets/fluent/tooltip/_sizes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
// adduse

$fluent-tooltip-padding: null !default;
$fluent-tooltip-font-size: null !default;

@if $size == "default" {
$fluent-tooltip-padding: 6px 8px !default;
$fluent-tooltip-padding: 8px 12px !default;
$fluent-tooltip-font-size: 12px;
}

@else if $size == "compact" {
$fluent-tooltip-padding: 4px 6px !default;
$fluent-tooltip-font-size: 12px;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 64fb0b4

Please sign in to comment.