@greendrake/theme 0.5.0 → 0.7.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/_mixins.scss CHANGED
@@ -78,8 +78,15 @@ $max-content-width: 850px;
78
78
  // colour of its own but a second copy of the page canvas on its own
79
79
  // viewport-anchored box, masked down to the strip the bar occupies: where it is
80
80
  // opaque it is indistinguishable from the page behind it, vignette falloff
81
- // included. Sits behind the bar's own content (z-index -1 inside the stacking
82
- // context the bar's z-index opens), so nothing about the bar's children moves.
81
+ // included.
82
+ //
83
+ // Included on an element of its own: the bar's preceding sibling, at the bar's
84
+ // z-index, so tree order paints it directly under the bar. Never the bar's own
85
+ // ::before — a sticky bar is a stacking context, and a fixed layer inside it
86
+ // lies beneath everything the bar holds. WebKit then composites any transformed
87
+ // child overlapping that layer onto a layer of its own, rasterised at the
88
+ // child's untransformed size, so a child scaled up (the header's parked brand
89
+ // mark) is drawn as an upscaled bitmap.
83
90
  //
84
91
  // $edge is the viewport edge the bar is stuck to. The mask holds full opacity
85
92
  // for $solid from that edge — the band the bar's content occupies — then takes
@@ -95,15 +102,11 @@ $max-content-width: 850px;
95
102
  @if $edge == top {
96
103
  $away: bottom;
97
104
  }
98
- &::before {
99
- content: '';
100
- position: fixed;
101
- inset: 0;
102
- z-index: -1;
103
- pointer-events: none;
104
- @include page-canvas;
105
- mask-image: linear-gradient(to #{$away}, #000 #{$solid}, transparent calc(#{$solid} + #{$ramp}));
106
- }
105
+ position: fixed;
106
+ inset: 0;
107
+ pointer-events: none;
108
+ @include page-canvas;
109
+ mask-image: linear-gradient(to #{$away}, #000 #{$solid}, transparent calc(#{$solid} + #{$ramp}));
107
110
  }
108
111
 
109
112
  @mixin button-colors {
@@ -129,7 +132,6 @@ $max-content-width: 850px;
129
132
  color: #fff;
130
133
  border: 0;
131
134
  padding: 0;
132
- cursor: pointer;
133
135
  line-height: $size;
134
136
  font-size: calc($size * 0.55);
135
137
  &:hover {
package/dashboard.scss CHANGED
@@ -34,12 +34,22 @@ a:hover {
34
34
  color: var(--link-color-hover);
35
35
  }
36
36
 
37
- label {
37
+ // Captions: a bare <label>, and a Field's caption, which is in its <label> or, for a
38
+ // control a label cannot name, stands alone. A Field's <label> also wraps the control
39
+ // itself, which keeps its own look.
40
+ label,
41
+ .Field__caption {
38
42
  font-size: var(--font-xs);
39
43
  font-weight: 500;
40
44
  opacity: 0.7;
41
45
  }
42
46
 
47
+ .Field > label {
48
+ font-size: inherit;
49
+ font-weight: inherit;
50
+ opacity: 1;
51
+ }
52
+
43
53
  // Headings read as panel/section dividers rather than page titles — every
44
54
  // dashboard panel opens with one, and detail views nest h2/h3 under it.
45
55
  h1,
package/editor-rows.scss CHANGED
@@ -1,7 +1,8 @@
1
1
  // Opt-in record-editor/detail-pane layout: `@use '@greendrake/theme/editor-rows';`
2
2
  // (the dashboard preset pulls it in). `.EditorRows` is the padded scrolling
3
- // pane, `.EditorRows__row` a label/value line. The classes are independent:
4
- // a component whose root layout diverges may adopt the rows alone.
3
+ // pane, `.EditorRows__row` a label/value line; `.EditorRows--dense` packs the
4
+ // rows of a read-only pane tighter than an editor's. The classes are
5
+ // independent: a component whose root layout diverges may adopt the rows alone.
5
6
 
6
7
  .EditorRows {
7
8
  padding: var(--space-4);
@@ -23,5 +24,28 @@
23
24
  }
24
25
  > div {
25
26
  flex-grow: 1;
27
+ min-width: 0;
28
+ word-break: break-word;
26
29
  }
27
30
  }
31
+
32
+ .EditorRows--dense .EditorRows__row {
33
+ padding: var(--space-1) 0;
34
+ }
35
+
36
+ // A value too long or too literal for a line — an error trace, a raw body,
37
+ // template data: monospace, wrapped, and scrolling within a bounded box.
38
+ .EditorRows__pre {
39
+ flex: 1;
40
+ min-width: 0;
41
+ margin: 0;
42
+ padding: var(--space-2);
43
+ background: var(--form-background);
44
+ border: 1px solid var(--border-color);
45
+ border-radius: var(--border-radius);
46
+ white-space: pre-wrap;
47
+ font-family: ui-monospace, monospace;
48
+ font-size: var(--font-xs);
49
+ max-height: 50vh;
50
+ overflow-y: auto;
51
+ }
@@ -13,8 +13,8 @@ textarea {
13
13
  border: 1px solid var(--border-color);
14
14
  }
15
15
 
16
+ // A button keeps the default cursor: the hand is a hyperlink's.
16
17
  button {
17
- cursor: pointer;
18
18
  padding: var(--space-1) var(--space-4);
19
19
  &:hover:not(:disabled) {
20
20
  border-color: var(--border-color-hover);
@@ -22,7 +22,6 @@ button {
22
22
  }
23
23
  &:disabled {
24
24
  opacity: 0.5;
25
- cursor: default;
26
25
  }
27
26
  }
28
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greendrake/theme",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Design tokens, document-level element styling, a light/dark theming mixin and an opt-in dashboard palette",
5
5
  "license": "MIT",
6
6
  "author": "Eugene Greendrake <eugene@greendrake.nz>",
@@ -54,10 +54,10 @@
54
54
  },
55
55
  "prettier": "@greendrake/dev-config/prettier",
56
56
  "dependencies": {
57
- "@greendrake/css-reset": "0.5.0",
58
- "@greendrake/scss-kit": "0.5.0"
57
+ "@greendrake/css-reset": "0.7.0",
58
+ "@greendrake/scss-kit": "0.7.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@greendrake/dev-config": "0.5.0"
61
+ "@greendrake/dev-config": "0.7.0"
62
62
  }
63
63
  }