Layout scaffolding for Web apps.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

LeftSidebar.ts 1.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import { css } from '@tesseract-design/css-utils';
  2. import {LayoutArgs} from '../common';
  3. export const ContentBase = () => css.cx(
  4. css`
  5. box-sizing: border-box;
  6. `,
  7. css.media('(min-width: 1080px)')(
  8. css`
  9. padding-left: calc(50% - (var(--base-width) * 0.5));
  10. `
  11. ),
  12. );
  13. export const SidebarOverflow = () => css.cx(
  14. css`
  15. width: 100%;
  16. height: 100%;
  17. overflow: auto;
  18. // overflow: overlay;
  19. position: relative;
  20. z-index: 1;
  21. scrollbar-width: none;
  22. &::-webkit-scrollbar {
  23. display: none;
  24. }
  25. `
  26. )
  27. export const SidebarBase = ({
  28. mainSidebarOpen,
  29. }: LayoutArgs) => css.cx(
  30. css`
  31. box-sizing: border-box;
  32. position: fixed;
  33. top: 0;
  34. left: -100%;
  35. width: 100%;
  36. height: 100%;
  37. background-color: white;
  38. & > * {
  39. display: block;
  40. width: 100%;
  41. height: 100%;
  42. }
  43. `,
  44. css.media('(min-width: 1080px)')(
  45. css`
  46. width: calc(50% - (var(--base-width) * 0.5));
  47. left: 0;
  48. `
  49. ),
  50. css.if(mainSidebarOpen)(
  51. css`
  52. left: 0;
  53. `
  54. ),
  55. );
  56. export const SidebarMainContainer = () => css.cx(
  57. css`
  58. width: 100%;
  59. margin: 0 auto;
  60. padding: 0 1rem;
  61. box-sizing: border-box;
  62. max-width: calc(var(--base-width) * 2);
  63. `,
  64. css.media('(min-width: 1080px)')(
  65. css`
  66. width: var(--base-width);
  67. margin-right: 0;
  68. `
  69. ),
  70. );
  71. export const ContentContainer = () => css.cx(
  72. css`
  73. padding: 0 1rem;
  74. box-sizing: border-box;
  75. width: 100%;
  76. max-width: calc(var(--base-width) * 2);
  77. margin-right: auto;
  78. margin-left: auto;
  79. `,
  80. css.media('(min-width: 1080px)')(
  81. css`
  82. margin-left: 0;
  83. `
  84. ),
  85. );