photo-rail.scss 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. @import '_variables';
  2. .photo-rail {
  3. &-card {
  4. float: left;
  5. background: var(--bg_panel);
  6. border-radius: 0 0 4px 4px;
  7. width: 100%;
  8. margin: 5px 0;
  9. }
  10. &-header {
  11. padding: 5px 12px 0;
  12. }
  13. &-header-mobile {
  14. display: none;
  15. box-sizing: border-box;
  16. padding: 5px 12px 0;
  17. width: 100%;
  18. float: unset;
  19. color: var(--accent);
  20. justify-content: space-between;
  21. }
  22. &-grid {
  23. display: grid;
  24. grid-template-columns: repeat(4, 1fr);
  25. grid-gap: 3px 3px;
  26. padding: 5px 12px 12px;
  27. a {
  28. position: relative;
  29. border-radius: 5px;
  30. background-color: var(--darker_grey);
  31. &:before {
  32. content: "";
  33. display: block;
  34. padding-top: 100%;
  35. }
  36. }
  37. img {
  38. height: 100%;
  39. width: 100%;
  40. border-radius: 4px;
  41. object-fit: cover;
  42. position: absolute;
  43. top: 0;
  44. left: 0;
  45. bottom: 0;
  46. right: 0;
  47. }
  48. }
  49. }
  50. @include create-toggle(photo-rail-grid, 640px);
  51. #photo-rail-grid-toggle:checked ~ .photo-rail-grid {
  52. padding-bottom: 12px;
  53. }
  54. @media(max-width: 700px) {
  55. .photo-rail-header {
  56. display: none;
  57. }
  58. .photo-rail-header-mobile {
  59. display: flex;
  60. }
  61. .photo-rail-grid {
  62. max-height: 0;
  63. padding-bottom: 0;
  64. overflow: hidden;
  65. transition: max-height 0.4s;
  66. }
  67. .photo-rail-grid {
  68. grid-template-columns: repeat(6, 1fr);
  69. }
  70. #photo-rail-grid-toggle:checked ~ .photo-rail-grid {
  71. max-height: 300px;
  72. }
  73. }
  74. @media(max-width: 450px) {
  75. .photo-rail-grid {
  76. grid-template-columns: repeat(4, 1fr);
  77. }
  78. #photo-rail-grid-toggle:checked ~ .photo-rail-grid {
  79. max-height: 450px;
  80. }
  81. }