Skip to content

Commit

Permalink
fix(styles): favicons & mobile header
Browse files Browse the repository at this point in the history
  • Loading branch information
raisedadead committed Sep 19, 2024
1 parent 08d0923 commit c23315c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 31 deletions.
5 changes: 3 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ const config = defineConfig({
title: 'Contribute | freeCodeCamp.org',
description: 'Contribute to freeCodeCamp.org',
logo: {
src: './public/icons/icon-96x96.png',
light: './public/icons/secondary_logo.svg',
dark: './public/icons/primary_logo.svg',
replacesTitle: true
},
favicon: './public/favicon-32x32.png',
favicon: 'favicon.ico',
tableOfContents: {
minHeadingLevel: 1,
maxHeadingLevel: 2
Expand Down
Binary file added public/favicon.ico
Binary file not shown.
File renamed without changes
1 change: 1 addition & 0 deletions public/icons/primary_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/icons/secondary_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 17 additions & 28 deletions src/components/FCCHeader.astro
Original file line number Diff line number Diff line change
@@ -1,41 +1,30 @@
---
import type { Props } from '@astrojs/starlight/props';
import SiteTitle from '@astrojs/starlight/components/SiteTitle.astro';
import LanguageSelect from '@astrojs/starlight/components/LanguageSelect.astro';
import Search from '@astrojs/starlight/components/Search.astro';
import SocialIcons from '@astrojs/starlight/components/SocialIcons.astro';
import FCCThemeSelect from './FCCThemeSelect.astro';
---

<nav class='fixed top-0 left-0 right-0 shadow-md z-50'>
<div class='mx-auto px-4 h-16 flex items-center justify-between'>
{/* Left: Search */}
<div class='flex-shrink-0 w-64'>
<Search {...Astro.props} />
</div>

{/* Center: Logo */}
<div class='flex-grow flex justify-center'>
<a href='/intro/' class='flex items-center'>
<img
src='https://cdn.freecodecamp.org/platform/universal/fcc_secondary.svg'
alt='freeCodeCamp.org'
class='h-8 dark:hidden'
/>
<img
src='https://cdn.freecodecamp.org/platform/universal/fcc_primary.svg'
alt='freeCodeCamp.org'
class='h-8 hidden dark:block'
/>
</a>
<div class='flex justify-between items-center'>
<div class='flex md:w-64'>
<Search {...Astro.props} />
</div>
<div class='flex-1 flex justify-center'>
<div class='overflow-hidden max-w-[240px]'>
<SiteTitle {...Astro.props} />
</div>

{/* Right: Icons */}
<div class='flex-shrink-0 flex items-center space-x-4'>
</div>
<div class='hidden md:flex items-center space-x-4'>
<div
class="flex items-center space-x-4 after:content-[''] after:h-8 after:border-r after:border-gray-300 dark:after:border-gray-700"
>
<SocialIcons {...Astro.props} />
<div class='h-6 w-px bg-gray-300 dark:bg-gray-700'></div>
<FCCThemeSelect {...Astro.props} />
<LanguageSelect {...Astro.props} />
</div>
<FCCThemeSelect {...Astro.props} />
<LanguageSelect {...Astro.props} />
</div>
</nav>
</div>
2 changes: 1 addition & 1 deletion src/components/FCCThemeSelect.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<theme-button>
<theme-button class='my-auto'>
<button
class='theme-toggle rounded-full border-none cursor-pointer px-1 py-0 flex items-center'
aria-label='Toggle Theme'
Expand Down

0 comments on commit c23315c

Please sign in to comment.