Skip to content

Commit 4c215ed

Browse files
committed
小さい文字の対応とその他調整
1 parent a0b0761 commit 4c215ed

File tree

6 files changed

+175
-52
lines changed

6 files changed

+175
-52
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,16 @@ https://classmethod.github.io/classmethod-marp-theme/index.html
239239
ヘッダーが表示されないスライド
240240
```
241241

242+
#### 文字を小さくする
243+
```markdown
244+
<!-- _class: small-text -->
245+
246+
# 文字を小さくする
247+
248+
スライド全体のフォントサイズが20%程度縮小されます。
249+
情報量が多いスライドや、通常のサイズでは収まりきらない内容を表示する際に便利です。
250+
```
251+
242252
## マークダウン要素のスタイリング
243253

244254
### 見出し(Headings)

classmethod-theme.css

Lines changed: 100 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@
4141
/* アクセント背景色 */
4242
--bg-accent-code: #e1e1e1;
4343

44+
/* 注釈 */
45+
--border-color: #D9D9D9;
4446

4547

4648
/* フォントサイズ変数 */
47-
--font-size-title: 40px;
49+
--font-size-title: 38px;
4850

4951
/* タイトル */
5052
--font-size-large: 36px;
@@ -64,10 +66,6 @@
6466
/* キャプション */
6567
--font-size-note: 16px;
6668

67-
/* 注釈 */
68-
--border-color: #D9D9D9;
69-
70-
7169
/* 行間変数 */
7270
--line-height-tight: 1.15;
7371

@@ -85,6 +83,46 @@
8583
--border-width: 1.47px;
8684
}
8785

86+
section.small-text {
87+
/* フォントサイズ変数(20%程度縮小) */
88+
89+
/* タイトル */
90+
--font-size-large: 29px;
91+
92+
/* 大きなテキスト */
93+
--font-size-medium: 26px;
94+
95+
/* 中サイズテキスト */
96+
--font-size-body: 21px;
97+
98+
/* 本文サイズ */
99+
--font-size-small: 18px;
100+
101+
/* 小さなテキスト */
102+
--font-size-caption: 16px;
103+
104+
/* キャプション */
105+
--font-size-note: 13px;
106+
107+
/* 行間変数 */
108+
109+
/* 狭い行間 */
110+
--line-height-tight: 1;
111+
112+
/* 標準行間 */
113+
--line-height-normal: 1.1;
114+
115+
/* 広い行間 */
116+
--line-height-loose: 1.3;
117+
118+
/* レイアウト */
119+
--slide-width: 1920px;
120+
--slide-height: 1080px;
121+
--content-padding: 92px;
122+
--border-radius: 8px;
123+
--border-width: 1.47px;
124+
}
125+
88126
*:not(code *) {
89127
color: var(--gray-medium);
90128
}
@@ -96,52 +134,58 @@ h1 {
96134
font-size: var(--font-size-title);
97135
line-height: var(--line-height-tight);
98136
font-weight: 600;
99-
margin-top: 10px;
100-
margin-bottom: 10px;
137+
margin-top: 6px;
138+
margin-bottom: 6px;
139+
padding-bottom: 0;
101140
}
102141

103142
h2 {
104143
font-size: var(--font-size-large);
105144
line-height: var(--line-height-tight);
106145
font-weight: 600;
107-
margin-top: 8px;
108-
margin-bottom: 8px;
146+
margin-top: 4px;
147+
margin-bottom: 4px;
148+
padding-bottom: 0;
109149
}
110150

111151
h3 {
112152
font-size: var(--font-size-medium);
113153
color: var(--gray-medium);
114154
line-height: var(--line-height-normal);
115155
font-weight: 600;
116-
margin-top: 6px;
117-
margin-bottom: 6px;
156+
margin-top: 4px;
157+
margin-bottom: 4px;
158+
padding-bottom: 0;
118159
}
119160

120161
h4 {
121162
font-size: var(--font-size-body);
122163
color: var(--gray-medium);
123164
line-height: var(--line-height-normal);
124165
font-weight: 600;
125-
margin-top: 6px;
126-
margin-bottom: 6px;
166+
margin-top: 4px;
167+
margin-bottom: 4px;
168+
padding-bottom: 0;
127169
}
128170

129171
h5 {
130172
font-size: var(--font-size-small);
131173
color: var(--gray-medium);
132174
line-height: var(--line-height-normal);
133175
font-weight: 600;
134-
margin-top: 6px;
135-
margin-bottom: 6px;
176+
margin-top: 4px;
177+
margin-bottom: 4px;
178+
padding-bottom: 0;
136179
}
137180

138181
h6 {
139182
font-size: var(--font-size-caption);
140183
color: var(--gray-medium);
141184
line-height: var(--line-height-normal);
142185
font-weight: 600;
143-
margin-top: 6px;
144-
margin-bottom: 6px;
186+
margin-top: 4px;
187+
margin-bottom: 4px;
188+
padding-bottom: 0;
145189
}
146190

147191
h1>strong,
@@ -156,30 +200,30 @@ h6>strong {
156200
/* 本文・段落 */
157201
p {
158202
font-size: var(--font-size-body);
159-
color: var(--gray-dark);
203+
color: var(--gray-medium);
160204
line-height: var(--line-height-loose);
161-
margin-bottom: 16px;
205+
margin-bottom: 8px;
162206
margin-top: 0;
163207
}
164208

165209
/* リスト */
166210
ul,
167211
ol {
168212
font-size: var(--font-size-body);
169-
color: var(--gray-dark);
213+
color: var(--gray-medium);
170214
line-height: var(--line-height-loose);
171215
padding-left: 0px;
172-
margin-top: 8px;
173-
margin-left: 16px;
174-
margin-bottom: 14px;
216+
margin-top: 0;
217+
margin-left: 22px;
218+
margin-bottom: 8px;
219+
}
175220

176-
>li:first-child {
177-
margin-top: 0;
178-
}
221+
ol {
222+
margin-left: 32px;
179223
}
180224

181225
li {
182-
padding-top: 8px;
226+
padding-top: 6px;
183227

184228
ul,
185229
ol {
@@ -188,6 +232,33 @@ li {
188232
margin-top: 0;
189233
}
190234

235+
&:first-child {
236+
padding-top: 0;
237+
}
238+
239+
&+li {
240+
margin-top: 0;
241+
}
242+
243+
&::marker {
244+
margin-left: 6px;
245+
}
246+
247+
}
248+
249+
/* 見出し直後のリストのマージンを削除 */
250+
251+
h1,
252+
h2,
253+
h3,
254+
h4,
255+
h5,
256+
h6 {
257+
258+
&+ul,
259+
&+ol {
260+
margin-top: 0;
261+
}
191262
}
192263

193264
code {
@@ -209,6 +280,7 @@ em {
209280
:is(pre, marp-pre) {
210281
background-color: var(--bg-accent-code);
211282
font-size: var(--font-size-small);
283+
margin-bottom: 8px;
212284
}
213285

214286
/* 引用 */
@@ -217,7 +289,7 @@ blockquote {
217289
color: var(--gray-medium);
218290
border-left: 4px solid var(--gray-light);
219291
padding-left: 1rem;
220-
margin: 1rem 0;
292+
margin: 12px 0;
221293
font-style: italic;
222294

223295
&::after {
@@ -277,7 +349,6 @@ table {
277349
}
278350
}
279351
}
280-
281352
}
282353

283354

debug/debug-slide.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ description: ClassMethodテーマの各クラスのテスト用スライド
1818

1919
---
2020

21-
<!-- _class: section -->
21+
<!-- _class: section small-te -->
2222
<!-- _paginate: false -->
2323

2424
## sectionクラスのテスト
@@ -425,6 +425,33 @@ console.log(result);
425425

426426
---
427427

428+
<!-- _class: small-text -->
429+
430+
# small-textクラスのテスト
431+
432+
# 見出しレベル1
433+
434+
## 見出しレベル2
435+
436+
### 見出しレベル3
437+
438+
#### 見出しレベル4
439+
440+
##### 見出しレベル5
441+
442+
###### 見出しレベル6
443+
444+
通常の段落テキスト
445+
446+
- リスト項目1
447+
- リスト項目2
448+
- リスト項目3
449+
1. 番号付きリスト項目1
450+
2. 番号付きリスト項目2
451+
1. ネストされた番号付きリスト項目1
452+
453+
---
454+
428455
<!-- _class: all-text-center align-center -->
429456

430457
![w:450px](https://classmethod.jp/wp-content/themes/cmn/assets/images/common/logo_classmethod.svg)

index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

sample-slide.html

Lines changed: 25 additions & 20 deletions
Large diffs are not rendered by default.

sample-slide.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: サンプルスライドです。
1111
特にスライド上部にある"_class: "は大切な要素なので間違えないようにしてください
1212
-->
1313

14-
<!-- _class: title -->
14+
<!-- _class: title -->
1515
<!-- _paginate: false -->
1616

1717
![classmethod-logo w:400px](https://classmethod.jp/wp-content/themes/cmn/assets/images/common/logo_classmethod.svg)
@@ -359,6 +359,16 @@ $$
359359

360360
---
361361

362+
<!-- _class: small-text -->
363+
364+
# 文字を小さくする
365+
366+
`small-text` クラスを使用すると、スライド全体のフォントサイズが20%程度縮小されます。
367+
368+
情報量が多いスライドや、通常のサイズでは収まりきらない内容を表示する際に便利です。
369+
370+
---
371+
362372
<!-- _class: all-text-center align-center -->
363373

364374
![w:450px](https://classmethod.jp/wp-content/themes/cmn/assets/images/common/logo_classmethod.svg)

0 commit comments

Comments
 (0)