Turn on the hyper theme
Hyper is off in each product until the product turns it on. Hyper needs Aurora 0.5 or later.
Procedure
Section titled “Procedure”-
Load the hyper stylesheet after the Aurora stylesheet. Use the way that matches how you load
aurora.css:-
With
<AuroraStyles />, give ithyper=true:view! { <AuroraStyles hyper=true /> } -
With a linked stylesheet, write
hyper.csstoo, and link it afteraurora.css. Theaurora-cssbinary writes it with--hyper(aurora-css style --hyper). A helper crate callsaurora_leptos::write_hyper_css(dir).<link data-trunk rel="css" href="style/aurora.css" /><link data-trunk rel="css" href="style/hyper.css" /> -
Or use the
aurora_leptos::HYPER_CSSconstant.
-
-
Give the theme toggle
hyper=true:view! { <ThemeToggle hyper=true /> }The toggle then shows Light, Dark, Hyper and System. Without a toggle, call
set_theme(Theme::Hyper). -
Make sure that the
<head>has theTHEME_INIT_SCRIPTof 0.5. The script of 0.4 does not know"hyper", so a reload shows the system theme. Copy the script from Themes. -
If your code matches on
Theme, add aTheme::Hyperarm or a_arm.
Check it
Section titled “Check it”- Run the app.
- Click Hyper in the toggle. The page turns neon on a dark base, and
<html>hasdata-theme="hyper". - Reload the page. It stays in hyper.
If the page shows the light or the dark theme after you choose Hyper, the
hyper stylesheet is not on the page. With no hyper stylesheet,
current_theme() gives System, and the page follows the operating system.
Turn off the glow
Section titled “Turn off the glow”You do not need to. The glow goes away when the operating system asks for
more contrast (prefers-contrast: more).