@quillmark/svelte 0.0.0 → 0.1.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.
- package/THEMING.md +25 -0
- package/dist/core/theme.css +7 -0
- package/dist/preset/recipes.css +97 -5
- package/dist/preset/scale.css +5 -0
- package/package.json +2 -4
package/THEMING.md
CHANGED
|
@@ -129,6 +129,31 @@ It carries a `--qmh-*` scale for the page, derived from the same ten dials and c
|
|
|
129
129
|
| `.qm-control` | A boxed button or select, which is what a host's controls are and the package's are not. |
|
|
130
130
|
| `.qm-measure` | A reading column at the width a passage wants. |
|
|
131
131
|
|
|
132
|
+
### The shell, if you are building a tool
|
|
133
|
+
|
|
134
|
+
An app that mounts an editor beside a preview over one session needs a screen to put them in, and the SHAPE of that screen is the same every time. Four more classes are that shape, so what you write is the wiring rather than the grid:
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<div class="qm-workspace">
|
|
138
|
+
<header class="qm-bar site-head">
|
|
139
|
+
<span class="site-mark">acme<span class="site-slash">/</span>studio</span>
|
|
140
|
+
</header>
|
|
141
|
+
<div class="qm-split">
|
|
142
|
+
<section class="qm-frame"><!-- <VisualEditor class="qm-pane" /> --></section>
|
|
143
|
+
<section class="qm-frame"><!-- <Preview /> --></section>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
| Class | What it is |
|
|
149
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
150
|
+
| `.qm-workspace` | The screen: pinned to the viewport, three bands (a head, the body, an optional foot), the body taking what is left and the document scrolling nowhere. |
|
|
151
|
+
| `.qm-bar` | The row a band puts its parts on, wrapping and centred. The rule under it, the gutter beside it and its depth stay yours: that is your page shell. |
|
|
152
|
+
| `.qm-split` | Two even tracks for two surfaces, the page gap between them. Below `60rem` they stack, each at `--qmh-pane`; which element scrolls then is yours. |
|
|
153
|
+
| `.qm-frame` | The mounting site: an edge, a corner, and the clip that holds a surface to them. What is inside it is the surface's own. |
|
|
154
|
+
|
|
155
|
+
The shape is shared; the LOOK of a band is not. Your wordmark, your nav and the depth of your head are the most app-specific things on the screen, and a preset that drew them would hand every tool built on this the same face, so they read `--qmh-*` like everything else and you write the rules. `.qm-split`'s gap is a default rather than a fact about splitting: close it to `0` and carry a hairline on one pane if you want the two mounts to meet instead of stand apart.
|
|
156
|
+
|
|
132
157
|
It is **unlayered**, so your own rules beat it by ordinary precedence, exactly as they beat the surfaces. It is also opt-in and side-effect free until imported: nothing that styles your document arrives with a component.
|
|
133
158
|
|
|
134
159
|
One rule in it earns its place regardless of whether you take the rest, and you want it if you draw a focus ring of your own:
|
package/dist/core/theme.css
CHANGED
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
on the root rule (`font-family`) that every root then inherits, and a free
|
|
13
13
|
`style` attribute for the consumer.
|
|
14
14
|
|
|
15
|
+
That import carries no binding, so it survives a consumer's bundler only because
|
|
16
|
+
the package claims `sideEffects: true`. Pruned, every rung below is undefined,
|
|
17
|
+
every `var()` reading one is invalid at computed-value time, and the declaration
|
|
18
|
+
holding it drops: a control with no border, no background and no padding, under
|
|
19
|
+
chrome that still reads as intact. `check:bundle` holds both ends, the claim and
|
|
20
|
+
the built bytes.
|
|
21
|
+
|
|
15
22
|
Every value stays a `var()` reference, so the dials resolve against the CASCADE
|
|
16
23
|
at each root: a consumer's `[data-theme="dark"]` ancestor rule flows in
|
|
17
24
|
unchanged, the light/dark default follows the `color-scheme` the host declares
|
package/dist/preset/recipes.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* THE ENDORSED LOOK: the rules a host draws around a mounted surface
|
|
2
|
-
puts on its own elements. The rungs beside this in
|
|
3
|
-
half (a scale alone still leaves a consumer writing
|
|
4
|
-
anything on the page looks like anything), so the recipes
|
|
5
|
-
for. This file mints nothing; `check:style` runs its axes here.
|
|
1
|
+
/* THE ENDORSED LOOK: the rules a host draws around a mounted surface AND the shell it
|
|
2
|
+
mounts one in, as classes it puts on its own elements. The rungs beside this in
|
|
3
|
+
`scale.css` are the invisible half (a scale alone still leaves a consumer writing
|
|
4
|
+
every declaration before anything on the page looks like anything), so the recipes
|
|
5
|
+
are what the preset is for. This file mints nothing; `check:style` runs its axes here.
|
|
6
6
|
|
|
7
7
|
These are HOST classes. They land on the consumer's DOM, never on a mounted root, so
|
|
8
8
|
they freeze nothing about the surfaces' interior: the reason the package withholds
|
|
@@ -41,6 +41,98 @@
|
|
|
41
41
|
max-width: var(--qmh-measure);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/* ── The workspace ─────────────────────────────────────────────────────────── */
|
|
45
|
+
|
|
46
|
+
/* The rules above dress the page a surface sits ON; these four are the SHELL it is
|
|
47
|
+
mounted in, a tool where `.qm-page` is a document: the screen an app that mounts two
|
|
48
|
+
surfaces over one session is, drawn once (ARCHITECTURE §Styling).
|
|
49
|
+
|
|
50
|
+
PINNED to the viewport rather than sized to it: a page-height box still leaves the
|
|
51
|
+
root scroller counting the overflow its panes clip, and a wheel over the chrome drags
|
|
52
|
+
the whole app off the top. Three bands (a head, the body, an optional foot), and the
|
|
53
|
+
body takes what is left and may shrink below its content, so the panes in it own
|
|
54
|
+
their overflow and hold still while their contents move. */
|
|
55
|
+
.qm-workspace {
|
|
56
|
+
position: fixed;
|
|
57
|
+
inset: 0;
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* A gesture past the end of a pane chains out to the viewport and bounces the empty
|
|
64
|
+
document, which is the last way a pinned shell moves. Conditioned on the workspace, so
|
|
65
|
+
a host's other routes keep a page's own feel. */
|
|
66
|
+
html:has(.qm-workspace) {
|
|
67
|
+
overscroll-behavior: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* A band's LINE: the row a head or a foot puts its parts on, wrapping, centred. That is
|
|
71
|
+
the whole of it. What a band is made OF is the host's: the rule under it, the gutter
|
|
72
|
+
beside it, and the depth of it, because where a band ends and how tall it stands are
|
|
73
|
+
page-shell decisions: a site holding its content to a maximum runs the rule past it at
|
|
74
|
+
its own rhythm, and a one-screen tool has no maximum to hold to. */
|
|
75
|
+
.qm-bar {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-wrap: wrap;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: var(--qmh-space-2) var(--qmh-space-4);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* TWO EVEN TRACKS for two surfaces, and no resizer, since a divider that can be dragged
|
|
83
|
+
is a control competing with what it divides. Each track may shrink below its content,
|
|
84
|
+
which is what lets the frame in it clip rather than grow.
|
|
85
|
+
|
|
86
|
+
The GAP is the endorsed default and not a fact about splitting: two surfaces standing
|
|
87
|
+
apart on a page read as two things, which is what a host showing its instruments wants.
|
|
88
|
+
A host that spends the whole screen on the mounts closes it to nothing and carries a
|
|
89
|
+
hairline on one pane instead: one property, and the tracks are untouched.
|
|
90
|
+
|
|
91
|
+
Below the width that fits two mounts abreast the split stops being one: the tracks
|
|
92
|
+
stack and each takes a pane's height. WHICH element scrolls then is the host's, since
|
|
93
|
+
it is the host that knows where the room comes from. */
|
|
94
|
+
.qm-split {
|
|
95
|
+
display: grid;
|
|
96
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
97
|
+
grid-template-rows: minmax(0, 1fr);
|
|
98
|
+
gap: var(--qmh-space-4);
|
|
99
|
+
min-height: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media (width < 60rem) {
|
|
103
|
+
.qm-split {
|
|
104
|
+
grid-template-columns: minmax(0, 1fr);
|
|
105
|
+
grid-template-rows: none;
|
|
106
|
+
grid-auto-rows: var(--qmh-pane);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* THE MOUNTING SITE: an edge, a corner, and the clip that holds a surface to them, which
|
|
111
|
+
is all a surface painting its own column needs. No tone and no gutter: those are the
|
|
112
|
+
surface's own (THEMING §"Drop it in"). `border-box`, so a stated height is the height
|
|
113
|
+
it draws.
|
|
114
|
+
|
|
115
|
+
POSITIONED, because a clip reaches only what it is the containing block for: a
|
|
116
|
+
surface's out-of-flow parts (a parked description, an overlay) resolve against the
|
|
117
|
+
nearest positioned ancestor, and with none between them and the document they land at
|
|
118
|
+
their static position UNCLIPPED, leaving the page to scroll past its own foot by
|
|
119
|
+
however far the frame's contents run over.
|
|
120
|
+
|
|
121
|
+
The two minimums are what let a frame in a track CLIP rather than push: a grid or flex
|
|
122
|
+
item floors at its content, so a mount that paints wider than its column widens the
|
|
123
|
+
column instead. They ride the frame rather than the split's children, which keeps every
|
|
124
|
+
rule in this file landing where the host put a class. Outside a track they are the
|
|
125
|
+
initial value and do nothing. */
|
|
126
|
+
.qm-frame {
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
position: relative;
|
|
129
|
+
min-width: 0;
|
|
130
|
+
min-height: 0;
|
|
131
|
+
border: var(--qmh-border-width) solid var(--qmh-border);
|
|
132
|
+
border-radius: var(--qmh-radius);
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
}
|
|
135
|
+
|
|
44
136
|
/* ── Type ──────────────────────────────────────────────────────────────────── */
|
|
45
137
|
|
|
46
138
|
/* A run of chrome type: a section's label, a panel's caption, the name over a readout.
|
package/dist/preset/scale.css
CHANGED
|
@@ -58,6 +58,11 @@
|
|
|
58
58
|
so it does not derive from the spacing dial. */
|
|
59
59
|
--qmh-measure: 34rem;
|
|
60
60
|
|
|
61
|
+
/* What one mount takes once a split has stacked. Reading geometry too, and about
|
|
62
|
+
the surface rather than the text: how much of a document is worth showing when it
|
|
63
|
+
cannot stand beside the thing it answers to. */
|
|
64
|
+
--qmh-pane: 34rem;
|
|
65
|
+
|
|
61
66
|
/* ── Type ────────────────────────────────────────────────────────────────── */
|
|
62
67
|
/* Two faces with a job each: prose is sans, chrome is mono. Both are system stacks,
|
|
63
68
|
so the preset costs no network request. The sans face reads the same dial the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quillmark/svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Editor, live-preview and source surfaces over a Quillmark WASM session.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -55,9 +55,7 @@
|
|
|
55
55
|
"THEMING.md",
|
|
56
56
|
"NOTICE"
|
|
57
57
|
],
|
|
58
|
-
"sideEffects":
|
|
59
|
-
"**/*.css"
|
|
60
|
-
],
|
|
58
|
+
"sideEffects": true,
|
|
61
59
|
"scripts": {
|
|
62
60
|
"build": "svelte-package",
|
|
63
61
|
"prepare": "npm run build",
|