Skip to content

Commit

Permalink
update button, update header, add newake font option in tailwind
Browse files Browse the repository at this point in the history
Don't commit Newake, but still use it if it is available. Fallback to Arial Black
  • Loading branch information
claireclark1 authored and wilwade committed Nov 8, 2024
1 parent 36d7bdc commit 2e48aff
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 28 deletions.
8 changes: 4 additions & 4 deletions src/lib/atoms/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
md: 'w-[339px]',
lg: 'w-[388px]',
normal: 'w-[263px]',
auto: '',
auto: 'w-auto',
full: 'w-full',
}[size] || 'w-[263px]';
</script>
Expand All @@ -50,10 +50,10 @@
<a {...$$restProps} {href} class={disabled ? 'pointer-events-none' : 'pointer-events-auto'}>
<button
{...$$restProps}
class={`rounded-full p-f8 text-center transition-all ${btnStylesClass} ${btnSizeClass} ${$$restProps.class ?? ''}`}
class={`rounded-full px-f24 py-f8 text-center transition-all ${btnStylesClass} ${btnSizeClass} ${$$restProps.class ?? ''}`}
{disabled}
>
<Typography bold={true} class="flex items-center justify-center gap-f8">
<Typography bold={true} class="flex items-center justify-center gap-f8 font-sans">
<slot />
</Typography>
</button>
Expand All @@ -65,7 +65,7 @@
class={`rounded-full p-f8 text-center transition-all ${btnStylesClass} ${btnSizeClass} ${$$restProps.class ?? ''}`}
{disabled}
>
<Typography bold={true} class="flex items-center justify-center gap-f8">
<Typography bold={true} class="flex items-center justify-center gap-f8 font-sans">
<slot />
</Typography>
</button>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/features/Header.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
<Meta title="UI Components/Features/Header" component={Header} />

<!--Primary-->
<Story name="Header - Frequency Logo">
<Header {menuItems} />
<Story name="Header">
<Header {menuItems} class="fixed left-0 top-0 w-full" />
</Story>
23 changes: 14 additions & 9 deletions src/lib/features/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@
export let menuItems: MenuItem[] = [];
</script>

<div class={`flex h-[80px] justify-between p-f16 md:p-0 ${$$restProps.class}`}>
<!-- For Desktop -->
<div class="flex w-[146px] items-center text-teal md:w-[200px]">
<FrequencyLogo />
</div>
<div class={`header-shadow font-title flex h-[85px] w-[100vw] items-center justify-center ${$$restProps.class}`}>
<div class="flex w-full max-w-screen-xl items-center justify-between sm:px-f20 md:px-f32 lg:pt-f24">
<!-- For Desktop -->
<div class="flex w-[146px] items-center text-teal md:w-[200px]">
<FrequencyLogo />
</div>

<div class="hidden items-stretch lg:flex">
<NavMenu {menuItems} />
<!-- For Mobile -->
<NavMenuMobile {menuItems} />
</div>

<!-- For Mobile -->
<NavMenuMobile {menuItems} />
</div>

<style>
.header-shadow {
box-shadow: 0 4px 4px 0 #00000040;
}
</style>
19 changes: 11 additions & 8 deletions src/lib/features/NavMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,24 @@
});
</script>

<nav class="flex items-stretch gap-f40">
<nav class="hidden items-center gap-f40 lg:flex">
{#each menuItems as item}
{#if item.isButton}
<div class="content-center">
<Button class="px-6">
<a href={item.href} target={item.isExternal ? '_blank' : '_self'}>{`${item.label}`}</a>
</Button>
</div>
<Button
size="auto"
class="shadow-[0_4px_4px_0_#00000040] lg:mt-[-16px]"
href={item.href}
target={item.isExternal ? '_blank' : '_self'}
>
{item.label}
</Button>
{:else}
<a
href={item.href}
target={item.isExternal ? '_blank' : '_self'}
class={`h6 underline-on-nav-hover border-color flex content-center px-2 py-6 font-bold text-navy transition-all duration-1000 after:bg-current ${item.viewportHighlightId && highlightId === item.viewportHighlightId ? 'underline-on-nav' : ''}`}
class={`h6 underline-on-nav-hover border-color flex content-center px-2 py-f20 font-bold text-navy transition-all duration-1000 after:bg-current ${item.viewportHighlightId && highlightId === item.viewportHighlightId ? 'underline-on-nav' : ''}`}
>
{`${item.label}`}
{item.label}
</a>
{/if}
{/each}
Expand Down
8 changes: 4 additions & 4 deletions src/lib/features/NavMenuMobile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@

<input type="checkbox" class="peer hidden" bind:checked={isOpen} id={toggleIdentifier} />
<OpenClose
classes="stroke-navy peer-checked:stroke-white peer-checked:hover:stroke-teal hover:stroke-teal flex self-center lg:hidden"
classes="cursor-pointer stroke-navy peer-checked:stroke-white peer-checked:hover:stroke-teal hover:stroke-teal flex self-center lg:hidden"
/>
<div
class="z-1 fixed right-0 top-0 z-10 flex h-0 w-[100vw] flex-col justify-between gap-f24 overflow-y-scroll bg-navy px-[12%] transition-[height] duration-[1s] peer-checked:h-[100vh] lg:hidden"
aria-expanded={isOpen}
>
<nav id="mobile-navigation" aria-label="Main" class="mt-[60px] flex flex-col gap-4 text-white">
<nav id="mobile-navigation" aria-label="Main" class="mb-f20 mt-[85px] flex flex-col gap-f24 text-white">
{#each menuItems as item}
{#if item.isButton}
<Button size="full" class="max-w-[360px] self-center">
<a href={item.href} target={item.isExternal ? '_blank' : '_self'}>{item.label}</a>
<Button size="full" class="mt-f24 max-w-[360px]" href={item.href} target={item.isExternal ? '_blank' : '_self'}>
{item.label}
</Button>
{:else}
<a
Expand Down
1 change: 1 addition & 0 deletions src/lib/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
.form-error {
@apply sm font-bold text-error;
}

.card-shadow {
box-shadow: 4px 4px 10px 0 rgb(0 0 0 / 25%);
}
Expand Down
3 changes: 2 additions & 1 deletion tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export default {
theme: {
extend: {
fontFamily: {
sans: ['Poppins'],
title: ['Newake', 'sans-serif'],
sans: ['Poppins', 'sans-serif'],
},
colors: tailwindColors,
fontSize: {
Expand Down

0 comments on commit 2e48aff

Please sign in to comment.