Skip to content

Commit d2d2b6a

Browse files
committed
Use CSS Modules in Footer component
1 parent 73ac636 commit d2d2b6a

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

‎src/components/Footer/index.astro‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ import { formatPhoneNumber } from '@components/Footer/server'
66
import Sprite from '@components/Sprite/index.astro'
77
import type { SpriteName } from '@components/Sprite/sprites'
88
import AuthorAvatar from '@assets/images/avatars/kevin-brown.webp'
9-
import '@components/Footer/footer.css'
9+
import styles from './footer.module.css'
1010
1111
const year = new Date().getFullYear()
1212
---
1313

1414
<site-footer>
1515
<footer class="bg-bg-offset text-text w-full mt-6 pt-4" role="contentinfo">
16-
<div class="flex flex-col footer-grid mx-auto max-w-300 w-[90%] px-4 sm:px-6 lg:px-8 pb-3">
16+
<div class:list={[styles.footerGrid, 'flex flex-col mx-auto max-w-300 w-[90%] px-4 sm:px-6 lg:px-8 pb-3']}>
1717
{/* Page footer company contact */}
18-
<div class="footer-contact mt-3 sm:mt-0 sm:flex sm:items-center">
18+
<div class:list={[styles.footerContact, 'mt-3 sm:mt-0 sm:flex sm:items-center']}>
1919
{/* Mobile: avatar and company name in same row, Desktop: avatar on left side */}
2020
<div class="flex items-center sm:block sm:mr-4 sm:w-[clamp(5em,25%,8em)]">
2121
<div class="mr-3 w-16 sm:mr-0 sm:w-full">
@@ -56,18 +56,21 @@ const year = new Date().getFullYear()
5656
</address>
5757
</div>
5858
{/* "Hire Me" block with current month and year set by script */}
59-
<div class="footer-hire-me hidden lg:block">
59+
<div class:list={[styles.footerHireMe, 'hidden lg:block']}>
6060
<a
6161
href="/contact"
6262
id="page-footer__hire-me-anchor"
63-
class="footer-hire-me-anchor hidden uppercase text-text underline decoration-dotted decoration-text underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none after:content-['>']"
63+
class:list={[
64+
styles.footerHireMeAnchor,
65+
"hidden uppercase text-text underline decoration-dotted decoration-text underline-offset-4 hover:text-secondary hover:decoration-secondary focus:text-secondary focus:decoration-secondary focus:outline-none after:content-['>']",
66+
]}
6467
aria-label="Available for hire, contact me"
6568
>
6669
Available Now. Hire Me
6770
</a>
6871
</div>
6972
{/* Page footer Social Share links */}
70-
<div class="footer-social">
73+
<div class={styles.footerSocial}>
7174
{
7275
contactData.company.social
7376
.sort((a, b) => a.order - b.order)
@@ -92,7 +95,7 @@ const year = new Date().getFullYear()
9295
}
9396
</div>
9497
<div
95-
class="footer-bottom-row flex justify-between sm:justify-evenly lg:flex-col px-1 pt-4 pb-3 sm:p-0 lg:pl-8"
98+
class:list={[styles.footerBottomRow, 'flex justify-between sm:justify-evenly lg:flex-col px-1 pt-4 pb-3 sm:p-0 lg:pl-8']}
9699
>
97100
{/* Page footer Subscribe link */}
98101
<span class="flex flex-col justify-center lg:pt-3">
@@ -121,7 +124,7 @@ const year = new Date().getFullYear()
121124
</span>
122125
</span>
123126
{/* Page footer RSS link */}
124-
<span class="footer-feed-icon flex items-center w-12 lg:h-12 lg:w-12">
127+
<span class:list={[styles.footerFeedIcon, 'flex items-center w-12 lg:h-12 lg:w-12']}>
125128
<a
126129
href={absoluteUrl('/feed.xml', Astro.site)}
127130
title="RSS Feed"
@@ -133,7 +136,7 @@ const year = new Date().getFullYear()
133136
</span>
134137
</div>
135138
{/* Page footer Author link and Date */}
136-
<div class="footer-copyright flex justify-center py-4 sm:p-0 lg:mt-2">
139+
<div class:list={[styles.footerCopyright, 'flex justify-center py-4 sm:p-0 lg:mt-2']}>
137140
<span>
138141
&copy; 2018&ndash;{year}
139142
</span>

0 commit comments

Comments
 (0)