Skip to content

Comments

feat: Miaou 0.4.0 - Cascading style system and built-in themes#111

Merged
mathiasbourgoin merged 2 commits intomainfrom
feat/list-widget-foldable
Feb 18, 2026
Merged

feat: Miaou 0.4.0 - Cascading style system and built-in themes#111
mathiasbourgoin merged 2 commits intomainfrom
feat/list-widget-foldable

Conversation

@mathiasbourgoin
Copy link
Collaborator

@mathiasbourgoin mathiasbourgoin commented Feb 17, 2026

Summary

Major release adding a comprehensive theming system with CSS-like selectors and 11 built-in themes.

Style System (miaou_style)

  • Cascading style system with semantic styles (primary, error, text, etc.)
  • CSS-like selectors for widget-specific styling
  • Effect-based Style_context for runtime theme access
  • Theme JSON support with discovery/merge rules and contrast validation

Built-in Themes

11 popular themes included directly in the library:

  • Dark: catppuccin-mocha, dracula, nord, gruvbox-dark, tokyonight, opencode, oled
  • Light: catppuccin-latte, nord-light, gruvbox-light, tokyonight-day
  • opencode and oled use borderless style for a clean, minimal look
  • oled features true black background for OLED screens

Theme Registry API

  • Builtin_themes.list_builtin() - list all themes with metadata
  • Builtin_themes.get_builtin(id) - load a theme by ID
  • Theme_loader.load_any(name) - smart loading (built-in first, then user)

New Widgets

  • Textarea: multiline text input with cursor navigation
  • Foldable list: collapsible sections (used in gallery)
  • Left-bordered box: context/quote blocks with colored border
  • Blocks spinner: animated spinner with gradient trail

Mouse Support

Wheel scrolling and click handling for: Pager, Select, File Browser, Textbox, Textarea, Tabs, Breadcrumbs, Button, Link, Checkbox, Radio, Switch

Other Features

  • dark_mode field in Theme.t for adaptive color resolution
  • Auto-theming at driver level (apply_themed_foreground/background)
  • Canvas themed rendering with to_ansi_with_defaults
  • Signal handling control via handle_sigint option
  • Per-side border colors for Box_widget

Breaking Changes

  • Box_widget.border_style now includes None_ for borderless containers

Testing

  • dune build && dune runtest
  • Style system demo: dune exec example/demos/style_system/main.exe

@mathiasbourgoin mathiasbourgoin force-pushed the feat/list-widget-foldable branch from 017c520 to a097ded Compare February 17, 2026 23:02
@mathiasbourgoin mathiasbourgoin changed the title feat(widgets): foldable list widget and gallery categories feat: Miaou 0.4.0 - Cascading style system and built-in themes Feb 17, 2026
@mathiasbourgoin mathiasbourgoin force-pushed the feat/list-widget-foldable branch from a097ded to 382196a Compare February 17, 2026 23:53
@mathiasbourgoin mathiasbourgoin changed the base branch from feat/style-system to main February 18, 2026 18:49
@mathiasbourgoin mathiasbourgoin force-pushed the feat/list-widget-foldable branch from d0225db to ed46b5c Compare February 18, 2026 18:49
- Box_widget border style: added None_ for borderless containers.
  Pattern matches on border_style may need a new case.

- Cascading style system with semantic styles and CSS-like selectors
- Theme JSON support with discovery/merge rules and contrast validation
- Effect-based Style_context for runtime theme access
- Built-in themes: catppuccin, dracula, nord, gruvbox, tokyonight, opencode, oled
- Theme registry API: list_builtin(), get_builtin(), load_any()

- Textarea widget: multiline text input with cursor navigation
- Foldable list widget: collapsible sections in gallery
- Left-bordered box: context/quote blocks with colored border
- Blocks spinner: animated spinner with gradient trail

- Alt+Enter key parsing for textarea newlines
- Mouse helper module with click, drag, wheel utilities
- Mouse support for: Pager, Select, File Browser, Textbox, Textarea,
  Tabs, Breadcrumbs, Button, Link, Checkbox, Radio, Switch

- Signal handling control via handle_sigint option
- Per-side border colors for Box_widget
- Canvas themed rendering with to_ansi_with_defaults
- Theme dark_mode field for adaptive color resolution

- Widget theming: all widgets use semantic themed styles
- Containers fill contextual backgrounds across full width
- Drivers apply themed foreground/background automatically

- Theme JSON parsing: tolerant of partial objects, multiple color formats
- Matrix driver: reduced flicker during periodic scrub
- Terminal raw mode: proper SIGINT handling
- Modal backgrounds: correct theming in light/dark modes

Co-Authored-By: Claude <noreply@anthropic.com>
@mathiasbourgoin mathiasbourgoin force-pushed the feat/list-widget-foldable branch from ed46b5c to e2693b3 Compare February 18, 2026 20:30
@mathiasbourgoin mathiasbourgoin force-pushed the feat/list-widget-foldable branch from e2693b3 to 9adc787 Compare February 18, 2026 20:43
@mathiasbourgoin mathiasbourgoin merged commit c649da0 into main Feb 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant