element-plus [Component] [tooltip] el-tooltip effect display an opposite result when setting class dark on html tag

cyvaqqii  于 5个月前  发布在  其他
关注(0)|答案(2)|浏览(55)

Bug Type: Component

Environment

  • Vue Version: 3.3.4
  • Element Plus Version: 2.6.2
  • Browser / OS: Chrome 126.0.6478.127
  • Build Tool: Vite

Reproduction

  • el-tooltip

Docs

Steps to reproduce

... Dark Light

What is Expected?

the first el-tooltip should display dark style but shows light style.And the second one display an opposite behavior.

What is actually happening?

the first el-tooltip shows light style.
the second one shows dark style.

Additional comments

i think the style should follows what props i offer, the effect="dark" should always be dark style.
you can discover this phenomenon in the official document.

wrrgggsh

wrrgggsh1#

the code fragment should be

<html class="dark">
...  
<el-tooltip content="Top center" placement="top">
    <el-button>Dark</el-button>
  </el-tooltip>
  <el-tooltip content="Bottom center" placement="bottom" effect="light">
    <el-button>Light</el-button>
  </el-tooltip>
</html>
wdebmtf2

wdebmtf22#

i think that is useDark changed global text-color and bg-color ,it might be a bug or call it color relativity? 😂

相关问题