-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix media print & smaller screens styling issues (#17)
* fix section component styling & typography * fix media print styling * format code
- Loading branch information
1 parent
8c44370
commit 00c0be6
Showing
4 changed files
with
44 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,47 @@ | ||
<script lang="ts"> | ||
import { Moon, Sun } from 'radix-icons-svelte'; | ||
import { Moon, Sun } from 'radix-icons-svelte'; | ||
export let variant: 'light' | 'dark'; | ||
export let clickHandler: () => void; | ||
export let isActive: boolean; | ||
export let variant: 'light' | 'dark'; | ||
export let clickHandler: () => void; | ||
export let isActive: boolean; | ||
let isLabelVisible: boolean = false; | ||
let isLabelVisible: boolean = false; | ||
function handleMouseOver(event: Event) { | ||
isLabelVisible = true; | ||
} | ||
function handleMouseOver(event: Event) { | ||
isLabelVisible = true; | ||
} | ||
function handleMouseLeave(event: Event) { | ||
isLabelVisible = false; | ||
} | ||
function handleMouseLeave(event: Event) { | ||
isLabelVisible = false; | ||
} | ||
</script> | ||
|
||
<button | ||
name="theme-{variant}-switch" | ||
class="p-2 bg-zinc-50 dark:bg-zinc-200 bg-opacity-30 dark:bg-opacity-30 hover:bg-opacity-50 dark:hover:bg-opacity-50 rounded-md border-2 {isActive | ||
? 'border-blue-400' | ||
: 'border-zinc-300 dark:border-zinc-300'}" | ||
on:click={clickHandler} | ||
on:mouseover={handleMouseOver} | ||
on:focus={handleMouseOver} | ||
on:mouseleave={handleMouseLeave} | ||
on:blur={handleMouseLeave} | ||
name="theme-{variant}-switch" | ||
class="p-2 bg-zinc-50 dark:bg-zinc-200 bg-opacity-30 dark:bg-opacity-30 hover:bg-opacity-50 dark:hover:bg-opacity-50 rounded-md border-2 {isActive | ||
? 'border-blue-400' | ||
: 'border-zinc-300 dark:border-zinc-300'}" | ||
on:click={clickHandler} | ||
on:mouseover={handleMouseOver} | ||
on:focus={handleMouseOver} | ||
on:mouseleave={handleMouseLeave} | ||
on:blur={handleMouseLeave} | ||
> | ||
{#if variant === 'dark'} | ||
<Moon size={16} /> | ||
{:else} | ||
<Sun size={16} /> | ||
{/if} | ||
{#if variant === 'dark'} | ||
<Moon size={16} /> | ||
{:else} | ||
<Sun size={16} /> | ||
{/if} | ||
</button> | ||
<label for="theme-{variant}-switch" class="{isLabelVisible ? 'block' : 'hidden'} absolute top-16 p-2 dark:bg-zinc-300 dark:bg-opacity-50 bg-zinc-200 bg-opacity-50 rounded-md font-semibold text-sm w-full text-center "> | ||
{#if isActive} | ||
OS Default | ||
{:else} | ||
{variant} theme | ||
{/if} | ||
<label | ||
for="theme-{variant}-switch" | ||
class="{isLabelVisible | ||
? 'block' | ||
: 'hidden'} absolute top-16 p-2 dark:bg-zinc-300 dark:bg-opacity-50 bg-zinc-200 bg-opacity-50 rounded-md font-semibold text-sm w-full text-center" | ||
> | ||
{#if isActive} | ||
OS Default | ||
{:else} | ||
{variant} theme | ||
{/if} | ||
</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters