obsidian-style-settings icon indicating copy to clipboard operation
obsidian-style-settings copied to clipboard

Confusion with implementing class selector options

Open ThisTheThe opened this issue 2 years ago • 1 comments

Hello. This is not an issue with the plugin itself but with the documentation.

class-toggles will toggle a css class on and off of the body element

What does this mean? Can an example of how this would be implemented on the theme side be provided? My closest guess is that the CSS selector is intended to be placed as the "id" here. I was unable to determine how CSS classes are specified if they aren't selectors. I enjoy the plugin and what options it provides, but this unfortunately restricts what I can do with it. Help would be appreciated.

Thanks for your assistance.

ThisTheThe avatar Oct 12 '22 02:10 ThisTheThe

Hello, the documentation really is confusing and I'm pretty sure a bit out of date.

For the type class-toggle, the id of the setting would be the class of the body element. If the toggle is on, then the id would appear in the class property.

Ex:

-
    id: setting-id
    title: "The Setting"
    type: class-toggle

If the toggle above is on, inside the

element should have the id of the settings

Ex:

<body class="setting-id">
    ...
</body>

And you can use that setting-id for a CSS selector for the body

Ex:

.setting-id {
    property-name: property-value;
}

Kirxii avatar Feb 05 '24 03:02 Kirxii