modal.sass 2.9 KB

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