leptos-use/examples/use_prefers_reduced_motion
Hector Candelaria 6d57bdf7f5 Feat: Add prefers-reduced-motion API implementation
Implemented the `use_prefers_reduced_motion` function to create a
reactive interface for detecting the user's reduced motion preference
via the `prefers-reduced-motion` media query.
2024-08-18 17:17:06 -04:00
..
src Feat: Add prefers-reduced-motion API implementation 2024-08-18 17:17:06 -04:00
style Feat: Add prefers-reduced-motion API implementation 2024-08-18 17:17:06 -04:00
Cargo.toml Feat: Add prefers-reduced-motion API implementation 2024-08-18 17:17:06 -04:00
index.html Feat: Add prefers-reduced-motion API implementation 2024-08-18 17:17:06 -04:00
input.css Feat: Add prefers-reduced-motion API implementation 2024-08-18 17:17:06 -04:00
README.md Feat: Add prefers-reduced-motion API implementation 2024-08-18 17:17:06 -04:00
rust-toolchain.toml Feat: Add prefers-reduced-motion API implementation 2024-08-18 17:17:06 -04:00
tailwind.config.js Feat: Add prefers-reduced-motion API implementation 2024-08-18 17:17:06 -04:00
Trunk.toml Feat: Add prefers-reduced-motion API implementation 2024-08-18 17:17:06 -04:00

A simple example for use_prefers_reduced_motion.

If you don't have it installed already, install Trunk and Tailwind as well as the nightly toolchain for Rust and the wasm32-unknown-unknown target:

cargo install trunk
npm install -D tailwindcss @tailwindcss/forms
rustup toolchain install nightly
rustup target add wasm32-unknown-unknown

Then, open two terminals. In the first one, run:

npx tailwindcss -i ./input.css -o ./style/output.css --watch

In the second one, run:

trunk serve --open