| 1 |
/* |
| 2 |
* Component: Modal |
| 3 |
*/ |
| 4 |
@theme-prefix: wf; |
| 5 |
@modal-width: 820px; |
| 6 |
@modal-header-bg: #F5F5F5; |
| 7 |
@modal-body-bg: #fff; |
| 8 |
@modal-border-color: #F5F5F5; |
| 9 |
@modal-footer-border-color: @modal-border-color; |
| 10 |
@modal-header-padding: 20px; |
| 11 |
@modal-body-padding: 20px; |
| 12 |
@modal-footer-padding: @modal-header-padding; |
| 13 |
@modal-backdrop-bg: rgba(0,0,0,.4); |
| 14 |
@modal-border-radius: 4px; |
| 15 |
@printable-modal-bg: #F5F5F5; |
| 16 |
// Container that the modal scrolls within |
| 17 |
.@{theme-prefix}-modal { |
| 18 |
display: flex; |
| 19 |
align-items: center; |
| 20 |
justify-content: center; |
| 21 |
position: fixed; |
| 22 |
top: 0; |
| 23 |
left: 0; |
| 24 |
width: 100%; |
| 25 |
height: 100%; |
| 26 |
z-index: 99; |
| 27 |
background: rgba(0,0,0,0.5); |
| 28 |
opacity: 0; |
| 29 |
visibility: hidden; |
| 30 |
transition: all .3s ease-in-out; |
| 31 |
|
| 32 |
// modal close |
| 33 |
span.modal-close { |
| 34 |
width: 24px; |
| 35 |
height: 24px; |
| 36 |
text-align: center; |
| 37 |
border-radius: 50%; |
| 38 |
background: rgba(0,0,0,0.8); |
| 39 |
border: 1px solid #f2f2f2; |
| 40 |
position: absolute; |
| 41 |
top: -8px; |
| 42 |
right: -8px; |
| 43 |
z-index: 9999; |
| 44 |
cursor: pointer; |
| 45 |
i { |
| 46 |
font-size: 7px; |
| 47 |
} |
| 48 |
&:hover { |
| 49 |
background: rgba(0,0,0,1); |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
.@{theme-prefix}-modal-dialog { |
| 54 |
position: relative; |
| 55 |
width: 95%; |
| 56 |
max-width: @modal-width; |
| 57 |
max-height: 100%; |
| 58 |
margin-top: -100px; |
| 59 |
transition: all .3s ease-in-out; |
| 60 |
} |
| 61 |
.@{theme-prefix}-modal-content { |
| 62 |
background-color: @modal-body-bg; |
| 63 |
border: 1px solid @modal-border-color; |
| 64 |
border-radius: @modal-border-radius; |
| 65 |
box-shadow: 0 3px 9px rgba(0,0,0,.5); |
| 66 |
background-clip: padding-box; |
| 67 |
// Remove focus outline from opened modal |
| 68 |
outline: 0; |
| 69 |
max-height: 90vh; |
| 70 |
overflow-y: auto; |
| 71 |
} |
| 72 |
&.@{theme-prefix}-modal-open { |
| 73 |
opacity: 1; |
| 74 |
visibility: visible; |
| 75 |
.@{theme-prefix}-modal-dialog { |
| 76 |
margin-top: 0px; |
| 77 |
} |
| 78 |
} |
| 79 |
} |
| 80 |
// Modal header |
| 81 |
// Top section of the modal w/ title and dismiss |
| 82 |
.@{theme-prefix}-modal-header { |
| 83 |
padding: @modal-header-padding; |
| 84 |
display: flex; |
| 85 |
justify-content: space-between; |
| 86 |
align-items: center; |
| 87 |
border-radius: 3px 3px 0 0; |
| 88 |
font-weight: 600; |
| 89 |
color: #000; |
| 90 |
|
| 91 |
h2, h3, h4, h5 { |
| 92 |
margin: 0; |
| 93 |
font-size: 23px; |
| 94 |
} |
| 95 |
|
| 96 |
&.has-border { |
| 97 |
border-bottom: 1px solid @modal-border-color; |
| 98 |
} |
| 99 |
&.has-bg { |
| 100 |
background: @modal-header-bg; |
| 101 |
} |
| 102 |
|
| 103 |
.@{theme-prefix}-close { |
| 104 |
color: #cec9cb; |
| 105 |
font-size: 16px; |
| 106 |
padding: 5px; |
| 107 |
margin-right: -5px; |
| 108 |
cursor: pointer; |
| 109 |
&:hover { |
| 110 |
color: #ccc; |
| 111 |
} |
| 112 |
} |
| 113 |
.@{theme-prefix}-icon { |
| 114 |
color: #ccc; |
| 115 |
margin-right: 10px; |
| 116 |
vertical-align: text-top; |
| 117 |
&:before { |
| 118 |
font-size: 20px; |
| 119 |
} |
| 120 |
} |
| 121 |
} |
| 122 |
.@{theme-prefix}-modal-body { |
| 123 |
position: relative; |
| 124 |
padding: @modal-body-padding; |
| 125 |
background: #fff; |
| 126 |
} |
| 127 |
// Footer (for actions) |
| 128 |
.@{theme-prefix}-modal-footer { |
| 129 |
padding: @modal-footer-padding; |
| 130 |
text-align: right; // right align buttons |
| 131 |
|
| 132 |
&.has-border { |
| 133 |
border-top: 1px solid @modal-border-color; |
| 134 |
} |
| 135 |
|
| 136 |
// Properly space out buttons |
| 137 |
.@{theme-prefix}-btn + .@{theme-prefix}-btn { |
| 138 |
margin-left: 15px; |
| 139 |
margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs |
| 140 |
} |
| 141 |
|
| 142 |
// but override that for button groups |
| 143 |
.@{theme-prefix}-btn-group .@{theme-prefix}-btn + .@{theme-prefix}-btn { |
| 144 |
margin-left: -1px; |
| 145 |
} |
| 146 |
// and override it for block buttons as well |
| 147 |
.@{theme-prefix}-btn-block + .@{theme-prefix}-btn-block { |
| 148 |
margin-left: 0; |
| 149 |
} |
| 150 |
} |
| 151 |
// Measure scrollbar width for padding body during modal show/hide |
| 152 |
.@{theme-prefix}-modal-scrollbar-measure { |
| 153 |
position: absolute; |
| 154 |
top: -9999px; |
| 155 |
width: 50px; |
| 156 |
height: 50px; |
| 157 |
overflow: scroll; |
| 158 |
} |
| 159 |
|
| 160 |
.modal-title { |
| 161 |
margin-bottom: 20px; |
| 162 |
* { |
| 163 |
margin: 0; |
| 164 |
font-size: 18px; |
| 165 |
font-weight: 400; |
| 166 |
} |
| 167 |
} |
| 168 |
|