@brillout/docpress 0.15.13-commit-39924f0 → 0.15.13-commit-a35cb87
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/Layout.tsx +14 -9
- package/code-blocks/components/Pre.tsx +1 -1
- package/css/tooltip.css +3 -2
- package/package.json +1 -1
package/Layout.tsx
CHANGED
|
@@ -7,7 +7,9 @@ export { navLeftWidthMax }
|
|
|
7
7
|
export { unexpandNav }
|
|
8
8
|
export { blockMargin }
|
|
9
9
|
|
|
10
|
-
// -
|
|
10
|
+
// - @media VS @container
|
|
11
|
+
// - Using `@container container-viewport` instead of @media would be interesting because @media doesn't consider the scrollbar width.
|
|
12
|
+
// - But we still use @media because using @container is complicated(/buggy?) to use inside <MenuModal> because of `position: fixed`.
|
|
11
13
|
// - We use --padding-side because we cannot set a fixed max-width on the <NavHead> container .nav-head-content — DocPress doesn't know how many extra <NavHead> elements the user adds using the +docpress.topNavigation setting.
|
|
12
14
|
|
|
13
15
|
import React from 'react'
|
|
@@ -39,7 +41,7 @@ const mainViewWidthMax = (mainViewWidthMaxInner + mainViewPadding * 2) as 840 //
|
|
|
39
41
|
const navLeftWidthMin = 300
|
|
40
42
|
const navLeftWidthMax = 370
|
|
41
43
|
const viewMobile = 450
|
|
42
|
-
const viewTablet =
|
|
44
|
+
const viewTablet = 1016
|
|
43
45
|
const viewDesktop = (mainViewWidthMax + navLeftWidthMin) as 1140 // 1140 = 840 + 300
|
|
44
46
|
const viewDesktopLarge = (mainViewWidthMax + navLeftWidthMax + blockMargin) as 1213 // 1213 = 840 + 370 + 3
|
|
45
47
|
|
|
@@ -341,7 +343,7 @@ function getStyleNav() {
|
|
|
341
343
|
|
|
342
344
|
// Mobile
|
|
343
345
|
style += css`
|
|
344
|
-
@
|
|
346
|
+
@media(max-width: ${viewMobile}px) {
|
|
345
347
|
.nav-head:not(.is-nav-left) {
|
|
346
348
|
.nav-head-menu-toggle {
|
|
347
349
|
justify-content: flex-end !important;
|
|
@@ -358,7 +360,7 @@ function getStyleNav() {
|
|
|
358
360
|
|
|
359
361
|
// Mobile + tablet
|
|
360
362
|
style += css`
|
|
361
|
-
@
|
|
363
|
+
@media(max-width: ${viewTablet}px) {
|
|
362
364
|
.nav-head:not(.is-nav-left) {
|
|
363
365
|
.nav-head-secondary {
|
|
364
366
|
display: none !important;
|
|
@@ -368,7 +370,7 @@ function getStyleNav() {
|
|
|
368
370
|
|
|
369
371
|
// Tablet
|
|
370
372
|
style += css`
|
|
371
|
-
@
|
|
373
|
+
@media(max-width: ${viewTablet}px) and (min-width: ${viewMobile + 1}px) {
|
|
372
374
|
.nav-head:not(.is-nav-left) {
|
|
373
375
|
.nav-head-content {
|
|
374
376
|
--icon-text-padding: 8px;
|
|
@@ -379,7 +381,7 @@ function getStyleNav() {
|
|
|
379
381
|
|
|
380
382
|
// Desktop small + desktop
|
|
381
383
|
style += css`
|
|
382
|
-
@
|
|
384
|
+
@media(min-width: ${viewTablet + 1}px) {
|
|
383
385
|
.nav-head:not(.is-nav-left) {
|
|
384
386
|
.nav-head-content {
|
|
385
387
|
--icon-text-padding: min(8px, 0.5cqw);
|
|
@@ -547,7 +549,10 @@ function NavHeadLogo({ isNavLeft }: { isNavLeft?: true }) {
|
|
|
547
549
|
paddingLeft: 'var(--main-view-padding)',
|
|
548
550
|
paddingRight: 'var(--padding-side)',
|
|
549
551
|
}
|
|
550
|
-
: {
|
|
552
|
+
: {
|
|
553
|
+
paddingLeft: 15,
|
|
554
|
+
marginLeft: -10,
|
|
555
|
+
}),
|
|
551
556
|
}}
|
|
552
557
|
href="/"
|
|
553
558
|
onContextMenu={!navLogo ? undefined : onContextMenu}
|
|
@@ -578,12 +583,12 @@ function MenuToggleMain(props: PropsDiv) {
|
|
|
578
583
|
<MenuIcon /> Menu
|
|
579
584
|
</span>
|
|
580
585
|
<Style>{css`
|
|
581
|
-
@
|
|
586
|
+
@media(max-width: ${viewTablet}px) {
|
|
582
587
|
.text-docs, .caret-icon {
|
|
583
588
|
display: none !important;
|
|
584
589
|
}
|
|
585
590
|
}
|
|
586
|
-
@
|
|
591
|
+
@media(min-width: ${viewTablet + 1}px) {
|
|
587
592
|
.text-menu {
|
|
588
593
|
display: none;
|
|
589
594
|
}
|
package/css/tooltip.css
CHANGED
|
@@ -37,9 +37,10 @@
|
|
|
37
37
|
top: 100%;
|
|
38
38
|
margin-top: 5px;
|
|
39
39
|
}
|
|
40
|
-
/* Show above */
|
|
41
|
-
[aria-label][data-label-position='top']::before {
|
|
40
|
+
/* Show above-left */
|
|
41
|
+
[aria-label][data-label-position='top-left']::before {
|
|
42
42
|
bottom: 100%;
|
|
43
43
|
margin-bottom: 7px;
|
|
44
|
+
transform: translate(calc(-100% + 25px), 0);
|
|
44
45
|
}
|
|
45
46
|
}
|