@riebeckite/plugin-sidenotes 0.0.5 → 0.0.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 +5 -1
- package/README_ja.md +5 -1
- package/package.json +2 -2
- package/style.css +127 -127
package/README.md
CHANGED
|
@@ -117,4 +117,8 @@ Stable hooks follow the `rr-sidenotes` convention: `rr-sidenotes__toggle`,
|
|
|
117
117
|
- The footnote definitions section is hidden on desktop; margins must have
|
|
118
118
|
room for the notes, and themes can restyle `.rr-sidenotes__note` freely.
|
|
119
119
|
- Notes inside tables or deeply nested inline markup are placed after the
|
|
120
|
-
nearest block ancestor, so their vertical position is approximate.
|
|
120
|
+
nearest block ancestor, so their vertical position is approximate.
|
|
121
|
+
|
|
122
|
+
## See also
|
|
123
|
+
|
|
124
|
+
- [Plugin guide](../../../docs/en/plugin-system.md)
|
package/README_ja.md
CHANGED
|
@@ -121,4 +121,8 @@ import "@riebeckite/plugin-sidenotes/style.css";
|
|
|
121
121
|
- デスクトップでは脚注定義セクションを非表示にします。ノートを置くための
|
|
122
122
|
余白が必要です。テーマは `.rr-sidenotes__note` を自由に再スタイルできます。
|
|
123
123
|
- テーブル内や深く入れ子になったインライン要素の中の注は、最も近いブロック
|
|
124
|
-
要素の後ろに置かれるため、縦位置はおおよその位置になります。
|
|
124
|
+
要素の後ろに置かれるため、縦位置はおおよその位置になります。
|
|
125
|
+
|
|
126
|
+
## ????
|
|
127
|
+
|
|
128
|
+
- [?????????](../../../docs/ja/plugin-system.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/plugin-sidenotes",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"./style.css": "./style.css"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@riebeckite/core": "0.0.
|
|
24
|
+
"@riebeckite/core": "0.0.7"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
package/style.css
CHANGED
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @riebeckite/plugin-sidenotes
|
|
3
|
-
*
|
|
4
|
-
* Tufte-style side notes. The same `.rr-sidenotes__note` element is a static
|
|
5
|
-
* margin note on desktop (>= 48rem) and the popover source on mobile
|
|
6
|
-
* (< 48rem). Plugin CSS intentionally loads before theme CSS, so a theme can
|
|
7
|
-
* restyle these hooks without editing the plugin.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
.rr-sidenotes__toggle {
|
|
11
|
-
color: var(--rb-color-accent, #3f5f87);
|
|
12
|
-
font-size: 0.75em;
|
|
13
|
-
line-height: 1.2;
|
|
14
|
-
text-decoration: underline;
|
|
15
|
-
text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
|
|
16
|
-
text-underline-offset: 0.2em;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.rr-sidenotes__toggle:focus-visible {
|
|
20
|
-
outline: 2px solid var(--rb-color-accent, #3f5f87);
|
|
21
|
-
outline-offset: 2px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.rr-sidenotes__note {
|
|
25
|
-
--rr-sidenotes-ink: var(--rb-color-ink, #202020);
|
|
26
|
-
--rr-sidenotes-muted: var(--rb-color-muted, #6b6b6b);
|
|
27
|
-
--rr-sidenotes-rule: color-mix(
|
|
28
|
-
in srgb,
|
|
29
|
-
var(--rr-sidenotes-ink) 18%,
|
|
30
|
-
transparent
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
color: var(--rr-sidenotes-ink);
|
|
34
|
-
font-size: 0.8125rem;
|
|
35
|
-
line-height: 1.55;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.rr-sidenotes__index {
|
|
39
|
-
display: inline-block;
|
|
40
|
-
margin-right: 0.4em;
|
|
41
|
-
color: var(--rr-sidenotes-muted);
|
|
42
|
-
font-size: 0.75em;
|
|
43
|
-
font-weight: 600;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.rr-sidenotes__body p {
|
|
47
|
-
margin: 0 0 0.5em;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.rr-sidenotes__body p:last-child {
|
|
51
|
-
margin-bottom: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.rr-sidenotes__footnotes {
|
|
55
|
-
font-size: 0.875rem;
|
|
56
|
-
color: var(--rr-sidenotes-ink);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Mobile: notes are hidden and become tap-open popovers. */
|
|
60
|
-
@media (max-width: 48rem) {
|
|
61
|
-
.rr-sidenotes__note {
|
|
62
|
-
position: fixed;
|
|
63
|
-
z-index: 60;
|
|
64
|
-
bottom: var(--rb-space-2, 1rem);
|
|
65
|
-
left: var(--rb-space-2, 1rem);
|
|
66
|
-
right: var(--rb-space-2, 1rem);
|
|
67
|
-
display: none;
|
|
68
|
-
max-height: min(60vh, 24rem);
|
|
69
|
-
overflow: auto;
|
|
70
|
-
padding: var(--rb-space-3, 1.5rem);
|
|
71
|
-
background: var(--rb-color-surface, #ffffff);
|
|
72
|
-
border: var(--rb-rule-width, 1px) solid var(--rr-sidenotes-rule);
|
|
73
|
-
box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.18);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/* Right-edge panel variant driven by `popoverAlignment: "end"`. */
|
|
77
|
-
.rr-sidenotes__note--popover-end {
|
|
78
|
-
top: 50%;
|
|
79
|
-
bottom: auto;
|
|
80
|
-
left: auto;
|
|
81
|
-
width: min(20rem, calc(100vw - 2 * var(--rb-space-2, 1rem)));
|
|
82
|
-
transform: translateY(-50%);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.rr-sidenotes__note--open {
|
|
86
|
-
display: block;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/* Desktop: static margin notes beside their paragraph anchor. */
|
|
91
|
-
@media (min-width: 48rem) {
|
|
92
|
-
:is(
|
|
93
|
-
p,
|
|
94
|
-
li,
|
|
95
|
-
dd,
|
|
96
|
-
dt,
|
|
97
|
-
td,
|
|
98
|
-
th,
|
|
99
|
-
figcaption,
|
|
100
|
-
h1,
|
|
101
|
-
h2,
|
|
102
|
-
h3,
|
|
103
|
-
h4,
|
|
104
|
-
h5,
|
|
105
|
-
h6,
|
|
106
|
-
blockquote
|
|
107
|
-
):has(.rr-sidenotes__ref) {
|
|
108
|
-
position: relative;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.rr-sidenotes__note {
|
|
112
|
-
position: absolute;
|
|
113
|
-
top: 0;
|
|
114
|
-
left: 100%;
|
|
115
|
-
width: var(--rr-sidenotes-width, 16rem);
|
|
116
|
-
max-width: calc(100vw - 100% - 1rem);
|
|
117
|
-
margin-left: var(--rb-space-3, 1.5rem);
|
|
118
|
-
padding-left: var(--rb-space-2, 1rem);
|
|
119
|
-
border-left: calc(var(--rb-rule-width, 1px) * 2) solid
|
|
120
|
-
var(--rr-sidenotes-rule);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/* Margin notes are always visible, so the trailing definitions are hidden. */
|
|
124
|
-
.rr-sidenotes__footnotes {
|
|
125
|
-
display: none;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @riebeckite/plugin-sidenotes
|
|
3
|
+
*
|
|
4
|
+
* Tufte-style side notes. The same `.rr-sidenotes__note` element is a static
|
|
5
|
+
* margin note on desktop (>= 48rem) and the popover source on mobile
|
|
6
|
+
* (< 48rem). Plugin CSS intentionally loads before theme CSS, so a theme can
|
|
7
|
+
* restyle these hooks without editing the plugin.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
.rr-sidenotes__toggle {
|
|
11
|
+
color: var(--rb-color-accent, #3f5f87);
|
|
12
|
+
font-size: 0.75em;
|
|
13
|
+
line-height: 1.2;
|
|
14
|
+
text-decoration: underline;
|
|
15
|
+
text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
|
|
16
|
+
text-underline-offset: 0.2em;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.rr-sidenotes__toggle:focus-visible {
|
|
20
|
+
outline: 2px solid var(--rb-color-accent, #3f5f87);
|
|
21
|
+
outline-offset: 2px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.rr-sidenotes__note {
|
|
25
|
+
--rr-sidenotes-ink: var(--rb-color-ink, #202020);
|
|
26
|
+
--rr-sidenotes-muted: var(--rb-color-muted, #6b6b6b);
|
|
27
|
+
--rr-sidenotes-rule: color-mix(
|
|
28
|
+
in srgb,
|
|
29
|
+
var(--rr-sidenotes-ink) 18%,
|
|
30
|
+
transparent
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
color: var(--rr-sidenotes-ink);
|
|
34
|
+
font-size: 0.8125rem;
|
|
35
|
+
line-height: 1.55;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.rr-sidenotes__index {
|
|
39
|
+
display: inline-block;
|
|
40
|
+
margin-right: 0.4em;
|
|
41
|
+
color: var(--rr-sidenotes-muted);
|
|
42
|
+
font-size: 0.75em;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.rr-sidenotes__body p {
|
|
47
|
+
margin: 0 0 0.5em;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.rr-sidenotes__body p:last-child {
|
|
51
|
+
margin-bottom: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.rr-sidenotes__footnotes {
|
|
55
|
+
font-size: 0.875rem;
|
|
56
|
+
color: var(--rr-sidenotes-ink);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Mobile: notes are hidden and become tap-open popovers. */
|
|
60
|
+
@media (max-width: 48rem) {
|
|
61
|
+
.rr-sidenotes__note {
|
|
62
|
+
position: fixed;
|
|
63
|
+
z-index: 60;
|
|
64
|
+
bottom: var(--rb-space-2, 1rem);
|
|
65
|
+
left: var(--rb-space-2, 1rem);
|
|
66
|
+
right: var(--rb-space-2, 1rem);
|
|
67
|
+
display: none;
|
|
68
|
+
max-height: min(60vh, 24rem);
|
|
69
|
+
overflow: auto;
|
|
70
|
+
padding: var(--rb-space-3, 1.5rem);
|
|
71
|
+
background: var(--rb-color-surface, #ffffff);
|
|
72
|
+
border: var(--rb-rule-width, 1px) solid var(--rr-sidenotes-rule);
|
|
73
|
+
box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.18);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Right-edge panel variant driven by `popoverAlignment: "end"`. */
|
|
77
|
+
.rr-sidenotes__note--popover-end {
|
|
78
|
+
top: 50%;
|
|
79
|
+
bottom: auto;
|
|
80
|
+
left: auto;
|
|
81
|
+
width: min(20rem, calc(100vw - 2 * var(--rb-space-2, 1rem)));
|
|
82
|
+
transform: translateY(-50%);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.rr-sidenotes__note--open {
|
|
86
|
+
display: block;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Desktop: static margin notes beside their paragraph anchor. */
|
|
91
|
+
@media (min-width: 48rem) {
|
|
92
|
+
:is(
|
|
93
|
+
p,
|
|
94
|
+
li,
|
|
95
|
+
dd,
|
|
96
|
+
dt,
|
|
97
|
+
td,
|
|
98
|
+
th,
|
|
99
|
+
figcaption,
|
|
100
|
+
h1,
|
|
101
|
+
h2,
|
|
102
|
+
h3,
|
|
103
|
+
h4,
|
|
104
|
+
h5,
|
|
105
|
+
h6,
|
|
106
|
+
blockquote
|
|
107
|
+
):has(.rr-sidenotes__ref) {
|
|
108
|
+
position: relative;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.rr-sidenotes__note {
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 0;
|
|
114
|
+
left: 100%;
|
|
115
|
+
width: var(--rr-sidenotes-width, 16rem);
|
|
116
|
+
max-width: calc(100vw - 100% - 1rem);
|
|
117
|
+
margin-left: var(--rb-space-3, 1.5rem);
|
|
118
|
+
padding-left: var(--rb-space-2, 1rem);
|
|
119
|
+
border-left: calc(var(--rb-rule-width, 1px) * 2) solid
|
|
120
|
+
var(--rr-sidenotes-rule);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Margin notes are always visible, so the trailing definitions are hidden. */
|
|
124
|
+
.rr-sidenotes__footnotes {
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
127
|
+
}
|