photo-rail.scss 1.8 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. padding: 5px 12px 0;
  15. display: none;
  16. width: calc(100% - 24px);
  17. float: unset;
  18. color: var(--accent);
  19. justify-content: space-between;
  20. }
  21. &-grid {
  22. display: grid;
  23. grid-template-columns: repeat(4, 1fr);
  24. grid-gap: 3px 3px;
  25. padding: 5px 12px 12px;
  26. a {
  27. position: relative;
  28. border-radius: 5px;
  29. &:before {
  30. content: "";
  31. display: block;
  32. padding-top: 100%;
  33. }
  34. }
  35. img {
  36. height: 100%;
  37. width: 100%;
  38. border-radius: 4px;
  39. object-fit: cover;
  40. position: absolute;
  41. top: 0;
  42. left: 0;
  43. bottom: 0;
  44. right: 0;
  45. }
  46. }
  47. }
  48. @include create-toggle(photo-rail-grid, 640px);
  49. #photo-rail-grid-toggle:checked ~ .photo-rail-grid {
  50. padding-bottom: 12px;
  51. }
  52. @media(max-width: 600px) {
  53. .photo-rail-header {
  54. display: none;
  55. }
  56. .photo-rail-header-mobile {
  57. display: flex;
  58. }
  59. .photo-rail-grid {
  60. max-height: 0;
  61. padding-bottom: 0;
  62. overflow: hidden;
  63. transition: max-height 0.4s;
  64. }
  65. }
  66. @media(max-width: 600px) {
  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. }