aboutsummaryrefslogtreecommitdiff
path: root/app/views/components/theme.toggle.php
blob: 3b2d15ba9079c7866065169aa35285a869820902 (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
34
35
<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', $iconClass ?? null); ?>
    <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', $iconClass ?? null); ?>
    <span>Dark</span>
  </button>

  <?php } ?>
</form>

<?php $formClass = $buttonClass = $iconClass = null; ?>