@brillout/docpress 0.10.10 → 0.10.11

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 (2) hide show
  1. package/Layout.tsx +29 -18
  2. package/package.json +1 -1
package/Layout.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  export { Layout }
2
2
  export { MenuToggle }
3
3
  export { containerQueryMobileLayout }
4
- export { containerQueryMobileMenu }
4
+ export { containerQueryMobileNav as containerQueryMobileMenu }
5
5
  export { navLeftWidthMin }
6
6
  export { navLeftWidthMax }
7
7
  export { unexpandNav }
@@ -27,10 +27,11 @@ import { getRepoHref } from './components'
27
27
  const blockMargin = 3
28
28
  const mainViewPadding = 20
29
29
  const mainViewWidthMax = 800
30
- const navLeftWidthMax = 370
31
- const navLeftWidthMin = 300
32
30
  const mainViewMax = (mainViewWidthMax + mainViewPadding * 2) as 840 // 840 = 800 + 20 * 2
33
- const containerQueryMobileMenu = 1000
31
+ const navLeftWidthMin = 300
32
+ const navLeftWidthMax = 370
33
+ const containerQuerySmallNav = 550
34
+ const containerQueryMobileNav = 1000
34
35
  const containerQueryMobileLayout = (mainViewMax + navLeftWidthMin) as 1143 // 1143 = 840 + 300
35
36
  const containerQueryExtraSpace = (mainViewMax + navLeftWidthMax + blockMargin) as 1213 // 1213 = 840 + 370 + 3
36
37
 
@@ -346,10 +347,10 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
346
347
  justifyContent: 'center',
347
348
  }}
348
349
  >
349
- <NavLogo className="mobile-grow-half" />
350
+ <NavLogo className="grow-half" />
350
351
  {!isNavLeft && <div className="desktop-grow" />}
351
- <SearchLink className="mobile-grow-half" style={menuLinkStyle} />
352
- <MenuToggleMain className="mobile-grow-full" style={menuLinkStyle} />
352
+ <SearchLink className="grow-half" style={menuLinkStyle} />
353
+ <MenuToggleMain className="grow-full" style={menuLinkStyle} />
353
354
  {navSecondaryContent}
354
355
  </div>
355
356
  </div>
@@ -359,21 +360,32 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
359
360
 
360
361
  function getStyle() {
361
362
  let style = css`
362
- @container container-nav-head (max-width: 550px) {
363
- .mobile-grow-full {
363
+ @container container-nav-head (max-width: ${containerQuerySmallNav}px) {
364
+ .grow-full {
364
365
  flex-grow: 1;
365
366
  }
366
- .mobile-grow-half {
367
+ .grow-half {
367
368
  flex-grow: 0.5;
368
369
  }
369
370
  .nav-head-content {
370
371
  --padding-side: 0px;
371
372
  }
372
373
  .nav-logo {
374
+ justify-content: flex-start;
373
375
  padding-left: 15px;
374
376
  margin-left: -10px;
375
377
  }
376
378
  }
379
+ @container container-viewport (max-width: ${containerQuerySmallNav}px) {
380
+ .grow-half {
381
+ flex-grow: 1 !important;
382
+ }
383
+ .nav-logo {
384
+ justify-content: center;
385
+ padding: 0;
386
+ margin: 0;
387
+ }
388
+ }
377
389
  @container container-nav-head (min-width: 501px) {
378
390
  .nav-head-content {
379
391
  --padding-side: 24px;
@@ -382,12 +394,12 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
382
394
  padding: 0 var(--padding-side);
383
395
  }
384
396
  }
385
- @container container-nav-head (min-width: ${containerQueryMobileMenu + 100}px) {
397
+ @container container-nav-head (min-width: ${containerQueryMobileNav + 100}px) {
386
398
  .nav-head-content {
387
399
  --padding-side: 35px;
388
400
  }
389
401
  }
390
- @media(max-width: ${containerQueryMobileMenu}px) {
402
+ @media(max-width: ${containerQueryMobileNav}px) {
391
403
  .hide-on-shrink {
392
404
  display: none !important;
393
405
  }
@@ -395,7 +407,7 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
395
407
  `
396
408
  if (navMaxWidth) {
397
409
  style += css`
398
- @media(min-width: ${containerQueryMobileMenu + 1}px) {
410
+ @media(min-width: ${containerQueryMobileNav + 1}px) {
399
411
  .desktop-grow {
400
412
  flex-grow: 1;
401
413
  }
@@ -404,7 +416,7 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
404
416
  }
405
417
  if (isLandingPage && !navMaxWidth)
406
418
  style += css`
407
- @media(min-width: ${containerQueryMobileMenu + 1}px) {
419
+ @media(min-width: ${containerQueryMobileNav + 1}px) {
408
420
  .nav-logo {
409
421
  display: none !important;
410
422
  }
@@ -477,9 +489,8 @@ function NavLogo({ className }: { className: string }) {
477
489
  style={{
478
490
  display: 'flex',
479
491
  alignItems: 'center',
480
- color: 'inherit',
481
492
  height: '100%',
482
- justifyContent: 'flex-start',
493
+ color: 'inherit',
483
494
  }}
484
495
  href="/"
485
496
  >
@@ -525,12 +536,12 @@ function MenuToggleMain(props: PropsDiv) {
525
536
  <MenuIcon /> Menu
526
537
  </span>
527
538
  <Style>{css`
528
- @media(max-width: ${containerQueryMobileMenu}px) {
539
+ @media(max-width: ${containerQueryMobileNav}px) {
529
540
  .text-docs {
530
541
  display: none !important;
531
542
  }
532
543
  }
533
- @media(min-width: ${containerQueryMobileMenu + 1}px) {
544
+ @media(min-width: ${containerQueryMobileNav + 1}px) {
534
545
  .text-menu {
535
546
  display: none;
536
547
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.10.10",
3
+ "version": "0.10.11",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@brillout/picocolors": "^1.0.10",