Skip to content

Commit

Permalink
full examples collapsed by default
Browse files Browse the repository at this point in the history
  • Loading branch information
n7itro committed Sep 16, 2024
1 parent c4f0927 commit 9dcaf43
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions content/themes-store/themes-marketplace-preferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ Invalid Example:
}
```

### Full Example of `preferences.json`
<details>
<summary><font weight="bold" size=4.75><b>See Full Example</b></font></summary>

Below is a full example of what a `preferences.json` file might look like with multiple preference objects in its root. Each object represents a preference defined for a theme:

Expand Down Expand Up @@ -180,6 +181,8 @@ In this example:
- Each object defines a `property`, `label`, and `type` (either `checkbox` or `dropdown`).
- Dropdown preferences can include an `options` field, with each option having a `label` and a `value`.

</details>

---

## How to use preferences in the theme's CSS
Expand Down Expand Up @@ -274,7 +277,8 @@ In this example:

---

### Full Example
<details>
<summary><font weight="bold" size=4.75><b>See Full Example</b></font></summary>

Suppose your `preferences.json` file includes these two preferences:

Expand Down Expand Up @@ -339,6 +343,7 @@ This allows users to:
- Toggle dark mode on/off using the checkbox.
- Select a background color from the dropdown, which dynamically changes the background and text colors based on the user's choice.

</details>

> [!info]
> The `-moz-bool-pref` query is used for detecting boolean values (checkboxes), while the `:has()` pseudo-class with attribute selectors is used for detecting the selected values of dropdowns.
Expand Down

0 comments on commit 9dcaf43

Please sign in to comment.