modal.sass 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. $modal-z: 20 !default
  2. $modal-background-background-color: rgba($black, 0.86) !default
  3. $modal-content-width: 640px !default
  4. $modal-content-margin-mobile: 20px !default
  5. $modal-content-spacing-mobile: 160px !default
  6. $modal-content-spacing-tablet: 40px !default
  7. $modal-close-dimensions: 40px !default
  8. $modal-close-right: 20px !default
  9. $modal-close-top: 20px !default
  10. $modal-card-spacing: 40px !default
  11. $modal-card-head-background-color: $background !default
  12. $modal-card-head-border-bottom: 1px solid $border !default
  13. $modal-card-head-padding: 20px !default
  14. $modal-card-head-radius: $radius-large !default
  15. $modal-card-title-color: $text-strong !default
  16. $modal-card-title-line-height: 1 !default
  17. $modal-card-title-size: $size-4 !default
  18. $modal-card-foot-radius: $radius-large !default
  19. $modal-card-foot-border-top: 1px solid $border !default
  20. $modal-card-body-background-color: $white !default
  21. $modal-card-body-padding: 20px !default
  22. .modal
  23. +overlay
  24. align-items: center
  25. display: none
  26. justify-content: center
  27. overflow: hidden
  28. position: fixed
  29. z-index: $modal-z
  30. // Modifiers
  31. &.is-active
  32. display: flex
  33. .modal-background
  34. +overlay
  35. background-color: $modal-background-background-color
  36. .modal-content,
  37. .modal-card
  38. margin: 0 $modal-content-margin-mobile
  39. max-height: calc(100vh - #{$modal-content-spacing-mobile})
  40. overflow: auto
  41. position: relative
  42. width: 100%
  43. // Responsiveness
  44. +tablet
  45. margin: 0 auto
  46. max-height: calc(100vh - #{$modal-content-spacing-tablet})
  47. width: $modal-content-width
  48. .modal-close
  49. +delete
  50. background: none
  51. height: $modal-close-dimensions
  52. position: fixed
  53. right: $modal-close-right
  54. top: $modal-close-top
  55. width: $modal-close-dimensions
  56. .modal-card
  57. display: flex
  58. flex-direction: column
  59. max-height: calc(100vh - #{$modal-card-spacing})
  60. overflow: hidden
  61. .modal-card-head,
  62. .modal-card-foot
  63. align-items: center
  64. background-color: $modal-card-head-background-color
  65. display: flex
  66. flex-shrink: 0
  67. justify-content: flex-start
  68. padding: $modal-card-head-padding
  69. position: relative
  70. .modal-card-head
  71. border-bottom: $modal-card-head-border-bottom
  72. border-top-left-radius: $modal-card-head-radius
  73. border-top-right-radius: $modal-card-head-radius
  74. .modal-card-title
  75. color: $modal-card-title-color
  76. flex-grow: 1
  77. flex-shrink: 0
  78. font-size: $modal-card-title-size
  79. line-height: $modal-card-title-line-height
  80. .modal-card-foot
  81. border-bottom-left-radius: $modal-card-foot-radius
  82. border-bottom-right-radius: $modal-card-foot-radius
  83. border-top: $modal-card-foot-border-top
  84. .button
  85. &:not(:last-child)
  86. margin-right: 10px
  87. .modal-card-body
  88. +overflow-touch
  89. background-color: $modal-card-body-background-color
  90. flex-grow: 1
  91. flex-shrink: 1
  92. overflow: auto
  93. padding: $modal-card-body-padding