Skip to content

Commit 1cc8a0b

Browse files
グローバルスタイルのリファクタリング (#205)
* style(typography.scss): adjust text-underline-offset for better visual balance style(variables.scss): refine color definitions for improved consistency style(body.scss): add padding-right for body element on larger screens to prevent layout shift style(wrapper.scss): reduce max-width of container for better responsiveness * style(heading.module.scss): change background color from dark green to accent color for better visual consistency style(works-images.module.scss): remove ToDo comment about breakpoint constants and add comment in Japanese for clarity style(index.module.scss): update grid column min width from 15rem to 320px for improved responsiveness and change border color to accent color for consistency
1 parent a1d188a commit 1cc8a0b

File tree

7 files changed

+22
-27
lines changed

7 files changed

+22
-27
lines changed

client/src/components/scss/heading.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.heading {
22
padding-block: var(--spacing-s);
33
padding-inline: var(--spacing-m);
4-
background-color: var(--color-dark-green-1);
4+
background-color: var(--color-accent-1);
55
color: var(--color-white-1);
66
border-radius: 8px;
77

client/src/components/scss/works-images.module.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
border-radius: 4px;
99
}
1010

11+
/* 標準の CSS ではメディアクエリのブレイクポイントに変数は使えないので、妥協して直接定義した */
1112
@media screen and (max-width: 639.8px) {
1213
grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
1314
}
1415
@media screen and (min-width: 640px) {
1516
grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
1617
}
17-
/* ToDo: 画面幅ブレイクポイントの定数の定義 */
18-
1918
}

client/src/pages/scss/index.module.scss

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
.exhibitionList {
22
ul {
33
display: grid;
4-
grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
4+
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
55
gap: var(--spacing-s);
66

77
li {
88
padding-block: var(--spacing-s);
99
padding-inline: var(--spacing-m);
10-
border: 1px solid var(--color-dark-green-2);
10+
border: 1px solid var(--color-accent-2);
1111
border-radius: 8px;
1212

13-
a {
14-
color: var(--color-dark-green-1);
15-
}
16-
1713
h3 {
1814
font-size: var(--font-size-xl);
1915
margin-block: calc(var(--spacing-s) - var(--half-leading));
2016
}
2117

2218
p {
23-
color: var(--color-dark-green-2);
2419
font-size: var(--font-size-s);
2520
margin-block: calc(var(--spacing-xxs) - var(--half-leading));
2621
}

client/src/scss/foundation/_typography.scss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ html {
66
color: var(--color-text);
77
background-color: var(--color-background);
88
letter-spacing: 0.008em;
9-
text-underline-offset: calc(var(--half-leading) / 1.5);
9+
text-underline-offset: calc(var(--half-leading) / 2);
1010
}
1111

1212
h1,
@@ -17,10 +17,6 @@ h4 {
1717
}
1818

1919
a {
20+
color: var(--color-accent-1);
2021
text-decoration: none;
21-
@media (hover) {
22-
&:hover {
23-
text-decoration: underline;
24-
}
25-
}
2622
}

client/src/scss/foundation/_variables.scss

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
/* Color palette */
33

44
--color-black-1: oklch(0.25 0.005 150);
5-
--color-black-2: oklch(0.29 0.005 150);
6-
--color-white-1: oklch(0.96 0.005 150);
7-
--color-white-2: oklch(0.92 0.005 150);
5+
--color-black-2: oklch(0.3 0.005 150);
6+
--color-white-1: oklch(0.97 0.005 150);
7+
--color-white-2: oklch(0.91 0.005 150);
88

9-
--color-light-green-1: oklch(0.95 0.08 150);
10-
--color-dark-green-1: oklch(0.35 0.08 150);
11-
--color-dark-green-2: oklch(0.4 0.07 150);
9+
--color-green-1: oklch(0.35 0.08 150);
10+
--color-green-2: oklch(0.5 0.08 150);
11+
--color-green-3: oklch(0.6 0.08 150);
12+
--color-green-4: oklch(0.8 0.08 150);
1213

1314
--color-light-pink-1: oklch(0.95 0.08 320);
1415
--color-dark-pink-1: oklch(0.35 0.08 320);
@@ -17,7 +18,8 @@
1718
/* Color definitions */
1819
--color-text: var(--color-black-1);
1920
--color-background: var(--color-white-1);
20-
--color-accent-primary: var(--color-dark-green-1);
21+
--color-accent-1: var(--color-green-1);
22+
--color-accent-2: var(--color-green-2);
2123

2224
/* Font sizes */
2325
--font-size-base: 18px;

client/src/scss/layout/_body.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
/* Gutter for scrollbar */
2-
body {
3-
padding-inline-start: calc(100vw - 100%);
1+
/* スクロールバー表示時に body 要素にパディングを設定することにより、レイアウトのズレを防ぐ。
2+
画面幅が小さいときは、左右に余白がないため不要 */
3+
@media screen and (min-width: 1024px) {
4+
body {
5+
padding-right: calc(100vw - 100%);
6+
}
47
}

client/src/scss/layout/_wrapper.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
.container {
66
width: 100%;
7-
max-width: 1080px;
7+
max-width: 1024px;
88
padding-inline: var(--spacing-m);
99
}
1010
}

0 commit comments

Comments
 (0)