@cosense-toolbox/style 0.1.0-beta.0
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/LICENSE +21 -0
- package/README.md +93 -0
- package/package.json +26 -0
- package/style.css +326 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 qaynam
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @cosense-toolbox/style
|
|
2
|
+
|
|
3
|
+
> **beta.** class 名はまだ変わりえます。安定するまではバージョン固定での利用を推奨します。
|
|
4
|
+
|
|
5
|
+
[`@cosense-toolbox/parser`](../parser) の `toHtml` が出す HTML に当てる既定のスタイルシート。
|
|
6
|
+
CSS 1 枚だけのパッケージなので、スタイルが要らないなら入れなくてよい。
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm i @cosense-toolbox/style@beta
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import '@cosense-toolbox/style'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
> ⚠️ これは Cosense (Scrapbox) 本体の CSS **ではありません**。本体の CSS はエディタの DOM
|
|
17
|
+
> (`.line > .text > 1 文字ごとの .char-index`) に当てたもので `toHtml` の出力には当たらないため、
|
|
18
|
+
> 見た目を寄せた別実装として書き起こしたものです。
|
|
19
|
+
|
|
20
|
+
## 前提
|
|
21
|
+
|
|
22
|
+
すべてのルールが `.page` の下にスコープされている。`toHtml(page)` の出力はルートに `.page` を持つので
|
|
23
|
+
そのまま当たるが、`parseLine` の 1 行だけを描画する場合は自分で `.page` で包む。
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<div class="page">{toHtml(parseLine('[* 太字]'))}</div>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 色を変える
|
|
30
|
+
|
|
31
|
+
CSS 変数を定義するだけでよい。定義した変数が最優先になる。
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
:root {
|
|
35
|
+
--cosense-link: #f8e42e;
|
|
36
|
+
--cosense-code-bg: #1b1b1b;
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
| 変数 | 既定 | 本体テーマの変数 |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| `--cosense-text` | `#4a4a4a` | `--page-text-color` |
|
|
43
|
+
| `--cosense-title` | 本文と同じ | `--line-title-color` |
|
|
44
|
+
| `--cosense-bg` | `#fefefe` | `--page-bg` |
|
|
45
|
+
| `--cosense-link` | `#3d72f5` | `--page-link-color` |
|
|
46
|
+
| `--cosense-link-hover` | `#0d4ff3` | `--page-link-hover-color` |
|
|
47
|
+
| `--cosense-code-text` | `#342d9c` | `--code-color` |
|
|
48
|
+
| `--cosense-code-bg` | `rgba(0,0,0,.04)` | `--code-bg` |
|
|
49
|
+
| `--cosense-quote-bg` | `rgba(0,0,0,.05)` | `--quote-bg-color` |
|
|
50
|
+
| `--cosense-badge-text` / `--cosense-badge-bg` | `#342d9c` / `#ffcfc6` | — |
|
|
51
|
+
| `--cosense-font` | `"Open Sans", Helvetica, Arial, "Hiragino Sans", sans-serif` | — |
|
|
52
|
+
| `--cosense-font-size` | `15px` | — |
|
|
53
|
+
| `--cosense-line-height` | `1.87` | — |
|
|
54
|
+
| `--cosense-code-font` | `ui-monospace, …` | — |
|
|
55
|
+
| `--cosense-indent` | `1.5em` | — |
|
|
56
|
+
|
|
57
|
+
「本体テーマの変数」の列は fallback として参照している。Cosense のテーマ変数を持つページに
|
|
58
|
+
埋め込めば、`--cosense-*` を書かなくても見た目が揃う。
|
|
59
|
+
|
|
60
|
+
`.page` は font-family / font-size / line-height を明示している。これを外すと
|
|
61
|
+
埋め込み先のページからフォントが降ってきて表示が崩れるため。
|
|
62
|
+
既定値は本体のページ本文と同じ **15px / 28px**(body の 14px ではなくエディタ側の値)で、
|
|
63
|
+
見出しやコードなど em で書いた寸法はすべてこの基準に乗る。
|
|
64
|
+
`--cosense-font-size` を変えれば全体が拡縮する。
|
|
65
|
+
|
|
66
|
+
アイコンは `a.icon > img.icon` の入れ子。`toHtml` に `iconImageUrl` を渡していないときは
|
|
67
|
+
`<img>` が無く、ユーザー名のテキストリンクとして出る。
|
|
68
|
+
|
|
69
|
+
## インデントの中点
|
|
70
|
+
|
|
71
|
+
Cosense と同じく、字下げの右端に中点を出す。`toHtml` の既定の出力には中点にあたる要素が
|
|
72
|
+
無いので `.line[data-indent]::before` で描いている。
|
|
73
|
+
|
|
74
|
+
`toHtml(page, { showPads: true })` で本家と同じ `.indent-mark` / `.pad` / `.dot` を
|
|
75
|
+
書き出した場合は、擬似要素を止めて要素側のスタイルを使う。どちらでも見た目は同じ。
|
|
76
|
+
|
|
77
|
+
## 名前の衝突を避ける
|
|
78
|
+
|
|
79
|
+
`toHtml` の既定の class 名は接頭辞を持たない (`.line` / `.title` / `.code` / `.table`)。
|
|
80
|
+
この CSS は全ルールを `.page` の下にスコープしてあるので外には漏れないが、
|
|
81
|
+
**ページ側にも `.page` がある場合は競合する**。気になる環境では次のどれかを使う。
|
|
82
|
+
|
|
83
|
+
- 出力を iframe か Shadow DOM に入れて完全に切り離す
|
|
84
|
+
- `toHtml(page, { classNames })` で名前を差し替え、CSS も自分で書く
|
|
85
|
+
- この CSS をカスケードレイヤーに入れて、ページ側の CSS を常に優先させる
|
|
86
|
+
|
|
87
|
+
```css
|
|
88
|
+
@import '@cosense-toolbox/style' layer(cosense);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## ライセンス
|
|
92
|
+
|
|
93
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cosense-toolbox/style",
|
|
3
|
+
"version": "0.1.0-beta.0",
|
|
4
|
+
"description": "Default stylesheet for the HTML that @cosense-toolbox/parser renders.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": ["**/*.css"],
|
|
8
|
+
"style": "./style.css",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./style.css",
|
|
11
|
+
"./style.css": "./style.css",
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": ["style.css", "README.md", "LICENSE"],
|
|
15
|
+
"keywords": ["cosense", "scrapbox", "css", "stylesheet"],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/qaynam/cosense-toolbox.git",
|
|
19
|
+
"directory": "packages/style"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public",
|
|
23
|
+
"tag": "beta",
|
|
24
|
+
"registry": "https://registry.npmjs.org/"
|
|
25
|
+
}
|
|
26
|
+
}
|
package/style.css
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @cosense-toolbox/style — @cosense-toolbox/parser の toHtml 出力に当てる既定のスタイル。
|
|
3
|
+
*
|
|
4
|
+
* Cosense 本体の CSS ではない。本体の CSS はエディタの DOM (.line > .text > 1 文字ごとの
|
|
5
|
+
* .char-index) に当てたもので、toHtml が出す構造には当たらないため、
|
|
6
|
+
* 見た目を寄せた別実装として書き起こしている。寸法と色は本体の既定値に合わせてある。
|
|
7
|
+
*
|
|
8
|
+
* 色と寸法は 3 段の fallback で解決する:
|
|
9
|
+
*
|
|
10
|
+
* var(--cosense-link, var(--page-link-color, #3d72f5))
|
|
11
|
+
* ↑利用者の指定 ↑Cosense のテーマ変数 ↑何も無いときの既定
|
|
12
|
+
*
|
|
13
|
+
* 変数を自前でルート要素に定義していないのは、そうすると継承で降ってくる
|
|
14
|
+
* 利用者の指定を打ち消してしまうため。
|
|
15
|
+
*
|
|
16
|
+
* すべてのルールが .page の下にスコープされている。toHtml の既定の class 名は
|
|
17
|
+
* 接頭辞を持たず (.line / .title / .code / .table)、そのまま書くと同名の class を
|
|
18
|
+
* 持つページ側の要素まで巻き込むため。
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/* ---------------------------------------------------------------------------
|
|
22
|
+
* ルート
|
|
23
|
+
* ------------------------------------------------------------------------- */
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* 本体のページ本文は 15px / 28px (body の 14px ではなくエディタ側の値)。
|
|
27
|
+
* em で書いた各所の寸法はこの基準に乗るので、ここを変えると全体が拡縮する。
|
|
28
|
+
* line-height は本体の 28px を比に直したもの (28 / 15)。
|
|
29
|
+
*/
|
|
30
|
+
.page {
|
|
31
|
+
/* 周りのページからフォントが降ってこないよう、ここで断ち切る。 */
|
|
32
|
+
font-family: var(--cosense-font, "Open Sans", Helvetica, Arial, "Hiragino Sans", sans-serif);
|
|
33
|
+
font-size: var(--cosense-font-size, 15px);
|
|
34
|
+
line-height: var(--cosense-line-height, 1.87);
|
|
35
|
+
color: var(--cosense-text, var(--page-text-color, #4a4a4a));
|
|
36
|
+
background: var(--cosense-bg, var(--page-bg, #fefefe));
|
|
37
|
+
text-align: left;
|
|
38
|
+
word-wrap: break-word;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* 本体のタイトルは 25.95px / 42px。基準の 15px に対して 1.73 倍。 */
|
|
42
|
+
.page .title {
|
|
43
|
+
margin: 0 0 0.77em;
|
|
44
|
+
font-size: 1.73em;
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
line-height: 1.62;
|
|
47
|
+
color: var(--cosense-title, var(--line-title-color, var(--page-text-color, #4a4a4a)));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.page .line {
|
|
51
|
+
position: relative;
|
|
52
|
+
min-height: 1em;
|
|
53
|
+
/* 記法の記号が合字にならないように (本体と同じ)。 */
|
|
54
|
+
font-variant-ligatures: no-common-ligatures;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ---------------------------------------------------------------------------
|
|
58
|
+
* インデントと中点
|
|
59
|
+
* ------------------------------------------------------------------------- */
|
|
60
|
+
|
|
61
|
+
/*
|
|
62
|
+
* インデントの深さ。data-indent の数値を calc に持ち込む手段 (attr() の type 指定) が
|
|
63
|
+
* まだ広く使えないので、段数ごとに変数を置いて以降の計算で使い回す。
|
|
64
|
+
* 11 段以上はインデントも中点も付かない。
|
|
65
|
+
*/
|
|
66
|
+
.page .line[data-indent="1"] {
|
|
67
|
+
--cosense-depth: 1;
|
|
68
|
+
}
|
|
69
|
+
.page .line[data-indent="2"] {
|
|
70
|
+
--cosense-depth: 2;
|
|
71
|
+
}
|
|
72
|
+
.page .line[data-indent="3"] {
|
|
73
|
+
--cosense-depth: 3;
|
|
74
|
+
}
|
|
75
|
+
.page .line[data-indent="4"] {
|
|
76
|
+
--cosense-depth: 4;
|
|
77
|
+
}
|
|
78
|
+
.page .line[data-indent="5"] {
|
|
79
|
+
--cosense-depth: 5;
|
|
80
|
+
}
|
|
81
|
+
.page .line[data-indent="6"] {
|
|
82
|
+
--cosense-depth: 6;
|
|
83
|
+
}
|
|
84
|
+
.page .line[data-indent="7"] {
|
|
85
|
+
--cosense-depth: 7;
|
|
86
|
+
}
|
|
87
|
+
.page .line[data-indent="8"] {
|
|
88
|
+
--cosense-depth: 8;
|
|
89
|
+
}
|
|
90
|
+
.page .line[data-indent="9"] {
|
|
91
|
+
--cosense-depth: 9;
|
|
92
|
+
}
|
|
93
|
+
.page .line[data-indent="10"] {
|
|
94
|
+
--cosense-depth: 10;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.page .line[data-indent] {
|
|
98
|
+
padding-left: calc(var(--cosense-indent, 1.5em) * var(--cosense-depth, 0));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/*
|
|
102
|
+
* 本体と同じく、字下げの右端に中点を置く。
|
|
103
|
+
* toHtml の既定の出力には中点にあたる要素が無いので擬似要素で描く。
|
|
104
|
+
* showPads で .dot を出した場合は要素側に任せ、二重に描かないようにする。
|
|
105
|
+
*/
|
|
106
|
+
.page .line[data-indent]::before {
|
|
107
|
+
content: "";
|
|
108
|
+
position: absolute;
|
|
109
|
+
top: 0.7em;
|
|
110
|
+
left: calc(var(--cosense-indent, 1.5em) * var(--cosense-depth, 0) - 1.05em);
|
|
111
|
+
width: 6px;
|
|
112
|
+
height: 6px;
|
|
113
|
+
border-radius: 50%;
|
|
114
|
+
background: var(--cosense-text, var(--page-text-color, #555));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.page .line:has(> .indent-mark)::before {
|
|
118
|
+
content: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* showPads: true のときだけ出る要素。余白の数がそのまま深さを表す。 */
|
|
122
|
+
.page .indent-mark {
|
|
123
|
+
position: absolute;
|
|
124
|
+
left: 0;
|
|
125
|
+
top: 0;
|
|
126
|
+
height: 1em;
|
|
127
|
+
color: transparent;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.page .pad {
|
|
131
|
+
display: inline-block;
|
|
132
|
+
width: var(--cosense-indent, 1.5em);
|
|
133
|
+
height: 1em;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.page .dot {
|
|
138
|
+
position: absolute;
|
|
139
|
+
right: 0.65em;
|
|
140
|
+
top: 0.7em;
|
|
141
|
+
width: 6px;
|
|
142
|
+
height: 6px;
|
|
143
|
+
border-radius: 50%;
|
|
144
|
+
background: var(--cosense-text, var(--page-text-color, #555));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* ---------------------------------------------------------------------------
|
|
148
|
+
* リンク
|
|
149
|
+
* ------------------------------------------------------------------------- */
|
|
150
|
+
|
|
151
|
+
.page .link,
|
|
152
|
+
.page .hashtag {
|
|
153
|
+
color: var(--cosense-link, var(--page-link-color, #3d72f5));
|
|
154
|
+
text-decoration: none;
|
|
155
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0.2);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.page .link:hover,
|
|
159
|
+
.page .hashtag:hover {
|
|
160
|
+
color: var(--cosense-link-hover, var(--page-link-hover-color, #0d4ff3));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* ---------------------------------------------------------------------------
|
|
164
|
+
* コード
|
|
165
|
+
* ------------------------------------------------------------------------- */
|
|
166
|
+
|
|
167
|
+
.page .code,
|
|
168
|
+
.page .code-start,
|
|
169
|
+
.page .code-body,
|
|
170
|
+
.page .monospace {
|
|
171
|
+
font-family: var(--cosense-code-font, ui-monospace, SFMono-Regular, Menlo, monospace);
|
|
172
|
+
color: var(--cosense-code-text, var(--code-color, #342d9c));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.page .code,
|
|
176
|
+
.page .monospace {
|
|
177
|
+
padding: 0 0.2em;
|
|
178
|
+
border-radius: 4px;
|
|
179
|
+
font-size: 90%;
|
|
180
|
+
word-wrap: break-word;
|
|
181
|
+
background: var(--cosense-code-bg, var(--code-bg, rgba(0, 0, 0, 0.04)));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/*
|
|
185
|
+
* コードブロックは 1 行 = 1 要素なので、背景も行ごとに塗って隣り合う行でひと続きに見せる。
|
|
186
|
+
* 塗るのは行ではなく中の <code>。行の padding より内側から始めることで、
|
|
187
|
+
* ブロック全体がインデントの位置に揃う。
|
|
188
|
+
*/
|
|
189
|
+
.page .line.code-block > code {
|
|
190
|
+
display: block;
|
|
191
|
+
line-height: 1.7em;
|
|
192
|
+
tab-size: 4;
|
|
193
|
+
background: var(--cosense-code-bg, var(--code-bg, rgba(0, 0, 0, 0.04)));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/*
|
|
197
|
+
* 本体行はヘッダより 1 段深いが、ブロックの左端はヘッダに揃える (本家と同じ)。
|
|
198
|
+
* 1 段ぶん左に出してから同じだけ padding で戻すことで、文字の位置は保ったまま背景だけ広げる。
|
|
199
|
+
*/
|
|
200
|
+
.page .line.code-block > .code-body {
|
|
201
|
+
margin-left: calc(var(--cosense-indent, 1.5em) * -1);
|
|
202
|
+
padding-left: var(--cosense-indent, 1.5em);
|
|
203
|
+
/* 値に残っている深い字下げを保ちつつ、長い行は折り返す。 */
|
|
204
|
+
white-space: pre-wrap;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* ファイル名は本家と同じ見出しバッジ。 */
|
|
208
|
+
.page .code-block-start {
|
|
209
|
+
padding: 1px 2px;
|
|
210
|
+
font-size: 0.95em;
|
|
211
|
+
color: var(--cosense-badge-text, #342d9c);
|
|
212
|
+
background: var(--cosense-badge-bg, #ffcfc6);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* 中点が付くのはヘッダ行だけ (本家では本体行に dot が無い)。 */
|
|
216
|
+
.page .line.code-block:not(:has(> .code-start))::before {
|
|
217
|
+
content: none;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* ---------------------------------------------------------------------------
|
|
221
|
+
* 引用
|
|
222
|
+
* ------------------------------------------------------------------------- */
|
|
223
|
+
|
|
224
|
+
.page .quote {
|
|
225
|
+
display: block;
|
|
226
|
+
margin: 0;
|
|
227
|
+
padding-left: 3px;
|
|
228
|
+
border-left: solid 1px #a0a0a0;
|
|
229
|
+
background: var(--cosense-quote-bg, var(--quote-bg-color, rgba(0, 0, 0, 0.05)));
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* ---------------------------------------------------------------------------
|
|
233
|
+
* テーブル
|
|
234
|
+
* ------------------------------------------------------------------------- */
|
|
235
|
+
|
|
236
|
+
.page .table {
|
|
237
|
+
margin: 0;
|
|
238
|
+
border-collapse: collapse;
|
|
239
|
+
caption-side: top;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* 表の名前もコードブロックのファイル名と同じ見出しバッジ。 */
|
|
243
|
+
.page .table caption {
|
|
244
|
+
padding: 1px 2px;
|
|
245
|
+
text-align: center;
|
|
246
|
+
font-size: 0.9em;
|
|
247
|
+
color: var(--cosense-badge-text, #342d9c);
|
|
248
|
+
background: var(--cosense-badge-bg, #ffcfc6);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.page .table td {
|
|
252
|
+
padding: 0 2px 0 8px;
|
|
253
|
+
white-space: nowrap;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/* 本体は罫線ではなく列ごとの塗り分けでセルを区切る。 */
|
|
257
|
+
.page .table td:nth-child(odd) {
|
|
258
|
+
background: rgba(0, 0, 0, 0.04);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.page .table td:nth-child(even) {
|
|
262
|
+
background: rgba(0, 0, 0, 0.06);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* ---------------------------------------------------------------------------
|
|
266
|
+
* 画像・アイコン・数式
|
|
267
|
+
* ------------------------------------------------------------------------- */
|
|
268
|
+
|
|
269
|
+
.page .image {
|
|
270
|
+
display: inline-block;
|
|
271
|
+
max-width: 100%;
|
|
272
|
+
max-height: 300px;
|
|
273
|
+
vertical-align: bottom;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.page .image[data-large] {
|
|
277
|
+
margin: 3px 0;
|
|
278
|
+
max-width: 95%;
|
|
279
|
+
max-height: none;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/*
|
|
283
|
+
* アイコンは a.icon > img.icon の入れ子。iconImageUrl を渡していないときは img が無く、
|
|
284
|
+
* ユーザー名のテキストリンクとして出る (色は .link から継承する)。
|
|
285
|
+
*/
|
|
286
|
+
.page img.icon {
|
|
287
|
+
display: inline-block;
|
|
288
|
+
position: relative;
|
|
289
|
+
top: -0.3em;
|
|
290
|
+
height: 1.3em;
|
|
291
|
+
max-width: 100%;
|
|
292
|
+
vertical-align: baseline;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.page .formula {
|
|
296
|
+
margin: auto 6px;
|
|
297
|
+
font-family: var(--cosense-code-font, ui-monospace, SFMono-Regular, Menlo, monospace);
|
|
298
|
+
font-style: italic;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/* ---------------------------------------------------------------------------
|
|
302
|
+
* 装飾
|
|
303
|
+
* ------------------------------------------------------------------------- */
|
|
304
|
+
|
|
305
|
+
/*
|
|
306
|
+
* 見出しの倍率は本体と同じ 1.2 の等比。data-size-level は星の数 - 1 なので、
|
|
307
|
+
* 星 1 つ (level 0) は太字のみでサイズを変えない。
|
|
308
|
+
*/
|
|
309
|
+
.page .decoration[data-size-level="1"] {
|
|
310
|
+
font-size: 1.2em;
|
|
311
|
+
}
|
|
312
|
+
.page .decoration[data-size-level="2"] {
|
|
313
|
+
font-size: 1.44em;
|
|
314
|
+
}
|
|
315
|
+
.page .decoration[data-size-level="3"] {
|
|
316
|
+
font-size: 1.73em;
|
|
317
|
+
}
|
|
318
|
+
.page .decoration[data-size-level="4"] {
|
|
319
|
+
font-size: 2.07em;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* 本体は見出しごとに行間を固定していて、比に直すとどの段階もおよそ 1.6 になる。 */
|
|
323
|
+
.page .decoration[data-size-level] {
|
|
324
|
+
display: inline-block;
|
|
325
|
+
line-height: 1.6;
|
|
326
|
+
}
|