Skip to content

Commit 9ed5e50

Browse files
committed
Initial cut at moving rest of pages to Tailwind
1 parent 1159c99 commit 9ed5e50

File tree

10 files changed

+43
-169
lines changed

10 files changed

+43
-169
lines changed

src/components/BlogListItem.astro

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ const dateString = formatShortMDY(date);
3636
const thumbnailSize = `${ThumbnailUnits}rem`;
3737
---
3838

39-
<li>
39+
<li class="my-6 flex flex-row gap-4">
4040
<a href={postURL}>
4141
{thumbnailImage
42-
? <Image class="thumbnail"
42+
? <Image class="thumbnail aspect-square object-cover object-center w-56 h-56"
4343
src={thumbnailImage}
4444
alt={image_alt}
4545
widths={[Thumbnail2X]}
@@ -48,38 +48,10 @@ const thumbnailSize = `${ThumbnailUnits}rem`;
4848
: <DefaultThumbnail size={thumbnailSize} />
4949
}
5050
</a>
51-
<div>
52-
<time datetime={date?.toISOString()}>{dateString}</time>
53-
<h3><a href={postURL}>{title}</a></h3>
54-
{/* descriptionHTML is formatted as a <p> tag */}
51+
<div class="flex-1">
52+
<time class="block text-gray-500 mb-2 leading-none" datetime={date?.toISOString()}>{dateString}</time>
53+
<h3 class="text-xl font-semibold mb-2"><a class="text-blue-700 hover:underline" href={postURL}>{title}</a></h3>
54+
{/* descriptionHTML is formatted as a <p> tag - Tailwind prose handles paragraph styling if applied upstream */}
5555
<Fragment set:html={descriptionHTML} />
5656
</div>
5757
</li>
58-
59-
<style>
60-
li {
61-
margin: var(--pico-block-spacing-vertical) 0 0 0;
62-
display: flex;
63-
flex-direction: row;
64-
gap: var(--pico-block-spacing-horizontal);
65-
}
66-
67-
img.thumbnail {
68-
aspect-ratio: 1;
69-
object-fit: cover;
70-
object-position: center;
71-
width: 14rem;
72-
height: 14rem;
73-
}
74-
75-
li > div {
76-
flex: 1;
77-
}
78-
79-
time {
80-
color: var(--pico-muted-color);
81-
margin-bottom: calc(var(--pico-block-spacing) * 0.5);
82-
line-height: 1;
83-
display: block;
84-
}
85-
</style>

src/components/GetStartedStep.astro

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,22 @@ interface Props {
1010
const { title, src } = Astro.props;
1111
---
1212

13-
<li>
14-
<figure>
15-
<Image src={src} alt={title} loading="eager" />
16-
<figcaption>
17-
<h3>{title}</h3>
13+
<li class="relative pl-4 mb-6 [counter-increment:item]">
14+
<figure class="flex flex-row items-start gap-6">
15+
<Image class="w-24" src={src} alt={title} loading="eager" />
16+
<figcaption class="p-0">
17+
<h3 class="my-2 text-xl text-primary font-semibold">{title}</h3>
1818
<slot />
1919
</figcaption>
2020
</figure>
2121
</li>
2222

2323
<style>
24-
figure {
25-
display: flex;
26-
flex-direction: row;
27-
align-items: flex-start;
28-
gap: 1.5rem;
29-
}
30-
31-
figure figcaption {
32-
padding: 0;
33-
}
34-
35-
figure img {
36-
width: 100px;
37-
}
38-
39-
h3 {
40-
margin: 0.5rem 0;
41-
font-size: 1.25rem;
42-
color: var(--color-accent);
43-
}
44-
45-
li {
46-
counter-increment: item;
47-
padding-left: 1rem;
48-
margin-bottom: var(--pico-block-spacing-vertical);
49-
position: relative;
50-
}
51-
5224
li::before {
5325
content: counter(item);
5426
font-weight: bold;
5527
font-size: 2rem;
56-
color: var(--color-accent);
28+
color: var(--color-sf-red);
5729
position: absolute;
5830
left: -1.5rem;
5931
line-height: 1;

src/components/HeaderNav.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const routes = [
3030
{routes.map((route) => (
3131
<a
3232
href={route.href}
33-
class={`font-[var(--font-barlow)] font-bold text-lg transition-colors ${
33+
class={`no-underline hover:underline text-lg transition-colors ${
3434
route.highlight
3535
? "bg-[var(--color-sf-red)] text-white px-4 py-2 rounded-lg hover:bg-[#d54d4b]"
3636
: "text-gray-800 hover:text-[var(--color-sf-red)]"

src/components/TeamList.astro

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import john from "@/assets/team/john-dunning.png";
77
import robby from "@/assets/team/robby-taine.png";
88
---
99

10-
<section>
10+
<section class="my-6 flex flex-row flex-wrap items-start gap-12">
1111
<TeamMember
1212
name="Francis Li"
1313
title="President"
@@ -38,14 +38,3 @@ import robby from "@/assets/team/robby-taine.png";
3838
image={john}
3939
/>
4040
</section>
41-
42-
<style>
43-
section {
44-
margin: var(--pico-block-spacing-vertical) 0;
45-
display: flex;
46-
flex-direction: row;
47-
flex-wrap: wrap;
48-
align-items: flex-start;
49-
gap: var(--pico-block-spacing);
50-
}
51-
</style>

src/components/TeamMember.astro

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,15 @@ interface Props {
1111
const { name, title, image } = Astro.props;
1212
---
1313

14-
<figure>
14+
<figure class="flex-grow basis-0 min-w-[15ch] flex flex-col justify-between items-center gap-2">
1515
<Image
16+
class="rounded-full w-[114px] h-[114px] object-cover"
1617
src={image}
1718
alt={name}
1819
loading="eager"
1920
/>
2021
<figcaption>
21-
<h3>{name}</h3>
22-
<h4>{title}</h4>
22+
<h3 class="text-center m-0 font-semibold text-xl">{name}</h3>
23+
<h4 class="text-center m-0 font-normal text-base mt-1">{title}</h4>
2324
</figcaption>
2425
</figure>
25-
26-
<style>
27-
figure {
28-
flex-grow: 1;
29-
flex-basis: 0%;
30-
min-width: 15ch;
31-
display: flex;
32-
flex-direction: column;
33-
justify-content: space-between;
34-
align-items: center;
35-
gap: calc(.5 * var(--pico-block-spacing));
36-
}
37-
38-
img {
39-
border-radius: 50%;
40-
width: 114px;
41-
height: 114px;
42-
object-fit: cover;
43-
}
44-
45-
h3, h4 {
46-
text-align: center;
47-
margin: 0;
48-
}
49-
50-
h3 {
51-
font-size: 1.25rem;
52-
}
53-
54-
h4 {
55-
font-weight: normal;
56-
font-size: 1rem;
57-
margin-top: 0.25rem;
58-
}
59-
</style>

src/pages/about/index.astro

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ const minutes = await getMinutes();
4141
<a href="https://www.civictechnologists.org/">Alliance of Civic Technologists</a>.
4242
</p>
4343

44-
<h2 id="core-team">Meet the Board</h2>
44+
<h2 class="text-2xl font-bold mt-8 mb-4" id="core-team">Meet the Board</h2>
4545

4646
<TeamList />
4747

4848
{minutes.length > 0 &&
49-
<h3 id="minutes">Minutes of Quarterly Board Meetings</h3>
49+
<h3 class="text-xl font-semibold mt-6 mb-3" id="minutes">Minutes of Quarterly Board Meetings</h3>
5050

51-
<ul>
51+
<ul class="list-disc pl-5 space-y-1 mb-6">
5252
{minutes.map(({ data: { url, year, quarter, isDraft }}) => (
5353
<li>
5454
<a href={url} target="_blank">
@@ -59,11 +59,11 @@ const minutes = await getMinutes();
5959
</ul>
6060
}
6161

62-
<h2 id="code-of-conduct">Code of Conduct</h2>
62+
<h2 class="text-2xl font-bold mt-8 mb-4" id="code-of-conduct">Code of Conduct</h2>
6363

6464
<p>SF Civic Tech is a space for everyone. What does that mean?</p>
6565

66-
<ul>
66+
<ul class="list-disc pl-5 space-y-1 mb-4">
6767
<li>We value the people here and make everyone feel welcome</li>
6868
<li>We make room for all brigade members to engage, discuss, and collaborate</li>
6969
<li>We support each other to build a strong civic tech community</li>
@@ -85,13 +85,7 @@ const minutes = await getMinutes();
8585
<a href="mailto:[email protected]">[email protected]</a>.
8686
</p>
8787

88-
<a href="about/code-of-conduct" role="button">
88+
<a href="about/code-of-conduct" role="button" class="inline-block bg-primary hover:bg-blue-700 text-white font-bold py-2 px-4 rounded mt-2">
8989
Read the full Code of Conduct
9090
</a>
9191
</BaseLayout>
92-
93-
<style>
94-
a[role="button"] {
95-
margin-top: calc(.5 * var(--pico-block-spacing-vertical));
96-
}
97-
</style>

src/pages/blog/[slug].astro

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,16 @@ const meta = {
4646
header=""
4747
meta={meta}
4848
>
49-
<h1>{title}</h1>
50-
<div class="date">
49+
<h1 class="mb-2 text-3xl font-bold">{title}</h1>
50+
<div class="date text-sm mb-6 flex justify-between items-center">
5151
<time datetime={date?.toISOString()}>{dateString}</time>
5252
<NavLink href="/blog">All posts</NavLink>
5353
</div>
5454
{imageData &&
55-
<p>
55+
<p class="mb-4">
5656
<Image src={imageData} alt={image_alt} />
5757
</p>}
58-
<Content />
58+
<div class="prose max-w-none">
59+
<Content />
60+
</div>
5961
</BaseLayout>
60-
61-
<style>
62-
h1 {
63-
margin-bottom: calc(var(--pico-block-spacing-vertical) * .5);
64-
}
65-
66-
.date {
67-
font-size: smaller;
68-
margin-bottom: calc(var(--pico-block-spacing-vertical) * 1.5);
69-
display: flex;
70-
justify-content: space-between;
71-
align-items: center;
72-
}
73-
</style>

src/pages/donate.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import BaseLayout from "@/layouts/BaseLayout.astro";
33
---
44

55
<BaseLayout title="Donate" header="Help Support SF Civic Tech">
6-
<p>
6+
<p class="mb-4">
77
SF Civic Tech members meet every week to make our community and government
88
better. Every hack night, talk, workshop, event, and project is organized
99
100% by volunteers.
1010
</p>
1111

12-
<p>
12+
<p class="mb-4">
1313
We are supported by generous sponsors and individuals. Help us continue to
1414
do this work through a tax-deductible donation on our Open Collective page.
1515
</p>
1616

17-
<p>
18-
<a href="https://opencollective.com/sfcivictech" role="button">
17+
<p class="mb-4">
18+
<a href="https://opencollective.com/sfcivictech" class="inline-block bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
1919
Donate Now!
2020
</a>
2121
</p>

src/pages/get-started.astro

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const meta = {
1616
<BaseLayout title="Get Started"
1717
meta={meta}
1818
>
19-
<p>
19+
<p class="mb-4">
2020
Regardless of skillset or background, anyone can contribute to their
2121
community through SF Civic Tech
2222
</p>
23-
<ol class="steps">
23+
<ol class="list-none [counter-reset:item] mt-6">
2424
<GetStartedStep
2525
title="Tell us about yourself"
2626
src={about}
@@ -33,8 +33,8 @@ const meta = {
3333
title="Onboard"
3434
src={onboard}
3535
>
36-
<ol>
37-
<li>
36+
<ol class="list-decimal pl-5 space-y-1">
37+
<li class="marker:initial">
3838
Read our <a href={base(codeOfConductURL)}>Code of Conduct</a>
3939
</li>
4040
<li>
@@ -63,15 +63,3 @@ const meta = {
6363
</GetStartedStep>
6464
</ol>
6565
</BaseLayout>
66-
67-
<style>
68-
ol.steps {
69-
list-style: none;
70-
counter-reset: item;
71-
margin-top: var(--pico-block-spacing-vertical);
72-
}
73-
74-
a {
75-
font-weight: bold;
76-
}
77-
</style>

src/styles/global.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@
6161
p {
6262
@apply mb-4;
6363
}
64+
65+
a:where(a:not([role=button])), [role=link] {
66+
color: var(--color-sf-red);
67+
@apply underline font-semibold;
68+
}
6469
}
6570

6671
@layer utilities {

0 commit comments

Comments
 (0)