aboutsummaryrefslogtreecommitdiff
path: root/app/views/components/theme.toggle.php
blob: 71e8841abb725fc9a91ad78a48631a1e11666eb0 (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
<form
  method="get"
  action="<?php echo $_SERVER['REQUEST_URI']; ?>"
>
  <?php if ($theme->color() === 'dark') { ?>

  <button
    title="Switch to Light Theme"
    name="theme"
    type="submit"
    value="light"
  >
    <?php echo icon('moon'); ?>
    <span>Dark</span>
  </button>

  <?php } else { ?>

  <button
    title="Switch to Dark Theme"
    name="theme"
    type="submit"
    value="dark"
  >
    <?php echo icon('sun'); ?>
    <span>Light</span>
  </button>

  <?php } ?>
</form>