主题设置问题

您好,

我尝试在我的主题中添加一个光标设置,但它不起作用。
启用或禁用,结果都一样。

这是我的代码:

@if $Is_Cursor_Active {
  .shijsfiifjsdjonf80HJ0iuf {
    display:none;
  }
} @else {
    body,
   button,div,span,a,
    img,svg,
    h1,h2,h3,h4,h5,h6,p,
   summary,
   input,textbox,input,textarea,
   li,ul {
    cursor: default !important;
  }
}

感谢任何帮助。

你好,

我认为将 cursor: default 添加到设置中可能是一个更好的主意。但如果你愿意,可以撤销我下面的示例。注意:我不确定我是否完全理解你想要实现的目标,但我希望这可能有所帮助…… :slightly_smiling_face:

body,
button,div,span,a,
img,svg,
h1,h2,h3,h4,h5,h6,p,
summary,
input,textbox,input,textarea,
li,ul {
  @if $is-cursor-default == "true" {
    cursor: default !important;
  }
  // 我假设这里还有其他属性,不仅仅是 cursor...
}

settings.yml

is_cursor_default:
  type: bool
  default: false
  description: "此处为设置描述……"

或者你可以在这里使用 enum 设置类型来实现可更改性。

body,
button,div,span,a,
img,svg,
h1,h2,h3,h4,h5,h6,p,
summary,
input,textbox,input,textarea,
li,ul {
  cursor: #{$cursor_type} !important;
}

settings.yml

cursor_type:
  default: auto
  type: enum
  choices:
    - default
    - pointer
  description: "此处为设置描述……(此处默认光标类型为 auto,但你可以将其更改为 default 或 pointer……)。"

编辑:我没检查,但 !important 是必需的吗?

3 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.