aboutsummaryrefslogtreecommitdiff
path: root/app/views/components/theme-toggle.php
blob: cfaf19303e9c2b84658ed70f416bc4e03dfa7bd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<form
  class="<?php echo $formClass ?? null; ?>"
  method="get"
  action="<?php echo $_SERVER['REQUEST_URI']; ?>"
>
  <?php if ($theme->color() === 'dark') { ?>

  <button
    title="Switch to Light Theme"
    class="<?php echo $buttonClass ?? null; ?>"
    name="theme"
    type="submit"
    value="light"
  >
    <?php echo icon('sun', 'is-hidden-mobile'); ?>
    <span>Light</span>
  </button>

  <?php } else { ?>

  <button
    title="Switch to Dark Theme"
    class="<?php echo $buttonClass ?? null; ?>"
    name="theme"
    type="submit"
    value="dark"
  >
    <?php echo icon('moon', 'is-hidden-mobile'); ?>
    <span>Dark</span>
  </button>

  <?php } ?>
</form>