Skip to content

Commit 69d0345

Browse files
committed
Remove dropdown text customization from sphinx-exercise CSS
- Dropdown button text styling is better handled at theme level - Removes CSS override for toggle-button text from exercise.css - Updates documentation to suggest theme-level customization - Updates CHANGELOG to reflect architectural decision
1 parent b19a517 commit 69d0345

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@
77
- Added `exercise_style` configuration option to control solution title styling
88
- Set to `"solution_follow_exercise"` to remove hyperlinks from solution titles when solutions follow exercises directly
99
- Default is `""` (empty string) which maintains the original clickable hyperlink behavior
10-
- Changed dropdown button text from "Click to show" to "Show" (and "Click to hide" to "Hide") for cleaner visual appearance
1110

1211
### Improved 👌
1312

1413
- Enhanced solution title styling options for better UX in lecture-style content where solutions follow exercises
1514
- Improved configuration option naming for better clarity when used alongside other Sphinx extensions
1615

16+
### Changed 🔄
17+
18+
- Removed dropdown button text customization from `sphinx-exercise` CSS
19+
- This styling is better handled at the theme level (e.g., in `quantecon-book-theme`) for consistent global behavior
20+
- Projects can customize dropdown text in their theme or custom CSS if desired
21+
1722
## [v1.1.1](https://github.com/executablebooks/sphinx-exercise/tree/v1.1.1) (2025-10-23)
1823

1924
### Improved 👌

docs/source/syntax.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,12 @@ sphinx:
343343
344344
To hide the content, simply add `:class: dropdown` as a directive option.
345345

346-
**Note:** The dropdown toggle button text has been customized for `sphinx-exercise` directives to display "Show" / "Hide" instead of the default "Click to show" / "Click to hide" for a cleaner visual appearance.
347-
348346
For more use cases see [sphinx-togglebutton](https://sphinx-togglebutton.readthedocs.io/en/latest/#usage).
349347

348+
```{tip}
349+
To customize the dropdown toggle button text (e.g., "Show" instead of "Click to show"), add custom CSS in your theme or project. This is typically handled at the theme level for consistent styling across all toggle buttons.
350+
```
351+
350352
**Example**
351353

352354
```{exercise}

sphinx_exercise/assets/html/exercise.css

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,3 @@ div.solution p.admonition-title {
4141
div.solution p.admonition-title::after {
4242
content: none;
4343
}
44-
45-
/*********************************************
46-
* Dropdown customization *
47-
*********************************************/
48-
/* Change "Click to show" to "Show" for dropdowns */
49-
div.exercise.dropdown button.toggle-button::before,
50-
div.solution.dropdown button.toggle-button::before {
51-
content: "Show";
52-
}
53-
54-
div.exercise.dropdown.toggle-shown button.toggle-button::before,
55-
div.solution.dropdown.toggle-shown button.toggle-button::before {
56-
content: "Hide";
57-
}

0 commit comments

Comments
 (0)