Issue with theme settings

AI-generated summary

The discussion revolves around an Issue with theme settings. darkpixlz is trying to add a cursor setting to their theme but it’s not working. They’ve shared their code, which uses an @if statement to set the cursor to default or none based on the value of $Is_Cursor_Active.

darkpixlz is seeking help to resolve the issue. Don suggests adding cursor: default directly to the settings, providing an example using a boolean setting type in settings.yml. Alternatively, Don proposes using an enum settings type to make the cursor type changeable, allowing users to choose between default, pointer, and auto cursor types.

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?