docpensieve 0.1.3 → 0.1.4

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.
@@ -0,0 +1,156 @@
1
+ /*
2
+ * Classes of the documentation's examples, for the custom theme.
3
+ *
4
+ * The custom theme loads no utility framework: the classes a page uses are
5
+ * written by the project. These are the ones DocPensieve's own pages use.
6
+ * "docpensieve init" installs this file as theme/99-docpensieve.css, next to
7
+ * the documentation in 99-docpensieve/: delete both together.
8
+ *
9
+ * Every colour comes from the --dp-* tokens, or is mixed with them, so that
10
+ * the examples follow the light and dark palettes.
11
+ */
12
+
13
+ /* Sizes */
14
+
15
+ .narrow {
16
+ max-inline-size: 24rem;
17
+ }
18
+
19
+ .full-height {
20
+ block-size: 100%;
21
+ }
22
+
23
+ /* Text */
24
+
25
+ .centered {
26
+ text-align: center;
27
+ }
28
+
29
+ .small {
30
+ font-size: 0.875rem;
31
+ }
32
+
33
+ .large {
34
+ font-size: 1.5rem;
35
+ }
36
+
37
+ .caps {
38
+ text-transform: uppercase;
39
+ letter-spacing: 0.05em;
40
+ }
41
+
42
+ .italic {
43
+ font-style: italic;
44
+ }
45
+
46
+ .muted {
47
+ color: var(--dp-text-soft);
48
+ }
49
+
50
+ .accent-text {
51
+ color: var(--dp-accent);
52
+ }
53
+
54
+ .figure {
55
+ font-size: 2.25rem;
56
+ font-weight: 600;
57
+ line-height: 1.2;
58
+ color: var(--dp-accent);
59
+ }
60
+
61
+ .label {
62
+ display: block;
63
+ margin-block: 0.5rem 0.25rem;
64
+ font-size: 1rem;
65
+ font-weight: 600;
66
+ }
67
+
68
+ /* Colours, for the text and the gauges alike */
69
+
70
+ .green {
71
+ --dp-skill-color: #10b981;
72
+ color: #10b981;
73
+ }
74
+
75
+ .amber {
76
+ --dp-skill-color: #f59e0b;
77
+ color: #f59e0b;
78
+ }
79
+
80
+ /* Cards */
81
+
82
+ .highlight {
83
+ border-color: var(--dp-accent);
84
+ background: var(--dp-accent-soft);
85
+ }
86
+
87
+ .warning {
88
+ border-color: #f59e0b;
89
+ background: color-mix(in oklab, #f59e0b 12%, var(--dp-bg));
90
+ }
91
+
92
+ .warning-title {
93
+ color: color-mix(in oklab, #d97706 70%, var(--dp-text));
94
+ }
95
+
96
+ .plain {
97
+ border: 0;
98
+ box-shadow: none;
99
+ background: transparent;
100
+ }
101
+
102
+ .flush {
103
+ padding-inline: 0;
104
+ }
105
+
106
+ /* Layout */
107
+
108
+ .row {
109
+ display: flex;
110
+ flex-wrap: wrap;
111
+ align-items: center;
112
+ gap: 0.75rem;
113
+ }
114
+
115
+ .row.align-end {
116
+ align-items: flex-end;
117
+ }
118
+
119
+ .plain-list {
120
+ display: grid;
121
+ gap: 0.5rem;
122
+ padding-inline-start: 0;
123
+ list-style: none;
124
+ }
125
+
126
+ .wide-gap {
127
+ gap: 2.5rem;
128
+ }
129
+
130
+ /* Content that flows from one column to the next, as in a newspaper */
131
+
132
+ .flow {
133
+ columns: 2;
134
+ column-gap: 1.5rem;
135
+ }
136
+
137
+ @media (min-width: 40rem) {
138
+ .flow {
139
+ columns: 3;
140
+ }
141
+ }
142
+
143
+ .flow > * {
144
+ break-inside: avoid;
145
+ margin-block-end: 1.5rem;
146
+ }
147
+
148
+ /* A back-to-top button placed in the text rather than fixed on the screen */
149
+
150
+ .inline-button {
151
+ position: static;
152
+ display: inline-flex;
153
+ inline-size: auto;
154
+ box-shadow: none;
155
+ padding-inline: 1rem;
156
+ }
package/types/theme.d.ts CHANGED
@@ -4,14 +4,24 @@
4
4
  * @module docpensieve/theme
5
5
  */
6
6
  import { ThemeEngine } from '@docpensieve/theme';
7
+ /**
8
+ * Reads the project's own stylesheets: every `.css` file of its `theme/`
9
+ * folder, in name order. None when the folder does not exist.
10
+ *
11
+ * @param {string} [rootDir] Project root.
12
+ * @returns {string[]} The contents of each file.
13
+ */
14
+ export declare function projectCss(rootDir?: string): string[];
7
15
  /**
8
16
  * Mounts the ThemeEngine matching the declared framework.
9
17
  *
10
18
  * The CLI does this wiring: `core` deliberately ignores the `theme` package
11
19
  * and receives the engine by injection (ADR-002).
12
20
  *
13
- * Along the way, the class table is handed to the components: that is what
14
- * lets them ask for their class instead of hard-coding it (ADR-007).
21
+ * Along the way, the class table and the framework are handed to the
22
+ * components: that is what lets them ask for their class instead of
23
+ * hard-coding it (ADR-007), and lets `ForTheme` keep the variant of the active
24
+ * theme.
15
25
  *
16
26
  * @param {Record<string, any>} config Normalised configuration.
17
27
  * @param {string} [extraCss] CSS appended after the theme's — the look of the