Skip to content

Commit 37c5b78

Browse files
committed
fix: use background color as constats
1 parent 7096b98 commit 37c5b78

File tree

4 files changed

+14
-22
lines changed

4 files changed

+14
-22
lines changed

2025/src/components/Header.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
import LanguagePicker from '../components/LanguagePicker.astro'
3+
4+
import { MAIN_BACKGROUND_COLOR } from '@/consts';
35
---
46

57
<header class="hero">
@@ -9,10 +11,10 @@ import LanguagePicker from '../components/LanguagePicker.astro'
911
</div>
1012
</header>
1113

12-
<style>
14+
<style define:vars={{ mainBackgroundColor: MAIN_BACKGROUND_COLOR }}>
1315
/* Hero Section */
1416
.hero {
15-
background: linear-gradient(110deg, #9ebd13 0%, #069700 100%);
17+
background: linear-gradient(110deg, #9ebd13 0%, var(--mainBackgroundColor) 100%);
1618
color: #fff;
1719
text-align: center;
1820

2025/src/consts/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ import { base } from "astro:config/client"
33

44
import { DOMAIN } from "./_domain.js" with { type: "macro" }
55

6-
76
export const BASE_URL = ufo.joinURL(DOMAIN, base)
7+
8+
export const MAIN_BACKGROUND_COLOR = `#069700`;

2025/src/pages/en.astro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import Layout from '../layouts/Layout.astro';
33
import VenueMap from '../components/VenueMap.astro';
44
import AnnouncementSlides from '../components/AnnouncementSlides.astro';
5+
6+
import { MAIN_BACKGROUND_COLOR } from '@/consts';
57
---
68

79
<Layout lang="en">
@@ -80,7 +82,7 @@ import AnnouncementSlides from '../components/AnnouncementSlides.astro';
8082
</section>
8183
</Layout>
8284

83-
<style>
85+
<style define:vars={{ mainBackgroundColor: MAIN_BACKGROUND_COLOR }}>
8486
h3 {
8587
font-size: 1.2rem;
8688
}
@@ -122,7 +124,7 @@ section + section {
122124
/* Contact Button */
123125
.btn {
124126
display: inline-block;
125-
background-color: #069700;
127+
background-color: var(--mainBackgroundColor);
126128
color: #fff;
127129
padding: 12px 20px;
128130
border-radius: 4px;

2025/src/pages/ja.astro

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import Layout from '../layouts/Layout.astro';
33
import VenueMap from '../components/VenueMap.astro';
44
import AnnouncementSlides from '../components/AnnouncementSlides.astro';
5+
6+
import { MAIN_BACKGROUND_COLOR } from '@/consts';
57
---
68

79
<Layout>
@@ -83,7 +85,7 @@ import AnnouncementSlides from '../components/AnnouncementSlides.astro';
8385
</section>
8486
</Layout>
8587

86-
<style>
88+
<style define:vars={{ mainBackgroundColor: MAIN_BACKGROUND_COLOR }}>
8789
h3 {
8890
font-size: 1.2rem;
8991
}
@@ -96,21 +98,6 @@ h3 {
9698
padding: 24px 0;
9799
}
98100

99-
/* Hero Section */
100-
.hero {
101-
background: linear-gradient(110deg, #9ebd13 0%, #069700 100%);
102-
color: #fff;
103-
text-align: center;
104-
105-
h1 {
106-
font-size: 4rem;
107-
margin-bottom: 16px;
108-
font-family: "Cardo", serif;
109-
font-weight: 400;
110-
font-style: italic;
111-
}
112-
}
113-
114101
/* Section Title */
115102
.section-title {
116103
font-size: 2.4rem;
@@ -139,7 +126,7 @@ section + section {
139126
/* Contact Button */
140127
.btn {
141128
display: inline-block;
142-
background-color: #069700;
129+
background-color: var(--mainBackgroundColor);
143130
color: #fff;
144131
padding: 12px 20px;
145132
border-radius: 4px;

0 commit comments

Comments
 (0)