@brillout/docpress 0.12.6 → 0.13.0

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 CHANGED
@@ -342,7 +342,7 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
342
342
  maxWidth: navMaxWidth,
343
343
  margin: 'auto',
344
344
  height: 'var(--nav-head-height)',
345
- fontSize: `min(16.96px, ${isProjectNameShort(projectName) ? '4.8cqw' : '4.5cqw'})`,
345
+ fontSize: `min(15.2px, ${isProjectNameShort(projectName) ? '4.8cqw' : '4.5cqw'})`,
346
346
  color: '#666',
347
347
  ['--icon-text-padding']: 'min(8px, 1.8cqw)',
348
348
  display: 'flex',
@@ -398,7 +398,7 @@ function NavHead({ isNavLeft }: { isNavLeft?: true }) {
398
398
  }
399
399
  @container container-nav-head (min-width: ${containerQueryMobileNav + 150}px) {
400
400
  .nav-head-content {
401
- --padding-side: 35px;
401
+ --padding-side: 25px;
402
402
  }
403
403
  }
404
404
  @media(max-width: ${containerQueryMobileNav}px) {
@@ -539,7 +539,7 @@ function MenuToggleMain(props: PropsDiv) {
539
539
  </span>
540
540
  <Style>{css`
541
541
  @media(max-width: ${containerQueryMobileNav}px) {
542
- .text-docs {
542
+ .text-docs, .caret-icon {
543
543
  display: none !important;
544
544
  }
545
545
  }
@@ -586,6 +586,14 @@ function MenuToggle({ menuId, ...props }: PropsDiv & { menuId: number }) {
586
586
  >
587
587
  <Style>{getAnimation()}</Style>
588
588
  {props.children}
589
+ <CaretIcon
590
+ style={{
591
+ width: 11,
592
+ marginLeft: 10,
593
+ flexShrink: 0,
594
+ color: '#888',
595
+ }}
596
+ />
589
597
  </div>
590
598
  )
591
599
 
@@ -614,15 +622,53 @@ function MenuToggle({ menuId, ...props }: PropsDiv & { menuId: number }) {
614
622
  transition: top 0.4s ease !important;
615
623
  z-index: -1;
616
624
  }
625
+ & .caret-icon-left,
626
+ & .caret-icon-right {
627
+ transition: transform .4s cubic-bezier(.4,0, .2, 1);
628
+ }
629
+ & .caret-icon-left {
630
+ transform-origin: 25% 50%;
631
+ }
632
+ & .caret-icon-right {
633
+ transform-origin: 75% 50%;
634
+ }
617
635
  }
618
636
  `
619
637
  }
620
638
  }
639
+ function CaretIcon({ style }: { style: React.CSSProperties }) {
640
+ return (
641
+ // - Inspired by stripe.com
642
+ // - Alternative caret SVGs: https://gist.github.com/brillout/dbf05e1fb79a34169cc2d0d5eaf58c01
643
+ // - The rounded caret (`caret.svg`) doesn't look nice when flipped:
644
+ // - https://github.com/brillout/docpress/commit/0ff937d8caf5fc439887ef495e2d2a700234dfb1
645
+ // - https://github.com/brillout/docpress/pull/39
646
+ <svg
647
+ xmlns="http://www.w3.org/2000/svg"
648
+ viewBox="0 0 9.24 5.858"
649
+ style={{
650
+ overflow: 'visible',
651
+ ...style,
652
+ }}
653
+ className="caret-icon"
654
+ >
655
+ <g className="caret-icon-left">
656
+ <path
657
+ fill="currentColor"
658
+ d="m4.001 5.24.619.618 1.237-1.237-.618-.619L4 5.241zm-4-4 4 4L5.24 4.001l-4-4L0 1.241z"
659
+ ></path>
660
+ </g>
661
+ <g className="caret-icon-right">
662
+ <path fill="currentColor" d="m5.239 5.239-.619.618L3.383 4.62l.618-.619L5.24 5.24Zm4-4-4 4L4 4l4-4z"></path>
663
+ </g>
664
+ </svg>
665
+ )
666
+ }
621
667
  function DocsIcon() {
622
668
  return (
623
669
  <img
624
670
  src={iconBooks}
625
- width={21}
671
+ width={18}
626
672
  style={{ marginRight: 'calc(var(--icon-text-padding) + 2px)' }}
627
673
  className="decolorize-5"
628
674
  />
@@ -135,6 +135,12 @@ ${/* Button style */ ''}
135
135
  &::before {
136
136
  top: 0;
137
137
  }
138
+ & .caret-icon-left {
139
+ transform: rotate(-90deg);
140
+ }
141
+ & .caret-icon-right {
142
+ transform: rotate(90deg);
143
+ }
138
144
  }
139
145
  }
140
146
  `
@@ -32,7 +32,7 @@ function SearchIcon() {
32
32
  return (
33
33
  <img
34
34
  src={iconMagnifyingGlass}
35
- width={21}
35
+ width={18}
36
36
  style={{ marginRight: 'var(--icon-text-padding)' }}
37
37
  className="decolorize-7"
38
38
  />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.12.6",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@brillout/picocolors": "^1.0.10",