Skip to content

Commit c34b162

Browse files
committed
Code cleanup:
* Moved new classes from global.css into their components to limit their impact and scope creep of the global styles * Moved Block Open Source components from block to blockopensource as these are more part of the open source site and not the Kickstarter * Replaced CSS classes with Tailwind equivalents
1 parent 76597ef commit c34b162

File tree

7 files changed

+61
-87
lines changed

7 files changed

+61
-87
lines changed

src/components/block/ExternalLinkCard.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
33
import ContentSection from '@/components/block/ContentSection.astro';
4-
import Icon from './Icon.astro';
54
65
interface Props {
76
title: string;
@@ -25,7 +24,7 @@ const {
2524
href={href}
2625
target="_blank"
2726
rel="noopener noreferrer"
28-
class="external-link-title"
27+
class="text-current underline decoration-current transition-colors duration-200 hover:text-[var(--hover-text-color)]"
2928
>
3029
{title}
3130
</a>
@@ -35,4 +34,5 @@ const {
3534
</p>
3635
</div>
3736
</div>
38-
</ContentSection>
37+
</ContentSection>
38+

src/components/block/GovernanceCard.astro

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/components/blockopensource/GovernanceAndStandards.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import { governanceLinks } from './governance-links';
3-
import GovernanceLinkSection from '@/components/block/GovernanceLinkSection.astro';
3+
import GovernanceLinkSection from '@/components/blockopensource/GovernanceLinkSection.astro';
44
55
interface Props {
66
className?: string;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
3+
import ContentSection from '@/components/block/ContentSection.astro';
4+
import Icon from '@/components/block/Icon.astro';
5+
6+
interface Props {
7+
title: string;
8+
href: string;
9+
description: string;
10+
}
11+
12+
const {
13+
title,
14+
href,
15+
description
16+
} = Astro.props;
17+
---
18+
19+
<ContentSection
20+
hasDefaultInnerStyles={false}>
21+
<a
22+
href={href}
23+
target="_blank"
24+
rel="noopener noreferrer"
25+
class="group h-full py-8 flex items-center justify-between no-underline transition-colors duration-200 cursor-pointer border-b border-[var(--default-color)] text-[var(--default-color)] hover:text-[var(--hover-border-color)]"
26+
>
27+
<div class="flex-1 mr-9 grid grid-cols-[200px_1fr] gap-10 items-center py-2">
28+
<h4 class="text-left mt-0 mb-0 transition-colors duration-200 group-hover:text-[var(--hover-text-color)]">
29+
{title}
30+
</h4>
31+
<h4 class="font-normal mt-0 mb-0 transition-colors duration-200 group-hover:text-[var(--hover-text-color)]">
32+
{description}
33+
</h4>
34+
</div>
35+
<div class="flex-shrink-0 transition-transform duration-200 group-hover:scale-120 group-hover:text-[var(--hover-text-color)]">
36+
<Icon name="arrow-right" />
37+
</div>
38+
</a>
39+
</ContentSection>
40+

src/components/block/GovernanceLinkSection.astro renamed to src/components/blockopensource/GovernanceLinkSection.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import GovernanceCard from '@/components/block/GovernanceCard.astro';
2+
import GovernanceCard from '@/components/blockopensource/GovernanceCard.astro';
33
44
export interface GovernanceLink {
55
name: string;
@@ -28,7 +28,7 @@ const {
2828
<slot />
2929
</p>
3030
{subtitle && <h3 class="mt-15 mb-0">{subtitle}</h3>}
31-
<div id="governance" class="mt-15 grid grid-cols-1 gap-y-0 pt-0 pb-6 md:pb-8">
31+
<div class="mt-15 grid grid-cols-1 gap-y-0 pt-0 pb-6 md:pb-8 border-t border-[var(--default-color)]">
3232
{governanceLinks.map((governanceLink) => (
3333
<GovernanceCard
3434
title={governanceLink.name}
@@ -38,3 +38,4 @@ const {
3838
))}
3939
</div>
4040
</section>
41+

src/pages/block-open-source/index.astro

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,17 @@ const description = "At Block, we believe open source is at the heart of innovat
7272

7373
</ContentPageLayout>
7474

75+
<style>
76+
/* Content width utility class */
77+
.content-width-responsive {
78+
@apply w-full;
79+
}
80+
81+
@media (min-width: theme('screens.md')) {
82+
.content-width-responsive {
83+
width: var(--content-width-responsive); /* 4/5 on md+ */
84+
background-color: blue;
85+
}
86+
}
87+
</style>
88+

src/styles/global.css

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -589,46 +589,4 @@
589589
.group:hover .group-hover\:text-black {
590590
color: black;
591591
}
592-
593-
/* Governance card styles */
594-
#governance {
595-
border-top: 1px solid var(--default-color);
596-
}
597-
598-
.governance-card {
599-
border-bottom: 1px solid var(--default-color);
600-
color: var(--default-color);
601-
}
602-
603-
.governance-card:hover {
604-
color: var(--hover-border-color);
605-
}
606-
607-
.governance-card:hover .governance-text,
608-
.governance-card:hover .governance-icon {
609-
color: var(--hover-text-color);
610-
}
611-
612-
/* External link card title styles */
613-
.external-link-title {
614-
color: inherit;
615-
text-decoration: underline;
616-
text-decoration-color: currentColor;
617-
transition: color 0.2s ease;
618-
}
619-
620-
.external-link-title:hover {
621-
color: var(--hover-text-color);
622-
}
623-
624-
/* Content width utility class */
625-
.content-width-responsive {
626-
width: 100%; /* Full width on mobile */
627-
}
628-
629-
@media (width >= --theme(--breakpoint-md)) {
630-
.content-width-responsive {
631-
width: var(--content-width-responsive); /* 4/5 on md+ */
632-
}
633-
}
634592
}

0 commit comments

Comments
 (0)