Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

浮动面板设置样式失败 #1831

Closed
Morakes opened this issue Dec 24, 2024 · 3 comments
Closed

浮动面板设置样式失败 #1831

Morakes opened this issue Dec 24, 2024 · 3 comments
Assignees

Comments

@Morakes
Copy link

Morakes commented Dec 24, 2024

About styles 🛠️

通过VarStyleProvider设置VarFloatingPanel样式失效

<var-style-provider
    :style-vars="{
      '--floating-panel-background': 'var(--dark-bg-color)',
    }"
  >
 <var-floating-panel></...>

</...>
@chouchouji chouchouji self-assigned this Dec 24, 2024
@chouchouji
Copy link
Member

teleport 会影响 css variable

image

Link

@Morakes
Copy link
Author

Morakes commented Dec 24, 2024

是的 我在浮动面板中使用了 teleport
通过样式穿透也没办法修改颜色

:deep(.var-floating-panel) {
  background-color: var(--dark-bg-color);
}

目前我通过直接修改 root下的--floating-panel-background 来改变颜色 但是会影响全局的
请问有其他的解决方案吗 😀

@chouchouji
Copy link
Member

是的 我在浮动面板中使用了 teleport 通过样式穿透也没办法修改颜色

:deep(.var-floating-panel) {
  background-color: var(--dark-bg-color);
}

目前我通过直接修改 root下的--floating-panel-background 来改变颜色 但是会影响全局的 请问有其他的解决方案吗 😀

试试选择dom,然后设置颜色

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants