sendya / preview-pro

Use pro-layout in vitejs. preview https://sendya.github.io/preview-pro/index.html
MIT License
107 stars 39 forks source link

SettingDrawer组件less样式变量不起作用 #9

Open aipyfans opened 1 year ago

aipyfans commented 1 year ago

为何此组件内,使用less的变量【background: var(--primary-color);】不起作用呢?

图片

代码路径如下: https://github.com/sendya/preview-pro/blob/main/src/components/SettingDrawer/SettingDrawer.vue

代码片段如下:

<style lang="less">
.ant-pro-setting-drawer-handle {
  position: absolute;
  top: 240px;
  right: 300px;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 16px;
  text-align: center;
  **background: var(--primary-color);**
  border-radius: 4px 0 0 4px;
  cursor: pointer;
  pointer-events: auto;
  > span {
    color: rgb(255, 255, 255);
    font-size: 20px;
  }
}
</style>
aipyfans commented 1 year ago

应该改为background: var(--ant-primary-color);