@nil-/doc 0.2.50 → 0.2.51

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 (45) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/components/Layout.svelte +37 -71
  3. package/components/block/Block.svelte +67 -25
  4. package/components/block/Controls.svelte +3 -5
  5. package/components/block/Controls.svelte.d.ts +2 -2
  6. package/components/block/Instance.svelte +41 -74
  7. package/components/block/context.d.ts +2 -2
  8. package/components/block/context.js +2 -1
  9. package/components/block/controls/events/Events.svelte +14 -5
  10. package/components/block/controls/events/misc/Styler.svelte +16 -41
  11. package/components/block/controls/props/Color.svelte +21 -0
  12. package/components/block/controls/props/Color.svelte.d.ts +21 -0
  13. package/components/block/controls/props/Component.svelte +5 -0
  14. package/components/block/controls/props/Number.svelte +4 -5
  15. package/components/block/controls/props/Object.svelte +8 -11
  16. package/components/block/controls/props/Props.svelte +2 -5
  17. package/components/block/controls/props/Range.svelte +5 -4
  18. package/components/block/controls/props/Select.svelte +5 -8
  19. package/components/block/controls/props/Switch.svelte +4 -5
  20. package/components/block/controls/props/Text.svelte +8 -9
  21. package/components/block/controls/props/Tuple.svelte +13 -26
  22. package/components/block/controls/props/misc/Name.svelte +1 -2
  23. package/components/block/controls/props/misc/Styler.svelte +22 -29
  24. package/components/block/controls/props/misc/defaulter.d.ts +8 -8
  25. package/components/block/controls/props/misc/defaulter.js +28 -48
  26. package/components/block/controls/props/misc/utils.d.ts +11 -0
  27. package/components/block/controls/props/misc/utils.js +31 -0
  28. package/components/block/controls/types.d.ts +10 -2
  29. package/components/block/icons/Button.svelte +30 -0
  30. package/components/block/icons/Button.svelte.d.ts +35 -0
  31. package/components/block/icons/ControlView.svelte +14 -0
  32. package/components/block/icons/ControlView.svelte.d.ts +16 -0
  33. package/components/block/icons/Position.svelte +50 -0
  34. package/components/block/icons/Position.svelte.d.ts +16 -0
  35. package/components/etc/Base.svelte +58 -0
  36. package/components/etc/Base.svelte.d.ts +18 -0
  37. package/components/etc/Container.svelte +24 -37
  38. package/components/etc/Content.svelte +45 -0
  39. package/components/etc/Content.svelte.d.ts +18 -0
  40. package/components/icons/NilDoc.svelte +1 -1
  41. package/components/icons/Theme.svelte +0 -5
  42. package/components/navigation/Nav.svelte +6 -10
  43. package/components/navigation/Node.svelte +9 -10
  44. package/components/title/Icon.svelte +3 -3
  45. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @nil-/doc
2
2
 
3
+ ## 0.2.51
4
+
5
+ ### Patch Changes
6
+
7
+ - [doc][fix] components now rely on root font-size ([#88](https://github.com/njaldea/mono/pull/88))
8
+
9
+ - [doc][fix] fix object prop control ([#88](https://github.com/njaldea/mono/pull/88))
10
+
11
+ - [doc][new] block button controls ([#88](https://github.com/njaldea/mono/pull/88))
12
+ [doc][new] centralized custom css
13
+
14
+ - [doc][misc] change styling ([#88](https://github.com/njaldea/mono/pull/88))
15
+ [doc][fix] scrolling content of container
16
+
3
17
  ## 0.2.50
4
18
 
5
19
  ### Patch Changes
@@ -2,11 +2,13 @@
2
2
  const defaultRenamer = (s) => s;
3
3
  </script>
4
4
 
5
- <script>import Container from "./etc/Container.svelte";
5
+ <script>import Base from "./etc/Base.svelte";
6
+ import Container from "./etc/Container.svelte";
6
7
  import Nav from "./navigation/Nav.svelte";
7
8
  import Icon from "./title/Icon.svelte";
8
9
  import { getTheme, initTheme } from "./context";
9
10
  import ThemeIcon from "./icons/Theme.svelte";
11
+ import Content from "./etc/Content.svelte";
10
12
  export let data;
11
13
  export let current = null;
12
14
  export let sorter = null;
@@ -30,21 +32,21 @@ const toggle = () => {
30
32
  See [documentation](https://mono-doc.vercel.app/3-Components/1-Layout) for more details.
31
33
  -->
32
34
 
33
- <div class="layout" class:dark={$dark}>
34
- <div class="top">
35
- <div class="title">
36
- <slot name="title" />
35
+ <Base dark={$dark}>
36
+ <div class="fill layout">
37
+ <div class="top">
38
+ <div class="title">
39
+ <slot name="title" />
40
+ </div>
41
+ <slot name="title-misc">
42
+ <Icon on:click={toggle}>
43
+ <ThemeIcon {theme} />
44
+ </Icon>
45
+ </slot>
37
46
  </div>
38
- <slot name="title-misc">
39
- <Icon on:click={toggle}>
40
- <ThemeIcon {theme} />
41
- </Icon>
42
- </slot>
43
- </div>
44
- <div class="main">
45
47
  <Container offset={250} vertical b>
46
48
  <svelte:fragment slot="A">
47
- <div class="content scrollable">
49
+ <Content flat>
48
50
  <Nav
49
51
  info={data}
50
52
  selected={current ?? ""}
@@ -52,43 +54,43 @@ const toggle = () => {
52
54
  renamer={renamer ?? defaultRenamer}
53
55
  on:navigate
54
56
  />
55
- </div>
57
+ </Content>
56
58
  </svelte:fragment>
57
59
  <svelte:fragment slot="B">
58
- <div class="content page">
60
+ <Content>
59
61
  {#key current}
60
62
  <slot />
61
63
  {/key}
62
- </div>
64
+ </Content>
63
65
  </svelte:fragment>
64
66
  </Container>
65
67
  </div>
66
- </div>
68
+ </Base>
67
69
 
68
70
  <style>
69
- @import url("https://fonts.googleapis.com/css?family=Fira%20Code");
71
+ .fill {
72
+ width: 100%;
73
+ height: 100%;
74
+ }
70
75
 
71
76
  .layout {
72
77
  display: grid;
73
78
  grid-template-columns: 1fr;
74
- grid-template-rows: minmax(40px, auto) 1fr;
75
- width: 100%;
76
- height: 100%;
77
- box-sizing: border-box;
78
- font-family: "Fira Code", "Courier New", Courier, monospace;
79
+ grid-template-rows: minmax(2.5rem, auto) 1fr;
79
80
  }
80
81
 
81
82
  .top {
83
+ overflow: hidden;
84
+ font-size: 1rem;
82
85
  display: grid;
83
86
  grid-auto-flow: column;
84
- grid-auto-columns: 40px;
87
+ grid-auto-columns: 2.5rem;
85
88
  grid-template-columns: 1fr;
86
89
  align-items: center;
87
- padding-left: 10px;
88
- padding-right: 10px;
90
+ padding-left: 0.625rem;
91
+ padding-right: 0.625rem;
89
92
  border-bottom-width: 1px;
90
93
  border-bottom-style: solid;
91
- box-sizing: border-box;
92
94
  user-select: none;
93
95
  }
94
96
 
@@ -97,55 +99,19 @@ const toggle = () => {
97
99
  grid-auto-flow: column;
98
100
  align-items: center;
99
101
  justify-content: left;
100
- gap: 5px;
101
- }
102
-
103
- .main {
104
- height: 100%;
105
- overflow: hidden;
102
+ gap: 0.3125rem;
106
103
  }
107
104
 
108
- .content {
109
- height: 100%;
110
- padding: 5px;
111
- display: flex;
112
- flex-direction: column;
113
- box-sizing: border-box;
114
- }
115
-
116
- /* scrollable */
117
- .scrollable,
118
- .page > :global(*:only-child) {
119
- overflow: scroll;
120
- scrollbar-width: none; /* Firefox */
121
- -ms-overflow-style: none; /* IE and Edge */
122
- }
123
-
124
- .scrollable::-webkit-scrollbar,
125
- .page > :global(*:only-child::-webkit-scrollbar) {
126
- display: none;
127
- }
128
-
129
- /* colors */
130
105
  .layout {
131
- color-scheme: light;
132
- color: hsl(0, 0%, 0%);
133
- background-color: hsl(0, 0%, 100%);
134
- transition: color 350ms, background-color 350ms;
135
- }
136
-
137
- .layout.dark {
138
- color-scheme: dark;
139
- color: hsl(0, 0%, 80%);
140
- background-color: hsl(200, 4%, 14%);
106
+ color-scheme: var(--i-nil-doc-color-scheme);
107
+ color: var(--i-nil-doc-color);
108
+ background-color: var(--i-nil-doc-bg-color);
109
+ transition: color var(--i-nil-doc-transition-time),
110
+ background-color var(--i-nil-doc-transition-time);
141
111
  }
142
112
 
143
113
  .layout > .top {
144
- transition: border-bottom-colo 350ms;
145
- border-bottom-color: hsl(0, 2%, 70%);
146
- }
147
-
148
- .layout.dark > .top {
149
- border-bottom-color: hsl(0, 2%, 40%);
114
+ transition: border-bottom-color var(--i-nil-doc-transition-time);
115
+ border-bottom-color: var(--i-nil-doc-container-p);
150
116
  }
151
117
  </style>
@@ -5,17 +5,44 @@
5
5
  initControlsState,
6
6
  initOrientation
7
7
  } from "./context";
8
+ import Base from "../etc/Base.svelte";
8
9
  import { getTheme, initTheme } from "../context";
10
+ import Button from "./icons/Button.svelte";
11
+ import Position from "./icons/Position.svelte";
12
+ import ControlView from "./icons/ControlView.svelte";
9
13
  initParams();
10
14
  initDefaults();
11
15
  initControls();
12
- initControlsState();
16
+ const state = initControlsState();
13
17
  const columns = initOrientation();
14
18
  export let theme = void 0;
15
19
  const parentTheme = getTheme();
16
20
  const dark = initTheme();
17
21
  $:
18
22
  $dark = theme === void 0 ? $parentTheme : "dark" === theme;
23
+ const cyclePosition = () => {
24
+ switch ($state.position) {
25
+ case "hidden":
26
+ $state.position = "bottom";
27
+ break;
28
+ case "bottom":
29
+ $state.position = "right";
30
+ break;
31
+ case "right":
32
+ $state.position = "hidden";
33
+ break;
34
+ }
35
+ };
36
+ const cycleMode = () => {
37
+ switch ($state.mode) {
38
+ case "event":
39
+ $state.mode = "prop";
40
+ break;
41
+ case "prop":
42
+ $state.mode = "event";
43
+ break;
44
+ }
45
+ };
19
46
  </script>
20
47
 
21
48
  <!--
@@ -23,43 +50,58 @@ $:
23
50
  See [documentation](https://mono-doc.vercel.app/3-Components/2-Block) for more details.
24
51
  -->
25
52
 
26
- <div class:columns={$columns} class:dark={$dark}>
27
- <slot />
28
- </div>
53
+ <Base dark={$dark}>
54
+ <div class="block" class:columns={$columns} class:dark={$dark}>
55
+ <div class="buttons">
56
+ <Button scale on:click={cycleMode} title={$state.mode}>
57
+ <ControlView mode={$state.mode} />
58
+ </Button>
59
+ <Button scale on:click={cyclePosition} title={$state.position}>
60
+ <Position position={$state.position} />
61
+ </Button>
62
+ </div>
63
+ <slot />
64
+ </div>
65
+ </Base>
29
66
 
30
67
  <style>
31
- @import url("https://fonts.googleapis.com/css?family=Fira%20Code");
32
-
33
- div {
68
+ .block {
34
69
  display: grid;
35
- border-radius: 5px;
70
+ border-radius: 0.3125rem;
36
71
  grid-auto-rows: 1fr;
37
72
  grid-auto-columns: auto;
38
73
  grid-auto-flow: row;
39
74
 
40
- box-sizing: border-box;
41
- font-family: "Fira Code", "Courier New", Courier, monospace;
42
- padding: 13px 3px;
43
- gap: 3px;
75
+ min-width: 10rem;
76
+
77
+ padding: 1.75rem 0.2rem 0.5rem 0.2rem;
78
+ gap: 0.1875rem;
79
+ position: relative;
80
+ }
81
+
82
+ .buttons {
83
+ position: absolute;
84
+ width: calc(1.75rem * 2);
85
+ height: 1.75rem;
86
+ right: 1rem;
87
+ top: 0rem;
88
+ display: flex;
89
+ cursor: pointer;
44
90
  }
45
91
 
46
- div.columns {
92
+ .block.columns {
47
93
  grid-auto-rows: auto;
48
94
  grid-auto-columns: 1fr;
49
95
  grid-auto-flow: column;
50
96
  }
51
97
 
52
- /* colors */
53
- div {
54
- color-scheme: light;
55
- color: hsl(0, 0%, 0%);
56
- background-color: hsl(0, 2%, 70%);
57
- transition: color 350ms, background-color 350ms;
58
- }
59
-
60
- div.dark {
61
- color-scheme: dark;
62
- color: hsl(0, 0%, 80%);
63
- background-color: hsl(0, 2%, 40%);
98
+ .block {
99
+ color: var(--i-nil-doc-color);
100
+ color-scheme: var(--i-nil-doc-color-scheme);
101
+ background-color: var(--i-nil-doc-block-bg-color);
102
+ box-shadow: 0px 0px 5px 0px var(--i-nil-doc-block-outline-color);
103
+ outline: 1px solid var(--i-nil-doc-block-outline-color);
104
+ transition: color var(--i-nil-doc-transition-time),
105
+ background-color var(--i-nil-doc-transition-time);
64
106
  }
65
107
  </style>
@@ -1,16 +1,14 @@
1
1
  <script>import { getControls, getControlsState } from "./context";
2
2
  export let props = [];
3
3
  export let events = [];
4
- export let hide = false;
5
- export let position = void 0;
4
+ export let position = "bottom";
5
+ export let mode = "prop";
6
6
  const controls = getControls();
7
7
  $:
8
8
  $controls = { props, events };
9
9
  const state = getControlsState();
10
10
  $:
11
- $state.hide = hide;
12
- $:
13
- $state.position = position;
11
+ $state = { position, mode };
14
12
  </script>
15
13
 
16
14
  <!--
@@ -4,8 +4,8 @@ declare const __propDef: {
4
4
  props: {
5
5
  props?: Prop[] | undefined;
6
6
  events?: string[] | undefined;
7
- hide?: boolean | undefined;
8
- position?: undefined | "bottom" | "right";
7
+ position?: "bottom" | "right" | "hidden" | undefined;
8
+ mode?: "prop" | "event" | undefined;
9
9
  };
10
10
  events: {
11
11
  [evt: string]: CustomEvent<any>;
@@ -1,28 +1,12 @@
1
1
  <script>import { beforeUpdate } from "svelte";
2
- import { cquery } from "./action";
3
2
  import { getControls, getControlsState } from "./context";
4
- import { getTheme } from "../context";
5
3
  import Props from "./controls/props/Props.svelte";
6
4
  import Events from "./controls/events/Events.svelte";
7
5
  import { resolve } from "./utils";
8
6
  const controls = getControls();
9
7
  const controlsState = getControlsState();
10
- const dark = getTheme();
11
8
  $:
12
- hasProps = $controls.props.length > 0;
13
- $:
14
- hasEvents = $controls.events.length > 0;
15
- let cvisible = null;
16
- $:
17
- if (cvisible == null && hasProps) {
18
- cvisible = "props";
19
- } else if (cvisible == null && hasEvents) {
20
- cvisible = "events";
21
- } else if (!hasProps && !hasEvents) {
22
- cvisible = null;
23
- }
24
- $:
25
- expanded = !$controlsState.hide && cvisible != null;
9
+ expanded = $controlsState.position !== "hidden";
26
10
  export let defaults = void 0;
27
11
  export let noreset = false;
28
12
  export let scale = false;
@@ -33,7 +17,7 @@ let bound = {};
33
17
  const updateBound = (d) => bound = resolve(d ?? {}, {});
34
18
  $:
35
19
  updateBound(defaults);
36
- let handlers;
20
+ let handlers = {};
37
21
  </script>
38
22
 
39
23
  <!--
@@ -41,60 +25,50 @@ let handlers;
41
25
  See [documentation](https://mono-doc.vercel.app/3-Components/2-Block/1-Content/1-Instance) for more details.
42
26
  -->
43
27
 
44
- <div
45
- class="instance"
46
- class:scale
47
- class:cside={expanded && "right" === $controlsState.position}
48
- use:cquery={{
49
- class: "cside",
50
- min: 1000,
51
- w: true,
52
- enabled: expanded && $controlsState.position === undefined
53
- }}
54
- >
55
- {#if noreset}
56
- <div class="content scrollable" class:dark={$dark}>
28
+ <div class="instance" class:scale class:cside={expanded && "right" === $controlsState.position}>
29
+ <div class="content scrollable">
30
+ {#if noreset}
57
31
  <slot props={resolveArgs(defaults ?? {}, bound)} events={handlers} {key} />
58
- </div>
59
- {:else}
60
- {#key key}
61
- <div class="content scrollable" class:dark={$dark}>
32
+ {:else}
33
+ {#key key}
62
34
  <slot props={resolveArgs(defaults ?? {}, bound)} events={handlers} {key} />
63
- </div>
64
- {/key}
65
- {/if}
35
+ {/key}
36
+ {/if}
37
+ </div>
66
38
  {#if expanded}
67
- <div class="misc scrollable" class:dark={$dark}>
68
- <Props infos={$controls.props} bind:values={bound} visible={cvisible == "props"}>
69
- <div on:dblclick={() => hasEvents && (cvisible = "events")}>
39
+ <div class="misc scrollable">
40
+ <Props
41
+ infos={$controls.props}
42
+ bind:values={bound}
43
+ visible={$controlsState.mode === "prop"}
44
+ >
45
+ <div>
70
46
  <div>Properties</div>
71
47
  <div>Value</div>
72
48
  <div>Use</div>
73
49
  </div>
74
50
  </Props>
75
- <Events events={$controls.events} bind:handlers visible={cvisible == "events"}>
76
- {#if cvisible == "events"}
77
- <div on:dblclick={() => hasProps && (cvisible = "props")}>
78
- <div>Events</div>
79
- <div>Detail</div>
80
- </div>
81
- {/if}
51
+ <Events
52
+ events={$controls.events}
53
+ bind:handlers
54
+ visible={$controlsState.mode === "event"}
55
+ >
56
+ <div>
57
+ <div>Events</div>
58
+ <div>Detail</div>
59
+ </div>
82
60
  </Events>
83
61
  </div>
84
62
  {/if}
85
63
  </div>
86
64
 
87
65
  <style>
88
- div {
89
- box-sizing: border-box;
90
- }
91
-
92
66
  .instance {
93
67
  overflow: hidden;
94
68
  }
95
69
 
96
70
  .instance.scale {
97
- transition: transform 350ms;
71
+ transition: transform var(--i-nil-doc-transition-time);
98
72
  }
99
73
 
100
74
  .instance.scale:hover {
@@ -108,33 +82,33 @@ let handlers;
108
82
 
109
83
  .content {
110
84
  min-height: 100px;
111
- border-radius: 5px;
85
+ border-radius: 0.3125rem;
112
86
  }
113
87
 
114
88
  div:not(.cside) > .misc {
115
- border-bottom-left-radius: 5px;
116
- border-bottom-right-radius: 5px;
89
+ border-bottom-left-radius: 0.3125rem;
90
+ border-bottom-right-radius: 0.3125rem;
117
91
  user-select: none;
118
92
  }
119
93
 
120
94
  .cside > .misc {
121
- border-top-right-radius: 5px;
122
- border-bottom-right-radius: 5px;
95
+ border-top-right-radius: 0.3125rem;
96
+ border-bottom-right-radius: 0.3125rem;
123
97
  user-select: none;
124
98
  }
125
99
 
126
100
  .content,
127
101
  .misc {
128
- border-style: solid;
129
- border-width: 1px;
130
- padding: 2px;
102
+ border: 1px solid var(--i-nil-doc-block-outline-color);
131
103
  }
132
104
 
133
105
  /* scrollable */
134
106
  .scrollable {
135
107
  overflow: scroll;
136
- scrollbar-width: none; /* Firefox */
137
- -ms-overflow-style: none; /* IE and Edge */
108
+ /* Firefox */
109
+ scrollbar-width: none;
110
+ /* IE and Edge */
111
+ -ms-overflow-style: none;
138
112
  }
139
113
 
140
114
  .scrollable::-webkit-scrollbar {
@@ -142,16 +116,9 @@ let handlers;
142
116
  }
143
117
 
144
118
  /* colors */
145
- .content,
146
- .misc {
147
- border-color: hsl(0, 2%, 60%);
148
- background-color: hsl(0, 0%, 100%);
149
- transition: border-color 350ms, background-color 350ms;
150
- }
151
-
152
- .dark.content,
153
- .dark.misc {
154
- border-color: hsl(0, 2%, 40%);
155
- background-color: hsl(200, 4%, 14%);
119
+ .instance {
120
+ transition: background-color 350ms;
121
+ color: var(--i-nil-doc-color);
122
+ background-color: var(--i-nil-doc-bg-color);
156
123
  }
157
124
  </style>
@@ -7,8 +7,8 @@ export type Params = {
7
7
  values: Record<string, ValueType>;
8
8
  };
9
9
  export type ControlState = {
10
- hide: boolean;
11
- position?: "bottom" | "right";
10
+ position: "bottom" | "right" | "hidden";
11
+ mode: "prop" | "event";
12
12
  };
13
13
  export declare const initParams: () => Writable<Params[]>, getParams: () => Writable<Params[]>;
14
14
  type Controls = {
@@ -14,6 +14,7 @@ export const { init: initControls, get: getControls } = create(() => ({
14
14
  }));
15
15
  export const { init: initDefaults, get: getDefaults } = create(() => ({}));
16
16
  export const { init: initControlsState, get: getControlsState } = create(() => ({
17
- hide: false
17
+ position: "hidden",
18
+ mode: "prop"
18
19
  }));
19
20
  export const { init: initOrientation, get: getOrientation } = create(() => false);
@@ -45,13 +45,13 @@ $:
45
45
  <slot />
46
46
  {#each history as { count, detail, name }, i (i)}
47
47
  <div>
48
- <div>
48
+ <div class="name">
49
49
  <div>{name}</div>
50
- <div class="count">
51
- {#if count > 1}
50
+ {#if count > 1}
51
+ <div class="count">
52
52
  [{count.toString().padStart(2, "0")}]
53
- {/if}
54
- </div>
53
+ </div>
54
+ {/if}
55
55
  </div>
56
56
  <div>{detail}</div>
57
57
  </div>
@@ -60,6 +60,15 @@ $:
60
60
  {/if}
61
61
 
62
62
  <style>
63
+ .name {
64
+ padding: 0rem 0.5rem;
65
+ display: grid;
66
+ place-content: center;
67
+ grid-auto-flow: column;
68
+ grid-auto-columns: 1.875rem;
69
+ grid-template-columns: 1fr;
70
+ }
71
+
63
72
  .count {
64
73
  display: grid;
65
74
  place-items: center;
@@ -21,62 +21,37 @@ const dark = getTheme();
21
21
 
22
22
  <style>
23
23
  div {
24
- width: 100%;
25
- height: 330px;
26
- min-width: 500px;
27
- overflow: hidden;
28
24
  display: grid;
29
- grid-auto-rows: 30px;
30
- box-sizing: border-box;
31
- }
32
-
33
- div :global(*),
34
- div :global(*::before),
35
- div :global(*::after) {
36
- box-sizing: inherit;
25
+ overflow: hidden;
26
+ height: 22rem;
27
+ min-width: 31.25rem;
28
+ grid-auto-rows: 2rem;
37
29
  }
38
30
 
39
31
  div > :global(div) {
40
32
  display: grid;
41
- width: 100%;
42
- padding: 2px 0px;
43
- grid-template-columns: 1fr 2fr;
44
- }
45
-
46
- div > :global(div > div) {
47
- padding: 0px 10px;
33
+ grid-template-columns: 2fr 3fr;
34
+ align-items: center;
48
35
  }
49
36
 
50
37
  div > :global(div:first-child) {
51
- text-align: center;
52
- }
53
-
54
- div > :global(div:not(:first-child) > div:first-child) {
55
- display: grid;
56
- grid-template-columns: 1fr 30px;
38
+ font-weight: bold;
39
+ justify-items: center;
57
40
  }
58
41
 
59
42
  /* colors */
60
43
  div {
61
- --pri-color: hsl(0, 0%, 100%);
62
- --sec-color: hsl(210, 29%, 97%);
63
- --hover-color: hsl(210, 100%, 90%);
64
- }
65
-
66
- div.dark {
67
- --pri-color: hsl(213, 26%, 7%);
68
- --sec-color: hsl(213, 26%, 11%);
69
- --hover-color: hsl(203, 100%, 15%);
70
- }
71
-
72
- div {
73
- transition: background-color 150ms;
44
+ transition: background-color var(--i-nil-doc-transition-time);
74
45
  background-repeat: repeat;
75
- background-size: 100% 60px;
76
- background-image: linear-gradient(to bottom, var(--pri-color) 30px, var(--sec-color) 30px);
46
+ background-size: 100% 4rem;
47
+ background-image: linear-gradient(
48
+ to bottom,
49
+ var(--i-nil-doc-controls-p) 2rem,
50
+ var(--i-nil-doc-controls-s) 2rem
51
+ );
77
52
  }
78
53
 
79
54
  div > :global(div:nth-child(n + 2):hover) {
80
- background-color: var(--hover-color);
55
+ background-color: var(--i-nil-doc-controls-hover);
81
56
  }
82
57
  </style>