From b5152cdf7b3674080144b24b9a553199f495ccea Mon Sep 17 00:00:00 2001 From: liaoxuezhi Date: Sat, 13 Jun 2020 18:31:54 +0800 Subject: [PATCH] =?UTF-8?q?tooltip=20=E6=94=AF=E6=8C=81=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scss/components/_tooltip.scss | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scss/components/_tooltip.scss b/scss/components/_tooltip.scss index e3c9d9ae8..06c3a1cf1 100644 --- a/scss/components/_tooltip.scss +++ b/scss/components/_tooltip.scss @@ -68,8 +68,7 @@ .#{$ns}Tooltip-arrow::before, .#{$ns}Tooltip-arrow::after { - border-width: ($Tooltip-arrow-width / 2) $Tooltip-arrow-height - ($Tooltip-arrow-width / 2) 0; + border-width: ($Tooltip-arrow-width / 2) $Tooltip-arrow-height ($Tooltip-arrow-width / 2) 0; } .#{$ns}Tooltip-arrow::before { @@ -92,8 +91,7 @@ .#{$ns}Tooltip-arrow::before, .#{$ns}Tooltip-arrow::after { - border-width: 0 ($Tooltip-arrow-width / 2) $Tooltip-arrow-height - ($Tooltip-arrow-width / 2); + border-width: 0 ($Tooltip-arrow-width / 2) $Tooltip-arrow-height ($Tooltip-arrow-width / 2); } .#{$ns}Tooltip-arrow::before { @@ -133,8 +131,7 @@ .#{$ns}Tooltip-arrow::before, .#{$ns}Tooltip-arrow::after { - border-width: ($Tooltip-arrow-width / 2) 0 ($Tooltip-arrow-width / 2) - $Tooltip-arrow-height; + border-width: ($Tooltip-arrow-width / 2) 0 ($Tooltip-arrow-width / 2) $Tooltip-arrow-height; } .#{$ns}Tooltip-arrow::before { @@ -189,7 +186,9 @@ font-size: $Tooltip--attr-fontSize; line-height: $Tooltip--attr-lineHeigt; text-align: left; - white-space: nowrap; + white-space: normal; + width: max-content; + max-width: 300px; background: $Tooltip--attr-bg; border: $Tooltip--attr-borderWidth solid $Tooltip--attr-borderColor; border-radius: $Tooltip--attr-borderRadius; @@ -200,6 +199,11 @@ display: none; animation-duration: 0.2s; animation-fill-mode: both; + + @media screen and (min-width:0\0) { + white-space: nowrap; + max-width: unset; + } } &:not(.is-disabled):hover:after { @@ -248,4 +252,4 @@ content: ''; display: none !important; } -} +} \ No newline at end of file