@subroh0508/marp-theme-canvas 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,540 @@
1
+ @charset "UTF-8";
2
+ /*!
3
+ * White Canvas - 極力余計なスタイリングを廃した、シンプルなスライドテーマ
4
+ *
5
+ * 使用時はMarpのインラインスタイル指定で以下の変数を必ず定義してください。
6
+ * - --color-primary: メインカラー(h2の文字色など)
7
+ * - --color-accent: アクセントカラー(markタグの背景色など)
8
+ *
9
+ * 例:
10
+ * style: |
11
+ * :root {
12
+ * --color-primary: #3b91c4;
13
+ * --color-accent: #ead7a4;
14
+ * }
15
+ *
16
+ * @theme white-canvas
17
+ * @author subroh_0508
18
+ *
19
+ * @auto-scaling true
20
+ * @size 16:9 1920px 1080px
21
+ */
22
+ @import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700;900&display=swap");
23
+ :root {
24
+ --color-black: #000;
25
+ --color-white: #fff;
26
+ --color-grey-lightest: #cbd5e1;
27
+ --color-grey-lighter: #94a3b8;
28
+ --color-grey-light: #64748b;
29
+ --color-grey-medium: #475569;
30
+ --color-grey-dark: #334155;
31
+ --color-grey-darker: #1e293b;
32
+ --color-grey-darkest: #0f172a;
33
+ --color-blockquote-background: color-mix(in srgb, var(--color-grey-light) 10%, transparent);
34
+ --color-blockquote-mark: var(--color-grey-medium);
35
+ --color-blockquote-text: var(--color-grey-medium);
36
+ --color-table-row-bg: var(--color-white);
37
+ --color-table-row-bg-header: var(--color-grey-lightest);
38
+ --color-table-border: var(--color-grey-light);
39
+ --color-code-bg: color-mix(in srgb, var(--color-grey-light) 10%, transparent);
40
+ --color-code-fg: var(--color-grey-darkest);
41
+ --color-link: #2563eb;
42
+ --font-family-base: 'Noto Sans JP', sans-serif;
43
+ --font-family-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
44
+ --font-size-base: 40px;
45
+ --font-size-display: 2.5em;
46
+ --font-size-title: 2em;
47
+ --font-size-heading: 1.3em;
48
+ --font-size-medium: 1.15em;
49
+ --font-size-body: 1em;
50
+ --font-size-small: 0.85em;
51
+ --font-size-note: 0.7em;
52
+ --font-weight-normal: 400;
53
+ --font-weight-bold: 700;
54
+ --font-weight-black: 900;
55
+ --line-height-tight: 1.2;
56
+ --line-height-normal: 1.45;
57
+ --line-height-loose: 2;
58
+ --slide-padding-x: 80px;
59
+ --slide-padding-y: 80px;
60
+ --header-footer-margin-x: 80px;
61
+ --header-footer-margin-y: 20px;
62
+ --border-radius: 8px;
63
+ }
64
+
65
+ section pre :where(.hljs) {
66
+ color: #1f2328;
67
+ }
68
+ section pre :where(.hljs-doctag),
69
+ section pre :where(.hljs-keyword),
70
+ section pre :where(.hljs-meta .hljs-keyword),
71
+ section pre :where(.hljs-template-tag),
72
+ section pre :where(.hljs-template-variable),
73
+ section pre :where(.hljs-type),
74
+ section pre :where(.hljs-variable.language_) {
75
+ color: #cf222e;
76
+ }
77
+ section pre :where(.hljs-title),
78
+ section pre :where(.hljs-title.class_),
79
+ section pre :where(.hljs-title.class_.inherited__),
80
+ section pre :where(.hljs-title.function_) {
81
+ color: #6639ba;
82
+ }
83
+ section pre :where(.hljs-attr),
84
+ section pre :where(.hljs-attribute),
85
+ section pre :where(.hljs-literal),
86
+ section pre :where(.hljs-meta),
87
+ section pre :where(.hljs-number),
88
+ section pre :where(.hljs-operator),
89
+ section pre :where(.hljs-selector-attr),
90
+ section pre :where(.hljs-selector-class),
91
+ section pre :where(.hljs-selector-id),
92
+ section pre :where(.hljs-variable) {
93
+ color: #0550ae;
94
+ }
95
+ section pre :where(.hljs-string),
96
+ section pre :where(.hljs-meta .hljs-string),
97
+ section pre :where(.hljs-regexp) {
98
+ color: #0a3069;
99
+ }
100
+ section pre :where(.hljs-built_in),
101
+ section pre :where(.hljs-symbol) {
102
+ color: #953800;
103
+ }
104
+ section pre :where(.hljs-code),
105
+ section pre :where(.hljs-comment),
106
+ section pre :where(.hljs-formula) {
107
+ color: #59636e;
108
+ }
109
+ section pre :where(.hljs-name),
110
+ section pre :where(.hljs-quote),
111
+ section pre :where(.hljs-selector-pseudo),
112
+ section pre :where(.hljs-selector-tag) {
113
+ color: #0550ae;
114
+ }
115
+ section pre :where(.hljs-subst) {
116
+ color: #1f2328;
117
+ }
118
+ section pre :where(.hljs-section) {
119
+ font-weight: bold;
120
+ color: #0550ae;
121
+ }
122
+ section pre :where(.hljs-bullet) {
123
+ color: #3b2300;
124
+ }
125
+ section pre :where(.hljs-emphasis) {
126
+ font-style: italic;
127
+ color: #1f2328;
128
+ }
129
+ section pre :where(.hljs-strong) {
130
+ font-weight: bold;
131
+ color: #1f2328;
132
+ }
133
+ section pre :where(.hljs-addition) {
134
+ color: #116329;
135
+ background-color: #dafbe1;
136
+ }
137
+ section pre :where(.hljs-deletion) {
138
+ color: #82071e;
139
+ background-color: #ffebe9;
140
+ }
141
+ section {
142
+ width: 1920px;
143
+ height: 1080px;
144
+ padding: var(--slide-padding-y) var(--slide-padding-x);
145
+ background-color: var(--color-white);
146
+ color: var(--color-grey-darkest);
147
+ font-family: var(--font-family-base);
148
+ font-size: var(--font-size-base);
149
+ line-height: var(--line-height-normal);
150
+ display: flex;
151
+ flex-direction: column;
152
+ box-sizing: border-box;
153
+ overflow: hidden;
154
+ }
155
+ section p,
156
+ section ul,
157
+ section ol,
158
+ section blockquote,
159
+ section pre {
160
+ margin-top: 0;
161
+ }
162
+ section ul,
163
+ section ol {
164
+ padding-inline-start: 1.3em;
165
+ }
166
+ section::after {
167
+ position: absolute;
168
+ padding: 0;
169
+ right: var(--header-footer-margin-x);
170
+ bottom: var(--header-footer-margin-y);
171
+ font-size: var(--font-size-note);
172
+ color: var(--color-grey-medium);
173
+ }
174
+ section.title h1 {
175
+ font-size: var(--font-size-display);
176
+ flex: 0 0 80%;
177
+ display: flex;
178
+ flex-direction: column;
179
+ align-items: flex-start;
180
+ justify-content: center;
181
+ margin: 0;
182
+ }
183
+ section.title h1 small {
184
+ margin-top: 0.5em;
185
+ font-size: 0.5em;
186
+ }
187
+ section.title h1 + p {
188
+ flex: 1;
189
+ display: flex;
190
+ flex-direction: column;
191
+ align-items: flex-end;
192
+ justify-content: center;
193
+ text-align: right;
194
+ color: var(--color-grey-light);
195
+ margin: 0;
196
+ }
197
+ section.section p {
198
+ flex: 1;
199
+ display: flex;
200
+ align-items: center;
201
+ justify-content: flex-start;
202
+ font-size: var(--font-size-title);
203
+ font-weight: bold;
204
+ margin: 0;
205
+ }
206
+ section.toc > ul,
207
+ section.toc > ol {
208
+ font-size: var(--font-size-heading);
209
+ line-height: var(--line-height-loose);
210
+ }
211
+ section.agenda > ul,
212
+ section.agenda > ol {
213
+ font-size: var(--font-size-heading);
214
+ font-weight: var(--font-weight-bold);
215
+ line-height: var(--line-height-loose);
216
+ }
217
+ section.agenda > ul ul,
218
+ section.agenda > ul ol,
219
+ section.agenda > ol ul,
220
+ section.agenda > ol ol {
221
+ font-size: calc(var(--font-size-body) / var(--font-size-heading) * 1em);
222
+ font-weight: var(--font-weight-normal);
223
+ line-height: var(--line-height-normal);
224
+ }
225
+ section.agenda > ul ul ul,
226
+ section.agenda > ul ul ol,
227
+ section.agenda > ul ol ul,
228
+ section.agenda > ul ol ol,
229
+ section.agenda > ol ul ul,
230
+ section.agenda > ol ul ol,
231
+ section.agenda > ol ol ul,
232
+ section.agenda > ol ol ol {
233
+ font-size: 1em;
234
+ }
235
+ section.display {
236
+ justify-content: center;
237
+ align-items: center;
238
+ }
239
+ section.display p {
240
+ margin: 0;
241
+ text-align: center;
242
+ }
243
+ section.display:not(:has(img)) p {
244
+ font-size: var(--font-size-display);
245
+ font-weight: var(--font-weight-bold);
246
+ }
247
+ section.display img {
248
+ display: block;
249
+ margin: 0 0;
250
+ }
251
+ section.display:has(p) img {
252
+ margin: 0 0 1em;
253
+ }
254
+ section.columns {
255
+ flex-direction: row;
256
+ gap: 1em;
257
+ }
258
+ section.columns > .column {
259
+ flex: 1;
260
+ min-width: 0;
261
+ }
262
+ section.columns > .column > *,
263
+ section.columns > .column p > * {
264
+ max-width: 100%;
265
+ }
266
+ section.columns > .column-2 {
267
+ flex: 2;
268
+ min-width: 0;
269
+ }
270
+ section.columns > .column-2 > *,
271
+ section.columns > .column-2 p > * {
272
+ max-width: 100%;
273
+ }
274
+ section.columns > .column-3 {
275
+ flex: 3;
276
+ min-width: 0;
277
+ }
278
+ section.columns > .column-3 > *,
279
+ section.columns > .column-3 p > * {
280
+ max-width: 100%;
281
+ }
282
+ section.columns > .column-4 {
283
+ flex: 4;
284
+ min-width: 0;
285
+ }
286
+ section.columns > .column-4 > *,
287
+ section.columns > .column-4 p > * {
288
+ max-width: 100%;
289
+ }
290
+ section.columns > .column-6 {
291
+ flex: 6;
292
+ min-width: 0;
293
+ }
294
+ section.columns > .column-6 > *,
295
+ section.columns > .column-6 p > * {
296
+ max-width: 100%;
297
+ }
298
+ section.columns > .column-7 {
299
+ flex: 7;
300
+ min-width: 0;
301
+ }
302
+ section.columns > .column-7 > *,
303
+ section.columns > .column-7 p > * {
304
+ max-width: 100%;
305
+ }
306
+ section.columns > .column-8 {
307
+ flex: 8;
308
+ min-width: 0;
309
+ }
310
+ section.columns > .column-8 > *,
311
+ section.columns > .column-8 p > * {
312
+ max-width: 100%;
313
+ }
314
+ section .columns {
315
+ display: flex;
316
+ gap: 1em;
317
+ width: 100%;
318
+ }
319
+ section .columns > .column {
320
+ flex: 1;
321
+ min-width: 0;
322
+ }
323
+ section .columns > .column > *,
324
+ section .columns > .column p > * {
325
+ max-width: 100%;
326
+ }
327
+ section .columns > .column-2 {
328
+ flex: 2;
329
+ min-width: 0;
330
+ }
331
+ section .columns > .column-2 > *,
332
+ section .columns > .column-2 p > * {
333
+ max-width: 100%;
334
+ }
335
+ section .columns > .column-3 {
336
+ flex: 3;
337
+ min-width: 0;
338
+ }
339
+ section .columns > .column-3 > *,
340
+ section .columns > .column-3 p > * {
341
+ max-width: 100%;
342
+ }
343
+ section .columns > .column-4 {
344
+ flex: 4;
345
+ min-width: 0;
346
+ }
347
+ section .columns > .column-4 > *,
348
+ section .columns > .column-4 p > * {
349
+ max-width: 100%;
350
+ }
351
+ section .columns > .column-6 {
352
+ flex: 6;
353
+ min-width: 0;
354
+ }
355
+ section .columns > .column-6 > *,
356
+ section .columns > .column-6 p > * {
357
+ max-width: 100%;
358
+ }
359
+ section .columns > .column-7 {
360
+ flex: 7;
361
+ min-width: 0;
362
+ }
363
+ section .columns > .column-7 > *,
364
+ section .columns > .column-7 p > * {
365
+ max-width: 100%;
366
+ }
367
+ section .columns > .column-8 {
368
+ flex: 8;
369
+ min-width: 0;
370
+ }
371
+ section .columns > .column-8 > *,
372
+ section .columns > .column-8 p > * {
373
+ max-width: 100%;
374
+ }
375
+
376
+ header {
377
+ position: absolute;
378
+ top: var(--header-footer-margin-y);
379
+ left: var(--header-footer-margin-x);
380
+ font-size: var(--font-size-note);
381
+ color: var(--color-grey-medium);
382
+ }
383
+
384
+ footer {
385
+ position: absolute;
386
+ bottom: var(--header-footer-margin-y);
387
+ left: var(--header-footer-margin-x);
388
+ font-size: var(--font-size-note);
389
+ color: var(--color-grey-medium);
390
+ }
391
+
392
+ h1,
393
+ h2,
394
+ h3,
395
+ h4,
396
+ h5,
397
+ h6 {
398
+ line-height: var(--line-height-tight);
399
+ margin: 0 0 0.5em;
400
+ }
401
+
402
+ h1 {
403
+ font-size: var(--font-size-title);
404
+ font-weight: var(--font-weight-bold);
405
+ color: inherit;
406
+ }
407
+
408
+ h2 {
409
+ font-size: var(--font-size-heading);
410
+ font-weight: var(--font-weight-bold);
411
+ color: var(--color-primary);
412
+ margin: 0 0 0.8em;
413
+ }
414
+
415
+ h3 {
416
+ font-size: var(--font-size-medium);
417
+ font-weight: var(--font-weight-bold);
418
+ color: inherit;
419
+ }
420
+
421
+ h4 {
422
+ font-size: 1em;
423
+ font-weight: var(--font-weight-bold);
424
+ color: inherit;
425
+ }
426
+
427
+ h5 {
428
+ font-size: 1em;
429
+ font-weight: var(--font-weight-normal);
430
+ color: inherit;
431
+ }
432
+
433
+ h6 {
434
+ font-size: 1em;
435
+ font-weight: var(--font-weight-normal);
436
+ color: inherit;
437
+ }
438
+
439
+ blockquote {
440
+ position: relative;
441
+ margin-left: 0;
442
+ margin-right: 0;
443
+ padding: 0.5em 0.5em 0.5em 2em;
444
+ font-size: var(--font-size-body);
445
+ font-style: italic;
446
+ line-height: var(--line-height-tight);
447
+ color: var(--color-blockquote-text);
448
+ background: var(--color-blockquote-background);
449
+ border-radius: var(--border-radius);
450
+ }
451
+ blockquote::before {
452
+ content: "“";
453
+ position: absolute;
454
+ left: 0.2em;
455
+ font-size: 2em;
456
+ line-height: 1;
457
+ color: var(--color-blockquote-mark);
458
+ }
459
+ blockquote > :first-child {
460
+ margin-top: 0;
461
+ }
462
+ blockquote > :last-child {
463
+ margin-bottom: 0;
464
+ }
465
+
466
+ strong {
467
+ font-weight: var(--font-weight-bold);
468
+ }
469
+
470
+ mark {
471
+ font-weight: var(--font-weight-bold);
472
+ background-color: var(--color-accent);
473
+ }
474
+
475
+ rp {
476
+ font-weight: var(--font-weight-normal);
477
+ }
478
+
479
+ a {
480
+ color: var(--color-link);
481
+ text-decoration: underline;
482
+ }
483
+ a:hover {
484
+ text-decoration: none;
485
+ }
486
+
487
+ table {
488
+ border-spacing: 0;
489
+ border-collapse: collapse;
490
+ display: block;
491
+ width: max-content;
492
+ max-width: 100%;
493
+ overflow: auto;
494
+ }
495
+
496
+ th, td {
497
+ padding: 6px 13px;
498
+ border: 1px solid var(--color-table-border);
499
+ }
500
+
501
+ th {
502
+ font-weight: 600;
503
+ background-color: var(--color-table-row-bg-header);
504
+ }
505
+
506
+ tr {
507
+ background-color: var(--color-table-row-bg);
508
+ border-top: 1px solid var(--color-table-border);
509
+ }
510
+
511
+ tr:nth-child(2n) {
512
+ background-color: var(--color-table-row-bg);
513
+ }
514
+
515
+ code, tt {
516
+ font-family: var(--font-family-mono);
517
+ padding: 0.2em 0.4em;
518
+ font-size: 85%;
519
+ white-space: break-spaces;
520
+ background-color: var(--color-code-bg);
521
+ border-radius: 6px;
522
+ }
523
+
524
+ pre {
525
+ font-family: var(--font-family-mono);
526
+ padding: 16px;
527
+ overflow: auto;
528
+ font-size: 85%;
529
+ line-height: 1.45;
530
+ color: var(--color-code-fg);
531
+ background-color: var(--color-code-bg);
532
+ border-radius: 6px;
533
+ }
534
+
535
+ pre > code {
536
+ padding: 0;
537
+ background: transparent;
538
+ border: 0;
539
+ white-space: pre;
540
+ }
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@subroh0508/marp-theme-canvas",
3
+ "version": "0.0.1",
4
+ "description": "A simple Marp theme with minimal styling",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/subroh0508/marp-theme-canvas.git"
8
+ },
9
+ "homepage": "https://github.com/subroh0508/marp-theme-canvas#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/subroh0508/marp-theme-canvas/issues"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "sass": "scss/_index.scss",
17
+ "exports": {
18
+ ".": {
19
+ "sass": "./scss/_index.scss"
20
+ },
21
+ "./white-canvas": {
22
+ "sass": "./scss/white-canvas.scss",
23
+ "style": "./css/white-canvas.css"
24
+ },
25
+ "./black-canvas": {
26
+ "sass": "./scss/black-canvas.scss",
27
+ "style": "./css/black-canvas.css"
28
+ },
29
+ "./scss": {
30
+ "sass": "./scss/_index.scss"
31
+ },
32
+ "./scss/*": {
33
+ "sass": "./scss/*"
34
+ },
35
+ "./scss/component": {
36
+ "sass": "./scss/component/_index.scss"
37
+ },
38
+ "./scss/component/*": {
39
+ "sass": "./scss/component/*"
40
+ },
41
+ "./scss/page": {
42
+ "sass": "./scss/page/_index.scss"
43
+ },
44
+ "./scss/page/*": {
45
+ "sass": "./scss/page/*"
46
+ },
47
+ "./css/*": "./css/*"
48
+ },
49
+ "files": [
50
+ "css",
51
+ "scss",
52
+ "LICENSE"
53
+ ],
54
+ "keywords": [
55
+ "marp",
56
+ "marp-theme",
57
+ "slide",
58
+ "presentation"
59
+ ],
60
+ "author": {
61
+ "name": "Subroh Nishikori",
62
+ "email": "subroh.0508@gmail.com"
63
+ },
64
+ "license": "MIT",
65
+ "devDependencies": {
66
+ "@marp-team/marp-cli": "^4.2.3",
67
+ "sass": "^1.97.2"
68
+ },
69
+ "scripts": {
70
+ "serve": "marp --allow-local-files --html --theme-set css/*.css -s demo",
71
+ "build": "for f in scss/[!_]*.scss; do sass --no-source-map $f css/$(basename ${f%.scss}.css); done"
72
+ }
73
+ }
package/scss/CLAUDE.md ADDED
@@ -0,0 +1,59 @@
1
+ # scss
2
+
3
+ Marpテーマ用SCSSファイル
4
+
5
+ ## ディレクトリ構成
6
+
7
+ - `page/` - 特定用途に特化したページスタイル(title、section、toc、agenda、display)
8
+ - `component/` - スライド共通で使用する要素のスタイル(heading、table、code、blockquote等)
9
+
10
+ ## 共通命名規約
11
+
12
+ - ファイル名: `_名前.scss`(アンダースコアプレフィックス必須、Sassパーシャル)
13
+ - 名前: kebab-case(例: `title`, `text-decorator`)
14
+
15
+ ## @mixin configure() 規約
16
+
17
+ 全てのスタイルファイルは `@mixin configure()` でカプセル化する。
18
+
19
+ ### 引数の設計
20
+
21
+ - **必須引数**: デフォルト値なし、リストの先頭に配置
22
+ - **任意引数**: デフォルト値あり、リストの後方に配置
23
+ - **命名**: セマンティックな名前を使用
24
+
25
+ ### 引数の命名パターン
26
+
27
+ | 接頭辞 | 用途 | 例 |
28
+ |--------|------|-----|
29
+ | `$font-size-*` | フォントサイズ | `$font-size-title`, `$font-size-body` |
30
+ | `$font-weight-*` | フォントウェイト | `$font-weight-bold`, `$font-weight-normal` |
31
+ | `$font-family` | フォントファミリー | `$font-family`, `$font-mono` |
32
+ | `$color-*` | 色 | `$color-text`, `$color-bg`, `$color-border` |
33
+ | `$line-height-*` | 行間 | `$line-height-heading`, `$line-height-body` |
34
+ | `$margin-*` | マージン | `$margin-x`, `$margin-y` |
35
+ | `$padding-*` | パディング | `$padding-x`, `$padding-y` |
36
+ | `$border-radius` | 角丸 | `$border-radius` |
37
+
38
+ ## 実装上のルール
39
+
40
+ - **CSS変数の宣言・参照はテーマファイルのみ**: `var(--*)` の宣言および参照は `scss/` 直下に配置されたテーマファイル(例: `white-canvas.scss`)でのみ許可
41
+ - 理由: Marp用Markdownファイルのフロントマターでインラインスタイルとして変数を上書きし、スライドごとにスタイルを柔軟にカスタマイズできるようにするため
42
+ - 例: Markdownファイルで `--color-primary` を上書き
43
+ ```markdown
44
+ ---
45
+ theme: white-canvas
46
+ style: |
47
+ :root {
48
+ --color-primary: #3b91c4;
49
+ --color-accent: #ead7a4;
50
+ }
51
+ ---
52
+ ```
53
+ - **page/ component/ 配下では禁止**: サブディレクトリ内のスタイルファイルでは CSS変数を直接参照しない。必要な値は全て `@mixin configure()` の引数として受け取る
54
+ - 理由: テーマとスタイルの疎結合を保つため
55
+ - テーマ側で `@include` 時に CSS変数を引数として渡す
56
+
57
+ ## 注意事項
58
+
59
+ - コメントは `/*!` で始める(`/*` ではない)ことでCSSに出力される
@@ -0,0 +1,27 @@
1
+ @charset "utf-8";
2
+
3
+ /*!
4
+ * Marp Theme Canvas - 極力余計なスタイリングを廃した、シンプルなスライドテーマ
5
+ *
6
+ * Usage:
7
+ * // 全モジュールをインポート
8
+ * @use '@subroh0508/marp-theme-canvas/scss';
9
+ *
10
+ * // コンポーネントのみ
11
+ * @use '@subroh0508/marp-theme-canvas/scss/component';
12
+ *
13
+ * // 特定のコンポーネント
14
+ * @use '@subroh0508/marp-theme-canvas/scss/component/heading';
15
+ *
16
+ * // ページスタイルのみ
17
+ * @use '@subroh0508/marp-theme-canvas/scss/page';
18
+ *
19
+ * // 特定のページスタイル
20
+ * @use '@subroh0508/marp-theme-canvas/scss/page/title';
21
+ */
22
+
23
+ // コンポーネント
24
+ @forward 'component' as component-*;
25
+
26
+ // ページスタイル
27
+ @forward 'page' as page-*;