_layout.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. $side-padding:3em;
  2. body, html{
  3. position: relative;
  4. width: 100%;
  5. height:100%;
  6. font-family: sans-serif;
  7. font-style: normal;
  8. margin:0;
  9. padding:0;
  10. }
  11. body{
  12. overflow:hidden;
  13. }
  14. #root{
  15. display: flex;
  16. flex-direction: column;
  17. width: 100vw;
  18. max-width: 1920px;
  19. height:100vh;
  20. margin:0 auto;
  21. %layout-element{
  22. width:100vw;
  23. max-width: 1920px;
  24. box-sizing:border-box;
  25. }
  26. header[role="banner"]{
  27. z-index:10;
  28. flex: 0 0 auto;
  29. @extend %layout-element;
  30. padding:1em $side-padding 1em $side-padding;
  31. @media only screen and (max-width: $small-bp), (orientation: portrait) {
  32. padding:1em $side-padding/2 0 $side-padding/2;
  33. }
  34. }
  35. section[role="main-content"]{
  36. display: flex;
  37. flex:1 1 auto;
  38. @extend %layout-element;
  39. overflow: hidden;
  40. position: relative;
  41. >.wrapper{
  42. position: relative;
  43. padding:0 $side-padding 0 $side-padding;
  44. // height:100%; max-height:100%;
  45. display: flex;
  46. flex: 1;
  47. overflow-y: hidden;
  48. overflow-x: hidden;
  49. >*{
  50. @include fade-transition;
  51. }
  52. @media only screen and (max-width: $small-bp), (orientation: portrait) {
  53. overflow-y: auto;
  54. padding:0 $side-padding/2 0 $side-padding/2;
  55. }
  56. }
  57. .main-content-layout{
  58. position: relative;
  59. // https://stackoverflow.com/a/33644245
  60. display: flex;
  61. flex: 1;
  62. >section{
  63. max-height: 100%;
  64. }
  65. >header,
  66. >section>.wrapper,
  67. >nav{
  68. box-sizing: border-box;
  69. max-height: 100%;
  70. padding-top:$base-line;
  71. }
  72. >section>.wrapper,
  73. >nav{
  74. overflow-x: hidden;
  75. overflow-y: auto;
  76. -webkit-overflow-scrolling: touch;
  77. }
  78. }
  79. @media only screen and (max-width: $small-bp), (orientation: portrait) {
  80. .main-content-layout{
  81. display: flex;
  82. flex-direction: column;
  83. }
  84. }
  85. @media (orientation: portrait) {
  86. .main-content-layout{
  87. display: flex;
  88. flex-direction: column;
  89. }
  90. }
  91. }
  92. footer[role="tools"]{
  93. flex:0 0 auto;
  94. @extend %layout-element;
  95. // padding-bottom: 1em;
  96. // >*{
  97. // padding:0.5em 1em;
  98. // }
  99. }
  100. }