@cosense-toolbox/style 0.1.0-beta.5 → 0.1.0-beta.7
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.
- package/README.md +7 -5
- package/package.json +1 -1
- package/style.css +44 -0
package/README.md
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
> **beta.** class 名はまだ変わりえます。安定するまではバージョン固定での利用を推奨します。
|
|
4
4
|
|
|
5
|
-
[`@cosense-toolbox/parser`](../parser) の `toHtml`
|
|
6
|
-
CSS 1
|
|
5
|
+
[`@cosense-toolbox/parser`](../parser) の `toHtml` が出力する HTML に適用する、既定のスタイルシートです。
|
|
6
|
+
CSS ファイル1枚だけで構成されているため、独自の見た目を使う場合はインストールする必要はありません。
|
|
7
|
+
|
|
8
|
+
**ドキュメント → <https://cosense-toolbox.qaynam.dev/style/>**
|
|
7
9
|
|
|
8
10
|
```sh
|
|
9
11
|
npm i @cosense-toolbox/style
|
|
@@ -17,8 +19,8 @@ import "@cosense-toolbox/style"
|
|
|
17
19
|
> (`.line > .text > 1 文字ごとの .char-index`) に当てたもので `toHtml` の出力には当たらないため、
|
|
18
20
|
> 見た目を寄せた別実装として書き起こしたものです。
|
|
19
21
|
|
|
20
|
-
Tailwind CSS
|
|
21
|
-
`class="cosense"`
|
|
22
|
+
Tailwind CSS を使う場合は、この CSS の代わりに [`@cosense-toolbox/tailwind`](../tailwind) を利用できます。
|
|
23
|
+
`class="cosense"` を付けた要素の中に同じスタイルが適用されます。
|
|
22
24
|
|
|
23
25
|
## 前提
|
|
24
26
|
|
|
@@ -75,7 +77,7 @@ CSS 変数を定義するだけでよい。定義した変数が最優先にな
|
|
|
75
77
|
Cosense と同じく、字下げの右端に中点を出す。`toHtml` の既定の出力には中点にあたる要素が
|
|
76
78
|
無いので `.line[data-indent]::before` で描いている。
|
|
77
79
|
|
|
78
|
-
`toHtml(page, { showPads: true })` でCosense Web と同じ `.indent-mark` / `.pad` / `.dot` を
|
|
80
|
+
`toHtml(page, { showPads: true })` で Cosense Web と同じ `.indent-mark` / `.pad` / `.dot` を
|
|
79
81
|
書き出した場合は、擬似要素を止めて要素側のスタイルを使う。どちらでも見た目は同じ。
|
|
80
82
|
|
|
81
83
|
## コードブロックの行番号
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -331,6 +331,50 @@
|
|
|
331
331
|
max-height: none;
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
+
/* 動画は画像と同じ大きさの決まりで置く。 */
|
|
335
|
+
.page .video {
|
|
336
|
+
display: inline-block;
|
|
337
|
+
max-width: 100%;
|
|
338
|
+
max-height: 300px;
|
|
339
|
+
vertical-align: bottom;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.page .video[data-large] {
|
|
343
|
+
margin: 3px 0;
|
|
344
|
+
max-width: 95%;
|
|
345
|
+
max-height: none;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* 音声は再生の操作とラベルを 1 行に並べる。 */
|
|
349
|
+
.page .audio {
|
|
350
|
+
display: inline-flex;
|
|
351
|
+
align-items: center;
|
|
352
|
+
gap: 0.5em;
|
|
353
|
+
max-width: 100%;
|
|
354
|
+
vertical-align: middle;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.page .audio audio {
|
|
358
|
+
max-width: 100%;
|
|
359
|
+
height: 2.5em;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/* 埋め込みのプレーヤーは 16:9。音声だけのサービスは高さを決めて横に伸ばす。 */
|
|
363
|
+
.page .embed {
|
|
364
|
+
display: block;
|
|
365
|
+
width: 100%;
|
|
366
|
+
max-width: 560px;
|
|
367
|
+
aspect-ratio: 16 / 9;
|
|
368
|
+
margin: 3px 0;
|
|
369
|
+
border: 0;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.page .embed[data-provider="spotify"],
|
|
373
|
+
.page .embed[data-provider="anchor"] {
|
|
374
|
+
aspect-ratio: auto;
|
|
375
|
+
height: 152px;
|
|
376
|
+
}
|
|
377
|
+
|
|
334
378
|
/*
|
|
335
379
|
* アイコンは a.icon > img.icon の入れ子。iconImageUrl を渡していないときは img が無く、
|
|
336
380
|
* ユーザー名のテキストリンクとして出る (色は .link から継承する)。
|