-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
334 lines (293 loc) · 7.04 KB
/
style.css
File metadata and controls
334 lines (293 loc) · 7.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
/*
* --- Font Face ---
* ローカルにインストールされたNoto Sans JPフォントを優先的に使用
*/
@font-face {
font-family: "Local Noto Sans JP";
src: local("Noto Sans JP");
}
/*
* --- Theme Variables ---
* テーマ全体で利用する色や影を変数として定義
*/
:root {
--color-surface: #fcfcfc;
--color-border: #ccc;
--color-bg: #ffffff;
--color-table-bg: #f7f7f7;
--color-text: #000;
--color-primary: #007fff;
--color-primary-dark: #005fcc;
--color-divider: #000;
--color-white: #fff;
/* リンクの色 */
--color-link: var(--color-primary);
--color-link-active: var(--color-primary-dark);
/* マテリアルデザイン風のシャドウ */
/* 凸 型 */
--shadow-elevation: 0 0 4px rgba(0,0,0,0.15), 0 0 4px rgba(0,0,0,0.25);
/* 凹 型 */
--shadow-elevation-inset: inset 0 0 4px rgba(0,0,0,0.15), inset 0 0 4px rgba(0,0,0,0.25);
}
/* ダークモードのカラー変数 */
[data-theme="dark"] {
--color-surface: #232323;
--color-border: #444;
--color-bg: #2c2c2c;
--color-table-bg: #282828;
--color-text: #f3f3f3;
--color-divider: #444;
/* ダークモードではリンク色を明るくする */
--color-link: #f3f3f3;
--color-link-active: #b5b5b5;
/* ダークモード用のシャドウ */
/* 凸 型 */
--shadow-elevation: 0 0 4px rgba(0,0,0,0.4), 0 0 4px rgba(0,0,0,0.6);
/* 凹 型 */
--shadow-elevation-inset: inset 0 0 4px rgba(0,0,0,0.4), inset 0 0 4px rgba(0,0,0,0.6);
}
/*
* --- Base Styles ---
* 基本的なHTML要素のスタイル
*/
* {
transition: all 0.2s ease-in-out !important;
box-sizing: border-box;
}
html, body {
height: 100%;
margin: 0;
padding: 0;
font-size: 14px;
background-color: var(--color-bg);
color: var(--color-text);
}
body {
font-family: "Local Noto Sans JP", "Noto Sans JP", sans-serif;
line-height: 1.9;
min-height: 100vh;
display: flex;
flex-direction: column;
}
/*
* --- Layout Elements ---
* ヘッダー、メインコンテンツ、フッターのレイアウト
*/
header {
background-color: var(--color-surface);
border-bottom: 1px solid var(--color-border);
padding: 1rem;
display: flex;
box-shadow: var(--shadow-elevation);
border-radius: 0 0 0.5rem 0.5rem; /* 下部に丸み */
}
/* main要素が利用可能な高さいっぱいに広がるように設定 */
main {
flex: 1;
padding: 1rem;
}
footer {
text-align: center;
padding: 1rem 0;
background-color: var(--color-surface);
border-top: 1px solid var(--color-border);
box-shadow: var(--shadow-elevation);
border-radius: 0.5rem 0.5rem 0 0; /* 上部に丸み */
}
/*
* --- Typography & Content Elements ---
* 見出し、段落、画像などのスタイル
*/
h1, h2, h3, h4, h5, h6 {
font-weight: 500;
margin: 0.25em 0;
}
hr {
border: 0;
border-top: 1px solid var(--color-divider);
margin: 0.2rem 0;
}
p {
margin: 0;
}
/* 画像が親要素の幅を超えないようにし、シャドウを適用 */
img {
max-width: 100%;
height: auto;
box-shadow: var(--shadow-elevation);
}
a {
color: var(--color-link);
}
a:active{
color: var(--color-link-active);
}
button {
color: var(--color-text);
background-color: var(--color-bg);
border: var(--color-border) 1px solid;
padding: 0.25rem 0.5rem;
transition: background 0.2s, color 0.2s, transform 0.1s;
}
button:hover {
background-color: var(--color-primary);
color: var(--color-white);
transform: scale(1.04);
}
button:active {
background-color: var(--color-primary-dark);
color: var(--color-white);
transform: scale(0.97);
}
pre {
background-color: var(--color-surface);
border-radius: 0.5rem;
padding: 1rem 1rem;
white-space: pre;
overflow-x: auto;
box-shadow: var(--shadow-elevation-inset);
}
/*
* --- Table Styles ---
* テーブルのスタイル
*/
table {
border-collapse: collapse; /* セルの線を重ねる */
max-width: 100%;
display: block;
overflow-x: auto;
}
th,
td {
border: var(--color-border) 1px solid;
padding: 0.2rem 1rem;
}
th {
text-align: left;
}
tr:nth-child(odd){
background: var(--color-table-bg);
}
/*
* --- ID Styles ---
* IDセレクタで指定する固有の要素のスタイル
*/
#theme-toggle {
background: none;
border: none;
font-size: 1.3em;
cursor: pointer;
transition: color 0.2s;
color: inherit;
outline: none;
}
/* キーボード操作時のフォーカスを視覚的に示す */
#theme-toggle:focus {
outline: 2px solid var(--color-primary);
}
/*
* --- Class Styles ---
* クラスセレクタで指定する再利用可能なコンポーネントのスタイル
*/
/* サイトタイトル */
.title {
line-height: 1.2;
border-left: 0.1rem solid var(--color-text);
padding: 0.5em;
margin: 0.5rem 0;
text-decoration: none;
}
.title h1 {
font-weight: 300;
margin: 0;
}
a.title {
color: var(--color-text);
}
/* ナビゲーションメニュー */
.menu {
display: flex;
margin: auto 0;
margin-left: auto;
padding: 1rem;
}
/* ブログ記事の日付 */
.blog-date {
color: var(--color-text);
opacity: 0.7;
font-size: 0.9em;
margin-bottom: 1rem;
border-bottom: 1px solid var(--color-border);
}
/* スクリーンショット画像 */
.screenshot {
max-width: 70%;
}
.mini-screenshot {
max-width: 50%;
}
.micro-screenshot {
max-width: 30%;
}
/* テーマ切り替えトグルスイッチ */
.toggle-switch {
display: inline-flex;
align-items: center;
cursor: pointer;
/* 意図しないテキスト選択を防止 */
user-select: none;
}
/* HTML上のチェックボックスを非表示にする */
.toggle-switch input[type="checkbox"] {
display: none;
}
/* トグルスイッチのスライダー部分 */
.toggle-switch .slider {
width: 36px;
height: 20px;
background: var(--color-border);
border-radius: 999px;
position: relative;
transition: background 0.2s;
margin: 0 0.5em 0 0;
box-sizing: border-box;
}
/* トグルスイッチのつまみ */
.toggle-switch .slider::before {
content: "";
position: absolute;
left: 2px;
top: 2px;
width: 16px;
height: 16px;
background: var(--color-bg);
border-radius: 50%;
transition: transform 0.2s;
}
/* チェック時にスライダーの背景色を変更 */
.toggle-switch input[type="checkbox"]:checked + .slider {
background: var(--color-primary);
}
/* チェック時につまみを右に移動 */
.toggle-switch input[type="checkbox"]:checked + .slider::before {
transform: translateX(16px);
}
.toggle-switch .toggle-icon {
font-size: 1.2em;
transition: color 0.2s;
margin-left: 0.2em;
}
/*
* --- Media Queries ---
* レスポンシブデザインのためのスタイル
*/
@media (max-width: 680px) {
header {
flex-direction: column;
}
.menu {
margin: 0.5rem 0 0 0;
padding: 0;
margin-left: 0;
}
}