x4js 2.3.22 → 2.3.24

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.
Files changed (56) hide show
  1. package/aicontext.md +31 -1
  2. package/package.json +1 -1
  3. package/src/components/btngroup/btngroup.module.scss +1 -1
  4. package/src/components/btngroup/btngroup.ts +6 -1
  5. package/src/components/button/button.module.scss +4 -4
  6. package/src/components/button/button.ts +20 -0
  7. package/src/components/calendar/calendar.module.scss +2 -1
  8. package/src/components/calendar/calendar.ts +2 -1
  9. package/src/components/chart/chart.module.scss +4 -4
  10. package/src/components/checkbox/checkbox.module.scss +2 -1
  11. package/src/components/checkbox/checkbox.ts +1 -0
  12. package/src/components/colorpicker/colorpicker.module.scss +0 -1
  13. package/src/components/dialog/dialog.module.scss +4 -4
  14. package/src/components/dialog/dialog.ts +1 -0
  15. package/src/components/dockingview/dockingview.module.scss +9 -11
  16. package/src/components/dockingview/dockingview.ts +1 -0
  17. package/src/components/form/form.module.scss +2 -2
  18. package/src/components/form/form.ts +1 -1
  19. package/src/components/gauge/gauge.module.scss +2 -2
  20. package/src/components/gridview/gridview.module.scss +0 -1
  21. package/src/components/input/input.module.scss +2 -2
  22. package/src/components/input/input.ts +3 -0
  23. package/src/components/keyboard/keyboard.ts +11 -1
  24. package/src/components/label/label.module.scss +3 -3
  25. package/src/components/listbox/listbox.module.scss +6 -3
  26. package/src/components/listbox/listbox.ts +2 -0
  27. package/src/components/menu/menu.module.scss +1 -2
  28. package/src/components/messages/messages.module.scss +18 -17
  29. package/src/components/messages/messages.ts +70 -12
  30. package/src/components/messages/pen-field.svg +1 -1
  31. package/src/components/panel/panel.module.scss +4 -3
  32. package/src/components/panel/panel.ts +1 -0
  33. package/src/components/popup/popup.module.scss +2 -3
  34. package/src/components/popup/popup.ts +1 -0
  35. package/src/components/propgrid/progrid.module.scss +4 -4
  36. package/src/components/radio/radio.module.scss +9 -3
  37. package/src/components/radio/radio.ts +7 -1
  38. package/src/components/select/select.module.scss +17 -12
  39. package/src/components/select/select.ts +9 -0
  40. package/src/components/settingsview/settingsview.module.scss +1 -4
  41. package/src/components/spreadsheet/spreadsheet.module.scss +0 -1
  42. package/src/components/switch/switch.module.scss +3 -2
  43. package/src/components/switch/switch.ts +1 -0
  44. package/src/components/tabs/tabs.module.scss +6 -3
  45. package/src/components/tabs/tabs.ts +3 -0
  46. package/src/components/tag/tag.module.scss +1 -1
  47. package/src/components/textarea/textarea.module.scss +8 -1
  48. package/src/components/textarea/textarea.ts +3 -0
  49. package/src/components/themes.scss +79 -12
  50. package/src/components/tickline/tickline.module.scss +1 -1
  51. package/src/components/tooltips/tooltips.scss +4 -3
  52. package/src/components/tooltips/tooltips.ts +1 -0
  53. package/src/components/treeview/treeview.module.scss +6 -2
  54. package/src/components/treeview/treeview.ts +1 -0
  55. package/src/core/core_application.ts +47 -0
  56. package/src/core/core_colors.ts +112 -17
@@ -11,6 +11,8 @@ import { Dialog, DialogProps } from "../dialog/dialog"
11
11
  import { Form } from '../form/form';
12
12
  import { BtnGroupItem } from '../btngroup/btngroup';
13
13
  import { Input } from '../input/input';
14
+ import { SimpleTextArea } from '../textarea/textarea';
15
+ import { Button } from '../button/button';
14
16
  import { Component } from '../../core/component';
15
17
  import { Progress } from '../components.js';
16
18
 
@@ -34,7 +36,11 @@ export interface MessageBoxProps extends DialogProps {
34
36
  * --msgbox-caption-background
35
37
  * --msgbox-caption-color
36
38
  * --msgbox-icon-color
39
+ * --msgbox-question-icon-color
40
+ * --msgbox-log-background
37
41
  * ```
42
+ * --msgbox-caption-* and --msgbox-icon-color are the ones of an error; a question, an InputBox
43
+ * and a PromptBox have the title bar of a Dialog and their icon in --msgbox-question-icon-color
38
44
  */
39
45
 
40
46
  @class_ns( "x4" )
@@ -58,7 +64,9 @@ export class MessageBox extends Dialog<DialogProps>
58
64
  }
59
65
  }
60
66
 
61
- const box = new MessageBox({
67
+ // the kind as a class: an error has its own title bar
68
+ const box = new MessageBox({
69
+ cls: icon_type ?? "error",
62
70
  modal: true,
63
71
  title: title ?? _tr.global.error,
64
72
  movable: true,
@@ -269,6 +277,13 @@ export class PromptBox extends Dialog<DialogProps>
269
277
 
270
278
  // :: PROGRESS ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
271
279
 
280
+ /**
281
+ * a modal box that follows a long task: a title, a bar, and the lines of what is done
282
+ * in a textarea read only (they are text: a markup is shown as it is written).
283
+ * done( ) shows its button OK: after an error it waits for it, else it closes the box
284
+ * after 5s, the seconds left in the button.
285
+ */
286
+
272
287
  @class_ns( "x4" )
273
288
  export class ProgressionBox extends Dialog {
274
289
 
@@ -288,7 +303,7 @@ export class ProgressionBox extends Dialog {
288
303
  new VBox( { flex: 1, cls: "right", content: [
289
304
  new SimpleText( { id: "title", text: title } ),
290
305
  new Progress( { id:"prog", min: 0, max: 100, value: 0 } ),
291
- new VBox( { id: "sub-text" } ),
306
+ new SimpleTextArea( { id: "sub-text", readonly: true, trim: false } ),
292
307
  ]})
293
308
  ]
294
309
  }),
@@ -299,37 +314,80 @@ export class ProgressionBox extends Dialog {
299
314
 
300
315
  this.query("#btnbar").show( false );
301
316
 
302
- this.on("btnclick", ( ) => this.show( false ) );
317
+ // OK: closed at once, the countdown stopped
318
+ this.on("btnclick", ( ) => {
319
+ this.clearInterval( "close" );
320
+ this.show( false );
321
+ } );
303
322
  }
304
323
 
324
+ /** a line at the end */
325
+
305
326
  addText( text: string | UnsafeHtml, perc: number ) {
306
- this.query<Label>( "#sub-text").appendContent( new SimpleText( { text } ) );
327
+ this._addLine( text );
307
328
  this.query<Progress>( "#prog").setValue( perc );
308
329
  }
309
330
 
331
+ /** a line at the end: done( ) then waits for the button OK */
332
+
310
333
  addError( text: string | UnsafeHtml, perc: number ) {
311
- this.query<Label>( "#sub-text").appendContent( new SimpleText( { cls:"error", text } ) );
334
+ this._addLine( text );
312
335
  this.query<Progress>( "#prog").setValue( perc );
313
336
 
314
337
  this.#has_errors = true;
315
338
  }
316
339
 
340
+ /** the text in place of all the lines */
341
+
317
342
  setText( text: string | UnsafeHtml, perc: number ) {
318
- this.query<Label>( "#sub-text").setContent( new SimpleText( { text } ) );
343
+ this.query<SimpleTextArea>( "#sub-text" ).setText( text.toString( ) );
319
344
  this.query<Progress>( "#prog").setValue( perc );
320
345
  }
321
346
 
347
+ /** as at the start: no line, no error, no button OK */
348
+
322
349
  clear( ) {
323
- this.#has_errors = true;
324
- this.query<Label>( "#sub-text").clearContent( );
350
+ this.#has_errors = false;
351
+ this.clearInterval( "close" );
352
+ this.query( "#btnbar" ).show( false );
353
+ this.query<SimpleTextArea>( "#sub-text" ).setText( "" );
354
+ }
355
+
356
+ // the line after the others, the last one shown
357
+ private _addLine( text: string | UnsafeHtml ) {
358
+ const log = this.query<SimpleTextArea>( "#sub-text" );
359
+ const lines = log.getText( );
360
+
361
+ log.setText( lines ? lines + "\n" + text : text.toString( ) );
362
+ log.scrollToBottom( );
325
363
  }
326
364
 
365
+ /**
366
+ * the task is over: the button OK is shown. After an error it waits for a click;
367
+ * without one it counts the seconds left, "OK (5s)", and closes the box at 0
368
+ */
369
+
327
370
  done( ) {
371
+ const ok = this.query<Button>( "#ok" );
372
+ this.query( "#btnbar" ).show( true );
373
+
328
374
  if( this.#has_errors ) {
329
- this.query("#btnbar").show( true );
330
- }
331
- else {
332
- this.setTimeout( "close", 5000, ( ) => { this.show(false);} );
375
+ ok.setText( _tr.global.ok );
376
+ return;
333
377
  }
378
+
379
+ let left = 5;
380
+ ok.setText( `${_tr.global.ok} (${left}s)` );
381
+
382
+ this.setInterval( "close", 1000, ( ) => {
383
+ left--;
384
+ if( left>0 ) {
385
+ ok.setText( `${_tr.global.ok} (${left}s)` );
386
+ }
387
+ else {
388
+ this.clearInterval( "close" );
389
+ this.show( false );
390
+ }
391
+ } );
334
392
  }
335
393
  }
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M0 128l32 0 224 0 32 0 0 64-32 0L64 192l0 256 448 0 0-128 0-32 64 0 0 32 0 160 0 32-32 0L32 512 0 512l0-32L0 160l0-32z"/><path class="fa-primary" d="M288 352l16-112L468.7 75.3l96 96L400 336 288 352zM587.3 148.7l-96-96L544 0l96 96-52.7 52.7zM96 288l64 0 0 64-64 0 0-64zm160 0l0 64-64 0 0-64 64 0z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M0 128l32 0 224 0 32 0 0 64-32 0L64 192l0 256 448 0 0-128 0-32 64 0 0 32 0 160 0 32-32 0L32 512 0 512l0-32L0 160l0-32z"/><path class="fa-primary" d="M288 352l16-112L468.7 75.3l96 96L400 336 288 352zM587.3 148.7l-96-96L544 0l96 96-52.7 52.7zM96 288l64 0 0 64-64 0 0-64zm160 0l0 64-64 0 0-64 64 0z"/></svg>
@@ -18,7 +18,8 @@
18
18
 
19
19
  :root {
20
20
  --panel-border: var( --border );
21
- --panel-title-color: var( --border );
21
+ --panel-title-color: var( --text-primary );
22
+ --panel-title-background: var( --background-primary );
22
23
  }
23
24
 
24
25
 
@@ -34,9 +35,9 @@
34
35
  position: absolute;
35
36
  left: 4px;
36
37
  top: -0.7em;
37
- background-color: white;
38
+ background-color: var( --panel-title-background );
38
39
  font-weight: bold;
39
- color: var(--color-gray-9);
40
+ color: var( --panel-title-color );
40
41
  }
41
42
 
42
43
  & > .body {
@@ -33,6 +33,7 @@ interface PanelProps extends ComponentProps {
33
33
  * ```
34
34
  * --panel-border
35
35
  * --panel-title-color
36
+ * --panel-title-background
36
37
  * ```
37
38
  */
38
39
 
@@ -16,15 +16,14 @@
16
16
 
17
17
  :root {
18
18
  --modal-mask-background: rgb(0 0 0 / 60% );
19
+ --popup-background: transparent;
19
20
  }
20
21
 
21
22
  .x4popup {
22
23
  position: absolute !important;
23
- background-color: var(--fill-color);
24
- border: 1px solid var(--border-color);
24
+ background-color: var( --popup-background );
25
25
  overflow: hidden;
26
26
  z-index: 1000;
27
- border-radius: var(--bradius);
28
27
 
29
28
  &.popup-caption,
30
29
  .popup-caption {
@@ -66,6 +66,7 @@ function dismissLast( e: UIEvent ) {
66
66
  * @cssvar
67
67
  * ```
68
68
  * --modal-mask-background
69
+ * --popup-background
69
70
  * ```
70
71
  */
71
72
 
@@ -5,16 +5,16 @@
5
5
  **/
6
6
 
7
7
  :root {
8
- --propertygrid-background: white;
9
- --propertygrid-gadget-background: white;
10
- --propertygrid-gadget-color: black;
8
+ --propertygrid-background: var( --background-primary );
9
+ --propertygrid-gadget-background: var( --background-primary );
10
+ --propertygrid-gadget-color: var( --text-primary );
11
11
 
12
12
  --propertygrid-odd-background: var(--color-primary-a5);
13
13
  --propertygrid-even-background: transparent;
14
14
  --propertygrid-disabled-background: rgb(170 170 170 / 14%);
15
15
  --propertygrid-hover-background: var(--color-primary-a10);
16
16
  --propertygrid-focus-background: var(--color-primary-a20);
17
- --propertygrid-input-background: rgba(255,255,255,0.6);
17
+ --propertygrid-input-background: var( --background-input );
18
18
 
19
19
  --propertygrid-group-background: var( --color-primary-a5 );
20
20
  --propertygrid-group-color: var( --color-primary-a50 );
@@ -14,6 +14,12 @@
14
14
  * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
15
  **/
16
16
 
17
+ :root {
18
+ --radio-background: var( --background-primary );
19
+ --radio-check-color: var( --accent-color );
20
+ --radio-square-border-checked: var( --accent-color );
21
+ }
22
+
17
23
  .x4radio {
18
24
  display: flex;
19
25
  flex-direction: row;
@@ -36,7 +42,7 @@
36
42
  input {
37
43
  appearance: none;
38
44
  border-radius: 50%;
39
- background-color: white;
45
+ background-color: var( --radio-background );
40
46
  cursor: pointer;
41
47
  display: block;
42
48
 
@@ -67,7 +73,7 @@
67
73
  }
68
74
 
69
75
  .fa-secondary {
70
- fill: white;
76
+ fill: var( --radio-check-color );
71
77
  }
72
78
  }
73
79
 
@@ -157,7 +163,7 @@
157
163
 
158
164
  &:has(input:checked) {
159
165
  background-color: var( --accent-background-active );
160
- border-color: white;
166
+ border-color: var( --radio-square-border-checked );
161
167
  font-weight: 700;
162
168
  }
163
169
  }
@@ -48,7 +48,13 @@ interface RadioProps extends ComponentProps {
48
48
  }
49
49
 
50
50
  /**
51
- *
51
+ *
52
+ * @cssvar
53
+ * ```
54
+ * --radio-background
55
+ * --radio-check-color
56
+ * --radio-square-border-checked
57
+ * ```
52
58
  */
53
59
 
54
60
  @class_ns( "x4" )
@@ -1,10 +1,11 @@
1
1
 
2
- /**
3
- * @cssvar
4
- * --select-border
5
- * --select-border-focus
6
- * --select-background
7
- */
2
+ :root {
3
+ --select-border: var( --border );
4
+ --select-border-focus: var( --accent-background );
5
+ --select-background: var( --background-primary );
6
+ --select-color: var( --text-primary );
7
+ --select-arrow-color: var( --text-ternary );
8
+ }
8
9
 
9
10
  .x4select,
10
11
  ::picker(select) {
@@ -14,22 +15,26 @@
14
15
  outline: none;
15
16
 
16
17
  border-radius: 0;
17
- border: 1px solid var( --select-border, var( --border ) );
18
- background-color: var( --select-background, white );
18
+ border: 1px solid var( --select-border );
19
+ background-color: var( --select-background );
20
+ color: var( --select-color );
19
21
  }
20
22
 
21
23
  .x4select {
22
24
  appearance: none;
23
25
  -webkit-appearance: none;
24
26
  -moz-appearance: none;
25
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
27
+ // the arrow: two halves of a square side by side, in the colour of the variable
28
+ background-image:
29
+ linear-gradient( 45deg, transparent 50%, var( --select-arrow-color ) 50% ),
30
+ linear-gradient( 135deg, var( --select-arrow-color ) 50%, transparent 50% );
26
31
  background-repeat: no-repeat;
27
- background-position: right 6px center;
28
- background-size: 12px 8px;
32
+ background-position: right 13px center, right 8px center;
33
+ background-size: 5px 5px, 5px 5px;
29
34
  padding-right: 23px;
30
35
 
31
36
  &:focus-visible {
32
- border-color: var( --select-border-focus, var( --accent-background ) );
37
+ border-color: var( --select-border-focus );
33
38
  }
34
39
 
35
40
  .select-option {
@@ -46,6 +46,15 @@ interface SelectEvents extends ComponentEvents {
46
46
  /**
47
47
  * simple select
48
48
  * cf. Combobox
49
+ *
50
+ * @cssvar
51
+ * ```
52
+ * --select-border
53
+ * --select-border-focus
54
+ * --select-background
55
+ * --select-color
56
+ * --select-arrow-color
57
+ * ```
49
58
  */
50
59
 
51
60
  @class_ns( "x4" )
@@ -18,7 +18,7 @@
18
18
  --settingsview-toc-width: 210px;
19
19
  --settingsview-section-background: var( --color-primary-a10 );
20
20
  --settingsview-section-title-background: var( --color-primary-a20 );
21
- --settingsview-hover-background: color-mix( in srgb, var( --color-primary-a20 ) 60%, transparent );
21
+ --settingsview-hover-background: var( --color-primary-a20 );
22
22
  --settingsview-marker: var( --accent-background );
23
23
  }
24
24
 
@@ -36,7 +36,6 @@
36
36
  margin: 0;
37
37
  padding: 6px 10px;
38
38
  border: 1px solid var( --border );
39
- border-radius: 4px;
40
39
 
41
40
  &:focus {
42
41
  border-color: var( --settingsview-marker );
@@ -100,7 +99,6 @@
100
99
  max-width: 900px;
101
100
  padding: 0 8px 10px;
102
101
  border: 1px solid var( --border );
103
- border-radius: 8px;
104
102
  background: var( --settingsview-section-background );
105
103
  overflow: hidden;
106
104
  scroll-margin-top: 20px; // brought to the top: below the padding of the view
@@ -144,7 +142,6 @@
144
142
  gap: 4px;
145
143
  padding: 10px 8px 12px;
146
144
  border-left: 2px solid transparent;
147
- border-radius: 4px;
148
145
 
149
146
  &:hover {
150
147
  background: var( --settingsview-hover-background );
@@ -333,7 +333,6 @@
333
333
 
334
334
  .cell-out {
335
335
  position: absolute;
336
- background-color: var( --color-gray-0 );
337
336
  width: 100%;
338
337
  height: var( --row-height );
339
338
  }
@@ -18,9 +18,10 @@
18
18
 
19
19
  :root {
20
20
  --switch-border: var( --border );
21
- --switch-background: #eee;
21
+ --switch-background: var( --background-hover );
22
22
  --switch-background-disabled: var( --disabled-background );
23
23
  --switch-checked: var( --accent-background );
24
+ --switch-thumb: var( --background-primary );
24
25
  }
25
26
 
26
27
  .x4switch {
@@ -88,7 +89,7 @@
88
89
  height: 1rem;
89
90
 
90
91
  border-radius: 8px;
91
- background-color: white;
92
+ background-color: var( --switch-thumb );
92
93
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
93
94
 
94
95
  transition: left ease 0.2s;
@@ -39,6 +39,7 @@ interface SwitchProps extends ComponentProps {
39
39
  * --switch-background
40
40
  * --switch-background-disabled
41
41
  * --switch-checked
42
+ * --switch-thumb
42
43
  * ```
43
44
  */
44
45
 
@@ -3,6 +3,9 @@
3
3
  :root {
4
4
  --tab-border-selected: var( --accent-background );
5
5
  --tab-border-hover: var( --accent-background-hover );
6
+ --tab-color-hover: var( --text-primary );
7
+ --tab-color: var( --text-primary );
8
+ --tab-color-selected: var( --text-primary );
6
9
  }
7
10
 
8
11
  .x4tabs {
@@ -20,7 +23,7 @@
20
23
  .x4button {
21
24
  border: none;
22
25
  border-bottom: 2px solid transparent;
23
- color: var( --color-gray-7 );
26
+ color: var( --tab-color );
24
27
  margin: 0;
25
28
  outline: none;
26
29
  transition: border-color 0.2s ease;
@@ -28,12 +31,12 @@
28
31
  &.selected {
29
32
  border-bottom-color: var( --tab-border-selected );
30
33
  font-weight: bold;
31
- color: var( --color-gray-9 );
34
+ color: var( --tab-color-selected );
32
35
  }
33
36
 
34
37
  &:hover {
35
38
  background-color: unset;;
36
- color: black;
39
+ color: var( --tab-color-hover );
37
40
  border-bottom-color: var( --tab-border-hover );
38
41
  }
39
42
 
@@ -146,6 +146,9 @@ interface TabsProps extends Omit<ComponentProps,"content"> {
146
146
  * ```
147
147
  * --tab-border-selected
148
148
  * --tab-border-hover
149
+ * --tab-color-hover
150
+ * --tab-color
151
+ * --tab-color-selected
149
152
  * ```
150
153
  */
151
154
 
@@ -19,7 +19,7 @@
19
19
  --tag-border: var( --border );
20
20
  --tag-border-focus: var( --border-focus );
21
21
  --tag-background: var( --accent-background );
22
- --tag-color: black;
22
+ --tag-color: var( --text-primary );
23
23
  --tag-icon-color: var( --tag-color );
24
24
  }
25
25
 
@@ -20,6 +20,9 @@
20
20
  --textarea-border: var( --border );
21
21
  --textarea-border-focus: var( --border-focus );
22
22
  --textarea-selection: var( --accent-background );
23
+ --textarea-selection-color: var( --accent-color );
24
+ --textarea-background: var( --background-input );
25
+ --textarea-color: var( --text-primary );
23
26
  }
24
27
 
25
28
  .x4simpletextarea {
@@ -36,6 +39,10 @@
36
39
  outline: none;
37
40
  font: inherit;
38
41
 
42
+ // as the ones of an input
43
+ background-color: var( --textarea-background );
44
+ color: var( --textarea-color );
45
+
39
46
  border: 1px solid var( --textarea-border );
40
47
 
41
48
  &:focus {
@@ -44,7 +51,7 @@
44
51
 
45
52
  &::selection {
46
53
  background-color: var( --textarea-selection );
47
- color: white;
54
+ color: var( --textarea-selection-color );
48
55
  }
49
56
 
50
57
  // as the one of an input
@@ -136,6 +136,9 @@ export class SimpleTextArea extends Component<SimpleTextAreaProps,TextAreaEvents
136
136
  * --textarea-border
137
137
  * --textarea-border-focus
138
138
  * --textarea-selection
139
+ * --textarea-selection-color
140
+ * --textarea-background
141
+ * --textarea-color
139
142
  * ```
140
143
  */
141
144
 
@@ -44,27 +44,39 @@ $color--interval: 8.4%;
44
44
  --color-success-a60: #{color.adjust(#10c01f, $lightness: -10%)};
45
45
  }
46
46
 
47
+ // the greys are mixes of the two ends of the scale: #999 with a0 white and a100 black,
48
+ // light on dark when a theme reverses the scale
49
+
47
50
  :root {
48
51
  // Backgrounds
49
52
  --background-primary: var(--color-primary-a0);
50
53
  --background-secondary: var(--color-primary-a10);
51
- --background-ternary: #f4f4f4;
54
+ --background-ternary: color-mix(in srgb, var(--color-primary-a100) 4.3%, var(--color-primary-a0)); // #f4f4f4
55
+ --background-hover: color-mix(in srgb, var(--color-primary-a100) 6.7%, var(--color-primary-a0)); // #eee
56
+ --background-active: color-mix(in srgb, var(--color-primary-a100) 20%, var(--color-primary-a0)); // #ccc
57
+ --background-input: color-mix(in srgb, var(--color-primary-a0) 60%, transparent); // white at 60%
52
58
 
53
59
  // Texts
54
60
  --text-primary: var(--color-primary-a100);
55
- --text-secondary: #999;
56
- --text-ternary: #666;
61
+ --text-secondary: color-mix(in srgb, var(--color-primary-a100) 40%, var(--color-primary-a0)); // #999
62
+ --text-ternary: color-mix(in srgb, var(--color-primary-a100) 60%, var(--color-primary-a0)); // #666
57
63
 
58
64
  // Disabled
59
- --disabled-background: #ccc;
60
- --disabled-color: white;
61
- --disabled-color-dark: #aaa;
65
+ --disabled-background: color-mix(in srgb, var(--color-primary-a100) 20%, var(--color-primary-a0)); // #ccc
66
+ --disabled-color: var(--color-primary-a0);
67
+ --disabled-color-dark: color-mix(in srgb, var(--color-primary-a100) 33.3%, var(--color-primary-a0)); // #aaa
68
+ --disabled-color-light: color-mix(in srgb, var(--color-primary-a100) 20%, var(--color-primary-a0)); // #ccc
69
+
70
+ // Icons
71
+ --icon-color: color-mix(in srgb, var(--color-primary-a100) 44%, transparent); // black at 44%
72
+ --icon-color-active: color-mix(in srgb, var(--accent-color) 64%, transparent); // white at 64%
62
73
 
63
74
  // Accents
64
75
  --accent-background: var(--color-primary-a60);
65
76
  --accent-background-hover: var(--color-primary-a55);
66
77
  --accent-background-focus: var(--color-primary-a70);
67
78
  --accent-background-active: var(--color-primary-a80);
79
+ --accent-background-light: color-mix(in srgb, var(--accent-background) 25%, transparent); // the accent at 25%
68
80
 
69
81
  --accent-color: var(--color-primary-a0);
70
82
  --accent-color-hover: var(--color-primary-a0);
@@ -72,19 +84,74 @@ $color--interval: 8.4%;
72
84
  --accent-color-active: var(--color-primary-a0);
73
85
 
74
86
  // Borders
75
- --border: #e1e1e1;
76
- --border-light: #eaeaea;
77
- --border-hover: #c2c2c2;
87
+ --border: color-mix(in srgb, var(--color-primary-a100) 11.8%, var(--color-primary-a0)); // #e1e1e1
88
+ --border-light: color-mix(in srgb, var(--color-primary-a100) 8.2%, var(--color-primary-a0)); // #eaeaea
89
+ --border-hover: color-mix(in srgb, var(--color-primary-a100) 23.9%, var(--color-primary-a0)); // #c2c2c2
78
90
  --border-focus: var(--accent-background);
79
91
 
92
+ // the red, orange and green do not follow the scale: their text stays white
80
93
  --alert-background: var(--color-danger-a50);
81
94
  --alert-background-active: var(--color-danger-a60);
82
- --alert-color: var(--color-primary-a0);
95
+ --alert-color: #ffffff;
83
96
 
84
97
  --warning-background: var(--color-warning-a50);
85
- --warning-color: var(--color-primary-a0);
98
+ --warning-color: #ffffff;
86
99
 
87
100
  --success-background: var(--color-success-a50);
88
101
  --success-background-active: var(--color-success-a60);
89
- --success-color: var(--color-primary-a0);
102
+ --success-color: #ffffff;
103
+ }
104
+
105
+ // :: dark theme :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
106
+ // Application.setTheme( "dark" ): the class x4theme-dark on <html>, like the theme Dark
107
+ // Modern of VS Code. Its colours are taken in the sources of VS Code:
108
+ // extensions/theme-defaults/themes/dark_modern.json, and for the lists the defaults of
109
+ // src/vs/platform/theme/common/colors/listColors.ts; the values marked "chosen" are not
110
+ // in VS Code. A theme of an application is written the same way, under html.x4theme-<name>.
111
+
112
+ html.x4theme-dark {
113
+ // the scale: a0 the background, a100 the text, the surfaces between them, then the blues
114
+ --color-primary-a0: #1f1f1f; // editor.background
115
+ --color-primary-a5: #252526; // chosen
116
+ --color-primary-a10: #2a2d2e; // list.hoverBackground
117
+ --color-primary-a20: #37373d; // list.inactiveSelectionBackground
118
+ --color-primary-a30: #3c3c3c; // input.border
119
+ --color-primary-a40: #04395e; // list.activeSelectionBackground
120
+ --color-primary-a50: #0078d4; // button.background, focusBorder
121
+ --color-primary-a55: #026ec1; // button.hoverBackground
122
+ --color-primary-a60: #0078d4;
123
+ --color-primary-a70: #026ec1;
124
+ --color-primary-a80: #04395e;
125
+ --color-primary-a90: #cccccc;
126
+ --color-primary-a100: #cccccc; // foreground
127
+
128
+ // what the scale does not give
129
+ --background-ternary: #181818; // sideBar.background
130
+ --background-hover: #2b2b2b; // button.secondaryHoverBackground
131
+ --background-active: #37373d; // list.inactiveSelectionBackground
132
+ --background-input: #313131; // input.background
133
+
134
+ --text-secondary: #9d9d9d; // descriptionForeground
135
+ --text-ternary: #bbbbbb; // chosen: between the description and the text
136
+
137
+ --border: #3c3c3c; // input.border
138
+ --border-light: #2b2b2b; // panel.border
139
+ --border-hover: #616161; // chosen (badge.background)
140
+
141
+ --disabled-background: #313131; // chosen
142
+ --disabled-color: #6e6e6e; // chosen
143
+ --disabled-color-dark: #6e6e6e; // chosen
144
+ --disabled-color-light: #4f4f4f; // chosen
145
+
146
+ --accent-color: #ffffff; // button.foreground: the text on the accent
147
+ --accent-color-hover: #ffffff;
148
+ --accent-color-focus: #ffffff;
149
+ --accent-color-active: #ffffff;
150
+
151
+ // the title bar of a Dialog: the one of the window of VS Code
152
+ --color-dialog-caption: #181818; // titleBar.activeBackground
153
+ --color-dialog-caption-text: #cccccc; // titleBar.activeForeground
154
+ --color-dialog-background: #202020; // editorWidget.background
155
+
156
+ color-scheme: dark; // the native parts: select, scroll bars, number spinners
90
157
  }
@@ -18,7 +18,7 @@
18
18
  --tickline-axis-color: var( --border );
19
19
  --tickline-color: var( --accent-color );
20
20
  --tickline-width: 1px;
21
- --tickline-background: white;
21
+ --tickline-background: var( --background-primary );
22
22
  }
23
23
 
24
24
  .x4tickline {