1 // |
|
2 // Modals |
|
3 // -------------------------------------------------- |
|
4 |
|
5 // .modal-open - body class for killing the scroll |
|
6 // .modal - container to scroll within |
|
7 // .modal-dialog - positioning shell for the actual modal |
|
8 // .modal-content - actual modal w/ bg and corners and shit |
|
9 |
|
10 // Kill the scroll on the body |
|
11 .modal-open { |
|
12 overflow: hidden; |
|
13 } |
|
14 |
|
15 // Container that the modal scrolls within |
|
16 .modal { |
|
17 display: none; |
|
18 overflow: auto; |
|
19 overflow-y: scroll; |
|
20 position: fixed; |
|
21 top: 0; |
|
22 right: 0; |
|
23 bottom: 0; |
|
24 left: 0; |
|
25 z-index: @zindex-modal-background; |
|
26 |
|
27 // When fading in the modal, animate it to slide down |
|
28 &.fade .modal-dialog { |
|
29 .translate(0, -25%); |
|
30 .transition-transform(~"0.3s ease-out"); |
|
31 } |
|
32 &.in .modal-dialog { .translate(0, 0)} |
|
33 } |
|
34 |
|
35 // Shell div to position the modal with bottom padding |
|
36 .modal-dialog { |
|
37 position: relative; |
|
38 width: auto; |
|
39 margin: 10px; |
|
40 z-index: (@zindex-modal-background + 10); |
|
41 } |
|
42 |
|
43 // Actual modal |
|
44 .modal-content { |
|
45 position: relative; |
|
46 background-color: @modal-content-bg; |
|
47 border: 1px solid @modal-content-fallback-border-color; //old browsers fallback (ie8 etc) |
|
48 border: 1px solid @modal-content-border-color; |
|
49 border-radius: @border-radius-large; |
|
50 .box-shadow(0 3px 9px rgba(0,0,0,.5)); |
|
51 background-clip: padding-box; |
|
52 // Remove focus outline from opened modal |
|
53 outline: none; |
|
54 } |
|
55 |
|
56 // Modal background |
|
57 .modal-backdrop { |
|
58 position: fixed; |
|
59 top: 0; |
|
60 right: 0; |
|
61 bottom: 0; |
|
62 left: 0; |
|
63 z-index: (@zindex-modal-background - 10); |
|
64 background-color: @modal-backdrop-bg; |
|
65 // Fade for backdrop |
|
66 &.fade { .opacity(0); } |
|
67 &.in { .opacity(.5); } |
|
68 } |
|
69 |
|
70 // Modal header |
|
71 // Top section of the modal w/ title and dismiss |
|
72 .modal-header { |
|
73 padding: @modal-title-padding; |
|
74 border-bottom: 1px solid @modal-header-border-color; |
|
75 min-height: (@modal-title-padding + @modal-title-line-height); |
|
76 } |
|
77 // Close icon |
|
78 .modal-header .close { |
|
79 margin-top: -2px; |
|
80 } |
|
81 |
|
82 // Title text within header |
|
83 .modal-title { |
|
84 margin: 0; |
|
85 line-height: @modal-title-line-height; |
|
86 } |
|
87 |
|
88 // Modal body |
|
89 // Where all modal content resides (sibling of .modal-header and .modal-footer) |
|
90 .modal-body { |
|
91 position: relative; |
|
92 padding: @modal-inner-padding; |
|
93 } |
|
94 |
|
95 // Footer (for actions) |
|
96 .modal-footer { |
|
97 margin-top: 15px; |
|
98 padding: (@modal-inner-padding - 1) @modal-inner-padding @modal-inner-padding; |
|
99 text-align: right; // right align buttons |
|
100 border-top: 1px solid @modal-footer-border-color; |
|
101 .clearfix(); // clear it in case folks use .pull-* classes on buttons |
|
102 |
|
103 // Properly space out buttons |
|
104 .btn + .btn { |
|
105 margin-left: 5px; |
|
106 margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs |
|
107 } |
|
108 // but override that for button groups |
|
109 .btn-group .btn + .btn { |
|
110 margin-left: -1px; |
|
111 } |
|
112 // and override it for block buttons as well |
|
113 .btn-block + .btn-block { |
|
114 margin-left: 0; |
|
115 } |
|
116 } |
|
117 |
|
118 // Scale up the modal |
|
119 @media screen and (min-width: @screen-sm-min) { |
|
120 |
|
121 .modal-dialog { |
|
122 width: 600px; |
|
123 margin: 30px auto; |
|
124 } |
|
125 .modal-content { |
|
126 .box-shadow(0 5px 15px rgba(0,0,0,.5)); |
|
127 } |
|
128 |
|
129 } |
|