Issue with theme settings

Hello,

I tried adding a cursor setting to my theme but it does not work.
Enabled or disasbled, it’s the same thing.

This is my code:

@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;
  }
}

Thanks for any help.

Hello,

I think it is maybe a better idea to add the cursor: default to the settings. But you can reverse my sample below if you want. Note: I am not sure I fully understand what you would like to achive but I hope this might be useful… :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;
  }
  // I assume here are more properties not only cursor... 
}

settings.yml

is_cursor_default:
  type: bool
  default: false
  description: "Setting description here...."

Or you can use enum settings type here to make it changeable.

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: "Setting description here... (Here the default cursor type is auto but you can change it to default or pointer...)."

Edit: I didn’t check but is the !important is necessary?

3 Likes

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