{"id":17702629,"url":"https://github.com/friendlymatthew/leptos-theme","last_synced_at":"2025-07-18T07:02:09.496Z","repository":{"id":215549867,"uuid":"739202436","full_name":"friendlymatthew/leptos-theme","owner":"friendlymatthew","description":"a theme abstraction for leptos applications","archived":false,"fork":false,"pushed_at":"2024-02-08T17:16:30.000Z","size":9110,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-16T19:09:59.426Z","etag":null,"topics":["harvey-dent","leptos","themes","wasm"],"latest_commit_sha":null,"homepage":"https://leptos-theme.vercel.app","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/friendlymatthew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-05T02:23:01.000Z","updated_at":"2025-01-08T04:12:52.000Z","dependencies_parsed_at":"2024-02-08T17:35:49.607Z","dependency_job_id":null,"html_url":"https://github.com/friendlymatthew/leptos-theme","commit_stats":null,"previous_names":["friendlymatthew/leptos-theme"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/friendlymatthew/leptos-theme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendlymatthew%2Fleptos-theme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendlymatthew%2Fleptos-theme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendlymatthew%2Fleptos-theme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendlymatthew%2Fleptos-theme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/friendlymatthew","download_url":"https://codeload.github.com/friendlymatthew/leptos-theme/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendlymatthew%2Fleptos-theme/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265716190,"owners_count":23816353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["harvey-dent","leptos","themes","wasm"],"created_at":"2024-10-24T19:08:30.534Z","updated_at":"2025-07-18T07:02:09.415Z","avatar_url":"https://github.com/friendlymatthew.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🌗 *leptos-theme*\n`leptos-theme` effortlessly toggles between light and dark modes in your leptos application.\n\n[![crates](https://img.shields.io/badge/📦_crates-install-%20green)](https://crates.io/crates/leptos_theme)\n![version](https://img.shields.io/badge/version-0.1.2-purple)\n[![discord](https://img.shields.io/badge/Join-Discord-%235865F2.svg)](https://discord.gg/XhVbKk38ux)\n\n\u003cimg width=\"629\" alt=\"Screen Shot 2024-01-05 at 3 58 18 PM\" src=\"https://github.com/friendlymatthew/leptos-theme/assets/38759997/a9393259-1f3e-4570-8b3e-f9e1d95ff2e6\"\u003e\n\n## Quick Start \nYou can set up dark mode with two lines:\n\nWrap your project with `\u003cThemeProvider /\u003e`:\n```html\nview! {\n    \u003cStylesheet id=\"leptos\" href=\"/pkg/demo.css\"/\u003e\n\n    \u003cThemeProvider\u003e\n        \u003cRouter\u003e\n            \u003cRoutes\u003e\n                \u003cRoute path=\"/\" view=HomePage/\u003e\n                \u003cRoute path=\":else\" view=ErrorPage/\u003e\n            \u003c/Routes\u003e\n        \u003c/Router\u003e\n    \u003c/ThemeProvider\u003e\n}\n```\n\nNow your `HomePage` and `ErrorPage` are dark mode ready! \n\nToggle themes on-the-fly with `use_theme()`:\n```rust\nuse leptos_theme::{\n    theme::use_theme, \n    types::Theme\n};\n\n// inside \u003cHomePage /\u003e\n\nlet current_theme = use_theme();\n\nview! {\n    \u003cbutton\n        on:click=move |_| {\n        theme_signal.set(Theme::Light);\n    }\u003e\n        \u003cp\u003eLight Mode\u003c/p\u003e\n    \u003c/button\u003e\n}\n```\n\nThat's it!\n\n\n## Features\n- Choose between class or data attribute selectors\n- Harmonize with system preferences using `prefers-color-scheme` \n- Keep themes consistent across multiple tabs and windows\n\n## Demo\n\n`leptos_theme` supports both class and data attribute selectors.\n\n- For a tailwind + class selector demo: https://leptos-theme.vercel.app/\n  - [How to guide](https://github.com/friendlymatthew/leptos-theme/tree/main/example/demo#readme)\n\n- For a pure CSS + data selector demo: https://leptos-theme-data-attribute.vercel.app/\n  - [How to guide](https://github.com/friendlymatthew/leptos-theme/tree/main/example/demo-pure-css#readme)\n\n\n## Contributions\nCheck the [issues](https://github.com/friendlymatthew/leptos-theme/issues) page and feel free to post a PR!\n\n## Bugs, Issues, Feature Requests\n[Robert](https://github.com/JustBobinAround) and I created `leptos_theme` with the intention of usability. If you encounter any bugs, issues, or feature requests, [please feel free to open an issue.](https://github.com/friendlymatthew/leptos-theme/issues/new)\n\n## CHANGELOG\n### Update - `v.1.2` February 8th, 2024\n- elevated `leptos` to 0.6.5","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlymatthew%2Fleptos-theme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendlymatthew%2Fleptos-theme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlymatthew%2Fleptos-theme/lists"}