@brillout/docpress 0.1.8 → 0.1.10

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 (140) hide show
  1. package/{src/css/Inter-Var.ttf → dist/Inter-Var-IOAEQULN.ttf} +0 -0
  2. package/{src/components/Sponsors/companyLogos/ccoli.svg → dist/ccoli-CHW3TQKS.svg} +0 -0
  3. package/{src/icons/changelog.svg → dist/changelog-IPI5F42D.svg} +0 -0
  4. package/{src/navigation/navigation-fullscreen/chevron.svg → dist/chevron-K3WPYLOP.svg} +0 -0
  5. package/{src/components/features/chevron.svg → dist/chevron-R2IYJD62.svg} +0 -0
  6. package/dist/chunk-3NFN2KUH.js +1 -0
  7. package/dist/chunk-3NFN2KUH.js.map +1 -0
  8. package/dist/chunk-G2KXEHNF.js +56 -0
  9. package/dist/chunk-G2KXEHNF.js.map +1 -0
  10. package/dist/{cli/chunk-KZROB63P.js → chunk-G6OTZHVA.js} +2 -1
  11. package/dist/chunk-G6OTZHVA.js.map +1 -0
  12. package/dist/chunk-JKLALMFU.js +103 -0
  13. package/dist/chunk-JKLALMFU.js.map +1 -0
  14. package/dist/chunk-OEVBWUR6.js +92 -0
  15. package/dist/chunk-OEVBWUR6.js.map +1 -0
  16. package/dist/chunk-TTLAZ2T2.js +8 -0
  17. package/dist/chunk-TTLAZ2T2.js.map +1 -0
  18. package/dist/chunk-UCY72YQS.js +178 -0
  19. package/dist/chunk-UCY72YQS.js.map +1 -0
  20. package/dist/cli/index.d.ts +1 -0
  21. package/dist/cli/index.js +4 -2
  22. package/dist/cli/index.js.map +1 -0
  23. package/{src/navigation/navigation-fullscreen/close.svg → dist/close-IQXTDOHV.svg} +0 -0
  24. package/{src/utils/Emoji/compass.svg → dist/compass-2RWQU3E4.svg} +0 -0
  25. package/{src/components/Sponsors/companyLogos/contra.svg → dist/contra-WLZBOPBV.svg} +0 -0
  26. package/dist/{cli/devServer.js → devServer-UEJORYCC.js} +3 -1
  27. package/dist/devServer-UEJORYCC.js.map +1 -0
  28. package/{src/icons/discord.svg → dist/discord-JD33TUSF.svg} +0 -0
  29. package/{src/utils/Emoji/engine.png → dist/engine-6Q6VSCVA.png} +0 -0
  30. package/{src/icons/github.svg → dist/github-P5ZSKN2N.svg} +0 -0
  31. package/{src/icons/heart.svg → dist/heart-OINVKOXO.svg} +0 -0
  32. package/dist/index.css +121 -0
  33. package/dist/index.css.map +1 -0
  34. package/dist/index.d.ts +135 -0
  35. package/dist/index.js +488 -0
  36. package/dist/index.js.map +1 -0
  37. package/{src/components/Sponsors/label.svg → dist/label-MP75CTIA.svg} +0 -0
  38. package/{src/utils/Emoji/mechanical-arm.svg → dist/mechanical-arm-TR7IQQMG.svg} +0 -0
  39. package/{src/components/Sponsors/medalBronze.svg → dist/medalBronze-CO4CTUR4.svg} +0 -0
  40. package/{src/components/Sponsors/medalGold.svg → dist/medalGold-UP6A73FL.svg} +0 -0
  41. package/{src/components/Sponsors/medalSilver.svg → dist/medalSilver-FAPGGOBN.svg} +0 -0
  42. package/{src/components/Sponsors/companyLogos/mfqs.svg → dist/mfqs-2EAEE7N6.svg} +0 -0
  43. package/{src/utils/Emoji/road-fork.svg → dist/road-fork-3WZLW3HB.svg} +0 -0
  44. package/{src/utils/Emoji/shield.svg → dist/shield-CU45RG5C.svg} +0 -0
  45. package/{src → dist/src}/components/features/FeatureList.css +2 -7
  46. package/dist/src/components/features/FeatureList.css.map +1 -0
  47. package/dist/src/components/features/FeatureList.d.ts +13 -0
  48. package/dist/src/components/features/FeatureList.js +8 -0
  49. package/dist/src/components/features/FeatureList.js.map +1 -0
  50. package/dist/src/components/features/initFeatureList.d.ts +3 -0
  51. package/dist/src/components/features/initFeatureList.js +60 -0
  52. package/dist/src/components/features/initFeatureList.js.map +1 -0
  53. package/dist/src/renderer/_default.page.client.css +272 -0
  54. package/dist/src/renderer/_default.page.client.css.map +1 -0
  55. package/dist/src/renderer/_default.page.client.d.ts +1 -0
  56. package/dist/src/renderer/_default.page.client.js +182 -0
  57. package/dist/src/renderer/_default.page.client.js.map +1 -0
  58. package/dist/src/renderer/_default.page.server.css +312 -0
  59. package/dist/src/renderer/_default.page.server.css.map +1 -0
  60. package/dist/src/renderer/_default.page.server.d.ts +22 -0
  61. package/dist/src/renderer/_default.page.server.js +602 -0
  62. package/dist/src/renderer/_default.page.server.js.map +1 -0
  63. package/{src/icons/twitter.svg → dist/twitter-I7DXDN3J.svg} +0 -0
  64. package/{src/utils/Emoji/typescript.svg → dist/typescript-ALIPKLRM.svg} +0 -0
  65. package/package.json +25 -17
  66. package/vite.config.ts +10 -4
  67. package/cli.mjs +0 -2
  68. package/dist/cli/configFile.js +0 -6
  69. package/src/MobileHeader.tsx +0 -68
  70. package/src/PageLayout.css +0 -41
  71. package/src/PageLayout.tsx +0 -37
  72. package/src/algolia/DocSearch.css +0 -29
  73. package/src/algolia/DocSearch.ts +0 -37
  74. package/src/autoScrollNav.ts +0 -22
  75. package/src/components/CodeBlock.tsx +0 -22
  76. package/src/components/DocLink.tsx +0 -108
  77. package/src/components/EditPageNote.tsx +0 -18
  78. package/src/components/HorizontalLine.tsx +0 -20
  79. package/src/components/ImportMeta.tsx +0 -11
  80. package/src/components/Info.tsx +0 -12
  81. package/src/components/Link.tsx +0 -18
  82. package/src/components/Note.tsx +0 -31
  83. package/src/components/P.css +0 -8
  84. package/src/components/P.tsx +0 -8
  85. package/src/components/ReadingRecommendation.tsx +0 -53
  86. package/src/components/RepoLink.tsx +0 -24
  87. package/src/components/Sponsors/companyLogos/ccoli-logo.svg +0 -1
  88. package/src/components/Sponsors/companyLogos/ccoli-text.svg +0 -1
  89. package/src/components/Sponsors/label.draft.svg +0 -108
  90. package/src/components/Sponsors.tsx +0 -243
  91. package/src/components/features/FeatureList.tsx +0 -114
  92. package/src/components/features/initFeatureList.ts +0 -66
  93. package/src/components/index.ts +0 -13
  94. package/src/config/Config.ts +0 -30
  95. package/src/config/getConfig.ts +0 -18
  96. package/src/config/resolveConfig/resolveHeading.ts +0 -0
  97. package/src/config/resolvePageContext.ts +0 -157
  98. package/src/css/button.css +0 -7
  99. package/src/css/code/block.css +0 -36
  100. package/src/css/code/inline.css +0 -27
  101. package/src/css/code.css +0 -20
  102. package/src/css/colorize-on-hover.css +0 -29
  103. package/src/css/font.css +0 -19
  104. package/src/css/heading.css +0 -25
  105. package/src/css/index.css +0 -10
  106. package/src/css/link.css +0 -17
  107. package/src/css/note.css +0 -26
  108. package/src/css/reset.css +0 -12
  109. package/src/css/table.css +0 -14
  110. package/src/css/tooltip.css +0 -11
  111. package/src/headings.ts +0 -201
  112. package/src/index.ts +0 -3
  113. package/src/installSectionUrlHashs.ts +0 -50
  114. package/src/navigation/Navigation-highlight.css +0 -41
  115. package/src/navigation/Navigation-items.css +0 -122
  116. package/src/navigation/Navigation-layout.css +0 -118
  117. package/src/navigation/Navigation.client.old.ts +0 -303
  118. package/src/navigation/Navigation.client.ts +0 -19
  119. package/src/navigation/Navigation.css +0 -12
  120. package/src/navigation/Navigation.tsx +0 -229
  121. package/src/navigation/NavigationHeader.tsx +0 -97
  122. package/src/navigation/navigation-fullscreen/NavigationFullscreenButton.css +0 -32
  123. package/src/navigation/navigation-fullscreen/NavigationFullscreenButton.tsx +0 -44
  124. package/src/navigation/navigation-fullscreen/initNavigationFullscreen.ts +0 -115
  125. package/src/parseEmojis.ts +0 -33
  126. package/src/renderer/_default.page.client.ts +0 -7
  127. package/src/renderer/_default.page.server.tsx +0 -69
  128. package/src/renderer/usePageContext.tsx +0 -25
  129. package/src/types.ts +0 -2
  130. package/src/utils/Emoji/Emoji.ts +0 -216
  131. package/src/utils/Emoji/assets.ts +0 -9
  132. package/src/utils/Emoji/index.ts +0 -1
  133. package/src/utils/Emoji/mountain.svg +0 -1
  134. package/src/utils/assert.ts +0 -39
  135. package/src/utils/determineSectionUrlHash.ts +0 -35
  136. package/src/utils/filter.ts +0 -12
  137. package/src/utils/index.ts +0 -6
  138. package/src/utils/isBrowser.ts +0 -5
  139. package/src/utils/jsxToTextContent.ts +0 -11
  140. package/src/utils/objectAssign.ts +0 -9
package/src/headings.ts DELETED
@@ -1,201 +0,0 @@
1
- import React from 'react'
2
- import { assert } from './utils'
3
- import { Emoji, EmojiName } from './utils/Emoji'
4
-
5
- export { getHeadings }
6
- export { parseTitle }
7
-
8
- export type Heading = Omit<HeadingDefinition, 'title' | 'titleInNav'> & {
9
- title: JSX.Element
10
- titleInNav: JSX.Element
11
- parentHeadings: Heading[]
12
- // Not sure why this is needed
13
- isListTitle?: true
14
- sectionTitles?: string[]
15
- }
16
- export type HeadingWithoutLink = {
17
- url: string
18
- title: string | JSX.Element
19
- }
20
- export type HeadingDefinition = HeadingBase &
21
- (
22
- | ({ level: 1; titleEmoji: EmojiName } & HeadingAbstract)
23
- | ({ level: 4 } & HeadingAbstract)
24
- | {
25
- level: 2
26
- isListTitle?: true
27
- sectionTitles?: string[]
28
- url: string
29
- }
30
- | {
31
- level: 3
32
- url: string
33
- }
34
- )
35
- type HeadingBase = {
36
- title: string
37
- level: number
38
- url?: string
39
- titleDocument?: string
40
- titleInNav?: string
41
- // titleSize?: string
42
- }
43
- type HeadingAbstract = {
44
- url?: undefined
45
- titleDocument?: undefined
46
- titleInNav?: undefined
47
- }
48
-
49
- function getHeadings(config: { headings: HeadingDefinition[]; headingsWithoutLink: HeadingWithoutLink[] }): {
50
- headings: Heading[]
51
- headingsWithoutLink: HeadingWithoutLink[]
52
- } {
53
- const headingsWithoutParent: Omit<Heading, 'parentHeadings'>[] = config.headings.map((heading: HeadingDefinition) => {
54
- const titleProcessed: JSX.Element = parseTitle(heading.title)
55
-
56
- const titleInNav = heading.titleInNav || heading.title
57
- let titleInNavProcessed: JSX.Element
58
- if ('isListTitle' in heading) {
59
- assert(heading.isListTitle === true)
60
- let titleParsed: JSX.Element = parseTitle(titleInNav)
61
- // if (heading.titleSize) {
62
- // titleParsed = React.createElement('span', { style: { fontSize: heading.titleSize } }, titleParsed)
63
- // }
64
- titleInNavProcessed = React.createElement(React.Fragment, {}, getListPrefix(), titleParsed)
65
- } else {
66
- titleInNavProcessed = parseTitle(titleInNav)
67
- }
68
- if ('titleEmoji' in heading) {
69
- assert(heading.titleEmoji)
70
- titleInNavProcessed = withEmoji(heading.titleEmoji, titleInNavProcessed)
71
- }
72
-
73
- const headingProcessed: Omit<Heading, 'parentHeadings'> = {
74
- ...heading,
75
- title: titleProcessed,
76
- titleInNav: titleInNavProcessed
77
- }
78
- return headingProcessed
79
- })
80
-
81
- const headings: Heading[] = []
82
- headingsWithoutParent.forEach((heading) => {
83
- const parentHeadings = findParentHeadings(heading, headings)
84
- headings.push({ ...heading, parentHeadings })
85
- })
86
-
87
- const headingsWithoutLink = config.headingsWithoutLink.map((headingsWithoutLink) => {
88
- const { url, title } = headingsWithoutLink
89
- assert(
90
- headings.find((heading) => heading.url === url) === undefined,
91
- `remove ${headingsWithoutLink.url} from headingsWithoutLink`
92
- )
93
- const titleProcessed = typeof title === 'string' ? parseTitle(title) : title
94
- return {
95
- ...headingsWithoutLink,
96
- title: titleProcessed
97
- }
98
- })
99
-
100
- assertHeadingsUrl([...headings, ...headingsWithoutLink])
101
- return { headings, headingsWithoutLink }
102
- }
103
-
104
- function findParentHeadings(heading: Omit<Heading, 'parentHeadings'>, headings: Heading[]) {
105
- const parentHeadings: Heading[] = []
106
- let levelCurrent = heading.level
107
- let listTitleParentFound = false
108
- headings
109
- .slice()
110
- .reverse()
111
- .forEach((parentCandidate) => {
112
- let isListTitleParent = false
113
- if (
114
- !listTitleParentFound &&
115
- levelCurrent === heading.level &&
116
- parentCandidate.level === heading.level &&
117
- !parentCandidate.isListTitle &&
118
- heading.isListTitle
119
- ) {
120
- isListTitleParent = true
121
- listTitleParentFound = true
122
- }
123
-
124
- const isParent = parentCandidate.level < levelCurrent
125
-
126
- if (isParent || isListTitleParent) {
127
- levelCurrent = parentCandidate.level
128
- parentHeadings.push(parentCandidate)
129
- }
130
- })
131
- return parentHeadings
132
- }
133
-
134
- function assertHeadingsUrl(headings: { url?: string }[]) {
135
- const urls: Record<string, true> = {}
136
- headings.forEach((heading) => {
137
- if (heading.url) {
138
- const { url } = heading
139
- assert(url.startsWith('/'))
140
- assert(!urls[url], { url })
141
- urls[url] = true
142
- }
143
- })
144
- }
145
-
146
- function getListPrefix() {
147
- const nonBreakingSpace = String.fromCodePoint(0x00a0)
148
- const bulletPoint = String.fromCodePoint(0x2022)
149
- return nonBreakingSpace + bulletPoint + nonBreakingSpace
150
- }
151
-
152
- function parseTitle(title: string): JSX.Element {
153
- type Part = { nodeType: 'text' | 'code'; content: string }
154
- const parts: Part[] = []
155
- let current: Part | undefined
156
- title.split('').forEach((letter) => {
157
- if (letter === '`') {
158
- if (current?.nodeType === 'code') {
159
- // </code>
160
- parts.push(current)
161
- current = undefined
162
- } else {
163
- // <code>
164
- if (current) {
165
- parts.push(current)
166
- }
167
- current = { nodeType: 'code', content: '' }
168
- }
169
- } else {
170
- if (!current) {
171
- current = { nodeType: 'text', content: '' }
172
- }
173
- current.content += letter
174
- }
175
- })
176
- if (current) {
177
- parts.push(current)
178
- }
179
-
180
- const titleJsx = React.createElement(
181
- React.Fragment,
182
- {},
183
- ...parts.map((part, i) =>
184
- React.createElement(part.nodeType === 'code' ? 'code' : React.Fragment, { key: i }, part.content)
185
- )
186
- )
187
-
188
- return titleJsx
189
- }
190
-
191
- function withEmoji(name: EmojiName, title: string | JSX.Element): JSX.Element {
192
- const style = { fontSize: '1.4em' }
193
- //return React.createElement(React.Fragment, null, Emoji({ name, style }), ' ', title)
194
- return React.createElement(
195
- 'span',
196
- { style },
197
- Emoji({ name }),
198
- ' ',
199
- React.createElement('span', { style: { fontSize: '1rem' } }, title)
200
- )
201
- }
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './components'
2
- export * from './utils'
3
- export * from './types'
@@ -1,50 +0,0 @@
1
- import { assert } from './utils'
2
-
3
- installSectionUrlHashs()
4
- /* Let browser restore previous scroll
5
- jumpToSection()
6
- */
7
-
8
- function installSectionUrlHashs() {
9
- const pageContainer = document.querySelector('.doc-page #page-container')
10
- if (!pageContainer) {
11
- assert(window.location.pathname === '/')
12
- return
13
- }
14
- const navigationEl = document.getElementById('navigation-content')
15
- assert(navigationEl)
16
- const docSections = Array.from(document.querySelectorAll('h2'))
17
- docSections.forEach((docSection) => {
18
- const docTitle = docSection.textContent
19
- assert(docTitle)
20
- assert(docSection.id, { docSection })
21
- const urlHash = '#' + docSection.id
22
- assertNavLink(navigationEl, urlHash)
23
- docSection.onclick = () => {
24
- window.location.hash = urlHash
25
- // The browser doesn't jump if hash doesn't change
26
- jumpToSection()
27
- }
28
- })
29
- }
30
-
31
- function assertNavLink(navigationEl: HTMLElement, urlHash: string) {
32
- const parentNavLinkMatch = Array.from(navigationEl.querySelectorAll(`a[href="${window.location.pathname}"]`))
33
- assert(parentNavLinkMatch.length <= 1)
34
- if (parentNavLinkMatch.length === 0) return
35
- const navLinks: HTMLElement[] = Array.from(navigationEl.querySelectorAll(`a[href="${urlHash}"]`))
36
- assert(navLinks.length === 1, { urlHash })
37
- }
38
-
39
- function jumpToSection() {
40
- const { hash } = window.location
41
- if (hash === '' || hash === '#') {
42
- return
43
- }
44
- assert(hash.startsWith('#'))
45
- const target = document.getElementById(hash.slice(1))
46
- if (!target) {
47
- return
48
- }
49
- target.scrollIntoView()
50
- }
@@ -1,41 +0,0 @@
1
- /*
2
- .nav-item {
3
- border-top: 1px solid transparent;
4
- }
5
- .nav-item.is-active {
6
- border-color: #eaeaea;
7
- }
8
- .nav-item[is-active] {
9
- background-color: attr(is-active)
10
- }
11
- */
12
-
13
- /*
14
- #navigation-container:not(:hover) ::-webkit-scrollbar {
15
- display: none;
16
- }
17
- #navigation-container ::-webkit-scrollbar-thumb {
18
- opacity: 0;
19
- }
20
- #navigation-container ::-webkit-scrollbar-track {
21
- opacity: 0;
22
- }
23
- */
24
-
25
- /*
26
- .nav-tree:not(.expanded) > .nav-tree {
27
- edisplay: none;
28
- background:red;
29
- }
30
- */
31
- /*
32
- .nav-tree.expanded,
33
- .nav-tree.expanded > .nav-tree {
34
- display: inherit;
35
- }
36
- .nav-tree.expanded,
37
- .nav-tree.expanded > .nav-tree {
38
- display: inherit;
39
- background:red;
40
- }
41
- */
@@ -1,122 +0,0 @@
1
- .nav-item {
2
- display: block;
3
- white-space: nowrap;
4
- overflow-x: hidden;
5
- --padding-left-global: 9px;
6
- --padding-left-additional: 0px;
7
- }
8
- .nav-item code {
9
- font-size: 0.9em;
10
- }
11
- .nav-item-h1 + .nav-item-h4 {
12
- margin-top: -2px;
13
- }
14
- .nav-item-h4 {
15
- margin-top: 14px;
16
- margin-bottom: -1px;
17
- color: #999;
18
- font-size: 12px;
19
- font-weight: 400;
20
- letter-spacing: 0.15ch;
21
- padding-left: var(--padding-left-global);
22
- padding-right: 4px;
23
- text-decoration: none;
24
- }
25
- .nav-column:first-of-type > .nav-h1-group:first-of-type > .nav-item-h1:first-of-type {
26
- margin-top: 20px;
27
- }
28
- .nav-item-h1 {
29
- margin-top: 30px;
30
- font-size: 15.4px;
31
- text-transform: uppercase;
32
- font-weight: 600;
33
- letter-spacing: 0.15ch;
34
- color: var(--color-text);
35
- padding: 12px 0;
36
- padding-left: calc(var(--padding-left-global) - 2px);
37
- padding-right: 4px;
38
- text-decoration: none;
39
- }
40
- .nav-item-h2 {
41
- text-decoration: none;
42
- font-size: 14.4px;
43
- font-weight: 400;
44
- letter-spacing: 0.15ch;
45
- color: var(--color-text);
46
- padding-left: var(--padding-left-global);
47
- padding-right: 0;
48
- --padding: 4px;
49
- padding-top: var(--padding);
50
- padding-bottom: var(--padding);
51
- }
52
- .nav-item-h3 {
53
- font-size: 12px;
54
- font-weight: 400;
55
- letter-spacing: 0.15ch;
56
- color: var(--color-text);
57
- text-decoration: none;
58
- --padding: 5px;
59
-
60
- background-color: #f9f9f9;
61
- padding: var(--padding) 0;
62
- padding-left: calc(var(--padding-left-global) + var(--padding-left-additional));
63
- }
64
- html.navigation-fullscreen .nav-item-h3 {
65
- border-right: 4px solid #eee;
66
- }
67
- .nav-item-h3.nav-item-first-of-its-kind {
68
- padding-top: calc(var(--padding) * 1.6);
69
- }
70
- .nav-item-h3.nav-item-last-of-its-kind {
71
- padding-bottom: calc(var(--padding) * 2);
72
- }
73
- .nav-item-h2,
74
- .nav-item-h3 {
75
- position: relative;
76
- }
77
- /*
78
- .nav-item-h2.is-active .nav-item-text{
79
- background-color: var(--background-color);
80
- }
81
- */
82
- .nav-item-h2.is-active {
83
- background-color: var(--background-color);
84
- }
85
- .nav-item-h3.is-active:before {
86
- display: block;
87
- content: '';
88
- position: absolute;
89
- width: 4px;
90
- left: 0;
91
- top: 0;
92
- height: 100%;
93
- background-color: var(--background-color);
94
- z-index: 10;
95
- }
96
- .nav-item-h3.is-active-last:after {
97
- display: block;
98
- content: '';
99
- position: absolute;
100
- height: 4px;
101
- left: 0;
102
- bottom: 0;
103
- width: 100%;
104
- background-color: var(--background-color);
105
- z-index: 10;
106
- border-bottom-left-radius: 5px;
107
- }
108
- html.navigation-fullscreen .nav-item {
109
- --expend-border-radius: 5px;
110
- }
111
- .nav-item.is-active-first {
112
- border-top-left-radius: 5px;
113
- border-top-right-radius: var(--expend-border-radius);
114
- }
115
- .nav-item.is-active-last,
116
- .nav-item.is-active-last:before {
117
- border-bottom-left-radius: 5px;
118
- border-bottom-right-radius: var(--expend-border-radius);
119
- }
120
- .nav-item-h3.nav-item-parent-is-list-heading {
121
- --padding-left-additional: 21px;
122
- }
@@ -1,118 +0,0 @@
1
- :root {
2
- --mobile-header-height: 60px;
3
- --navigation-min-height: 300px;
4
- --navigation-max-height: 350px;
5
- }
6
- #navigation-wrapper {
7
- min-width: var(--navigation-min-height);
8
- }
9
- .doc-page #navigation-wrapper {
10
- max-width: var(--navigation-max-height);
11
- }
12
- .landing-page #navigation-wrapper {
13
- /* prettier-ignore */
14
- max-width: min(var(--navigation-max-height), max(var(--navigation-min-height), calc(var(--navigation-min-height) + 100vw - 1240px)));
15
- }
16
- #navigation-container {
17
- /* `position: fixed` doesn't inherit the parent's width */
18
- position: sticky;
19
- overflow-y: auto;
20
- overscroll-behavior: contain;
21
- border-right: 1px solid #eee;
22
- }
23
- #navigation-mask {
24
- position: fixed;
25
- width: 100vw;
26
- height: 100vh;
27
- top: 0;
28
- left: 0;
29
- z-index: 2;
30
- }
31
- /* `1140px` is the breaking point that preserves the width of code blocks. */
32
- /* BEFORE EDITING THIS: also change the `1139px` value below */
33
- @media screen and (min-width: 1140px) {
34
- #mobile-header {
35
- display: none !important;
36
- }
37
- #navigation-container {
38
- height: 100vh;
39
- top: 0;
40
- }
41
- #navigation-mask {
42
- display: none;
43
- }
44
- }
45
- #navigation-container {
46
- transition: transform 0.25s ease;
47
- background: white;
48
- z-index: 3;
49
- }
50
- #page-wrapper {
51
- margin-left: calc(-1 * var(--navigation-fullscreen-button-width));
52
- }
53
- @media screen and (max-width: 1139px) {
54
- #navigation-header-logo,
55
- #docsearch {
56
- display: none !important;
57
- }
58
- #navigation-wrapper {
59
- min-width: 0px !important;
60
- max-width: 0px !important;
61
- }
62
- #navigation-fullscreen-button {
63
- display: none;
64
- }
65
- #page-wrapper {
66
- margin-left: 0 !important;
67
- }
68
- #navigation-container {
69
- --width: min(100vw, 350px);
70
- width: var(--width);
71
- left: 0;
72
- height: calc(100vh - var(--mobile-header-height));
73
- top: var(--mobile-header-height);
74
- padding-top: 20px;
75
- /* `position: sticky` doesn't seem to work on mobile */
76
- position: fixed;
77
- }
78
- body:not(.show-menu) #navigation-container {
79
- transform: translateX(calc(-1 * var(--width)));
80
- }
81
- body:not(.show-menu) #navigation-mask {
82
- display: none;
83
- }
84
- #mobile-header {
85
- display: inherit;
86
- }
87
- .doc-page h2 {
88
- --padding-top: calc(var(--mobile-header-height) + 12px) !important;
89
- }
90
- }
91
-
92
- html.navigation-fullscreen #navigation-container {
93
- width: 100vw;
94
- height: 100vh;
95
- overflow-y: scroll;
96
- position: fixed;
97
- top: 0;
98
- left: 0;
99
- background-color: white;
100
- }
101
- html.navigation-fullscreen #navigation-header {
102
- display: none !important;
103
- }
104
- html.navigation-fullscreen #navigation-content {
105
- display: flex;
106
- margin: auto; /* A `max-width` is set by src/navigation/navigation-fullscreen/initNavigationFullscreen.ts */
107
- }
108
- html.navigation-fullscreen #navigation-content > .nav-column {
109
- flex-grow: 1;
110
- max-width: 350px;
111
- }
112
- html.navigation-fullscreen .nav-column > .nav-h1-group:first-child > .nav-item-h1:first-child {
113
- margin-top: 0px;
114
- }
115
- html.navigation-fullscreen {
116
- /* disable scroll of main view */
117
- overflow: hidden !important;
118
- }