the code for my website (https://www.annwan.me)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.1 KiB

10 months ago
  1. /* 1rem = 16px by default */
  2. .page {
  3. max-width: 64rem;
  4. margin: 1rem auto;
  5. display: grid;
  6. grid-template-areas:
  7. "header"
  8. "body"
  9. "aside"
  10. "footer";
  11. grid-template-columns: minmax(0, 1fr); /* https://css-tricks.com/preventing-a-grid-blowout/ */
  12. grid-row-gap: 2rem;
  13. }
  14. @media (min-width: 45rem) {
  15. .page {
  16. grid-template-areas:
  17. "header header"
  18. "body aside"
  19. "footer footer";
  20. grid-template-columns: minmax(0, 1fr) 15rem;
  21. grid-column-gap: 2rem;
  22. }
  23. }
  24. /* Header */
  25. .page__header {
  26. grid-area: header;
  27. display: flex;
  28. }
  29. .page__logo {
  30. flex-shrink: 0;
  31. }
  32. .page__nav {
  33. flex-grow: 1;
  34. }
  35. /* Body + aside */
  36. .page__body {
  37. grid-area: body;
  38. background-color: var(--off-bg);
  39. box-shadow: 0 0 0 1rem var(--off-bg);
  40. overflow-wrap: break-word;
  41. }
  42. .page__aside {
  43. grid-area: aside;
  44. color: var(--off-fg);
  45. position: sticky;
  46. top: 1rem;
  47. right: 1rem;
  48. overflow-y: auto;
  49. max-height: 95vh;
  50. }
  51. /* Footer */
  52. .page__footer {
  53. grid-area: footer;
  54. }