Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea -... Línea 1...
-
 
1
// stylelint-disable function-disallowed-list
-
 
2
 
1
// .modal-open      - body class for killing the scroll
3
// .modal-open      - body class for killing the scroll
2
// .modal           - container to scroll within
4
// .modal           - container to scroll within
3
// .modal-dialog    - positioning shell for the actual modal
5
// .modal-dialog    - positioning shell for the actual modal
4
// .modal-content   - actual modal w/ bg and corners and stuff
6
// .modal-content   - actual modal w/ bg and corners and stuff
Línea 5... Línea -...
5
 
-
 
6
 
-
 
7
.modal-open {
-
 
8
  // Kill the scroll on the body
-
 
9
  overflow: hidden;
-
 
10
 
-
 
11
  .modal {
-
 
12
    overflow-x: hidden;
-
 
13
    overflow-y: auto;
-
 
14
  }
-
 
15
}
7
 
16
 
8
 
-
 
9
// Container that the modal scrolls within
-
 
10
.modal {
-
 
11
  // scss-docs-start modal-css-vars
-
 
12
  --#{$prefix}modal-zindex: #{$zindex-modal};
-
 
13
  --#{$prefix}modal-width: #{$modal-md};
-
 
14
  --#{$prefix}modal-padding: #{$modal-inner-padding};
-
 
15
  --#{$prefix}modal-margin: #{$modal-dialog-margin};
-
 
16
  --#{$prefix}modal-color: #{$modal-content-color};
-
 
17
  --#{$prefix}modal-bg: #{$modal-content-bg};
-
 
18
  --#{$prefix}modal-border-color: #{$modal-content-border-color};
-
 
19
  --#{$prefix}modal-border-width: #{$modal-content-border-width};
-
 
20
  --#{$prefix}modal-border-radius: #{$modal-content-border-radius};
-
 
21
  --#{$prefix}modal-box-shadow: #{$modal-content-box-shadow-xs};
-
 
22
  --#{$prefix}modal-inner-border-radius: #{$modal-content-inner-border-radius};
-
 
23
  --#{$prefix}modal-header-padding-x: #{$modal-header-padding-x};
-
 
24
  --#{$prefix}modal-header-padding-y: #{$modal-header-padding-y};
-
 
25
  --#{$prefix}modal-header-padding: #{$modal-header-padding}; // Todo in v6: Split this padding into x and y
-
 
26
  --#{$prefix}modal-header-border-color: #{$modal-header-border-color};
-
 
27
  --#{$prefix}modal-header-border-width: #{$modal-header-border-width};
-
 
28
  --#{$prefix}modal-title-line-height: #{$modal-title-line-height};
-
 
29
  --#{$prefix}modal-footer-gap: #{$modal-footer-margin-between};
-
 
30
  --#{$prefix}modal-footer-bg: #{$modal-footer-bg};
-
 
31
  --#{$prefix}modal-footer-border-color: #{$modal-footer-border-color};
-
 
32
  --#{$prefix}modal-footer-border-width: #{$modal-footer-border-width};
17
// Container that the modal scrolls within
33
  // scss-docs-end modal-css-vars
18
.modal {
34
 
19
  position: fixed;
35
  position: fixed;
20
  top: 0;
36
  top: 0;
21
  left: 0;
37
  left: 0;
22
  z-index: $zindex-modal;
38
  z-index: var(--#{$prefix}modal-zindex);
23
  display: none;
39
  display: none;
24
  width: 100%;
40
  width: 100%;
-
 
41
  height: 100%;
25
  height: 100%;
42
  overflow-x: hidden;
26
  overflow: hidden;
43
  overflow-y: auto;
27
  // Prevent Chrome on Windows from adding a focus outline. For details, see
44
  // Prevent Chrome on Windows from adding a focus outline. For details, see
28
  // https://github.com/twbs/bootstrap/pull/10951.
45
  // https://github.com/twbs/bootstrap/pull/10951.
29
  outline: 0;
46
  outline: 0;
Línea 34... Línea 51...
34
 
51
 
35
// Shell div to position the modal with bottom padding
52
// Shell div to position the modal with bottom padding
36
.modal-dialog {
53
.modal-dialog {
37
  position: relative;
54
  position: relative;
38
  width: auto;
55
  width: auto;
39
  margin: $modal-dialog-margin;
56
  margin: var(--#{$prefix}modal-margin);
40
  // allow clicks to pass through for custom click handling to close modal
57
  // allow clicks to pass through for custom click handling to close modal
Línea 41... Línea 58...
41
  pointer-events: none;
58
  pointer-events: none;
42
 
59
 
Línea 54... Línea 71...
54
    transform: $modal-scale-transform;
71
    transform: $modal-scale-transform;
55
  }
72
  }
56
}
73
}
Línea 57... Línea 74...
57
 
74
 
58
.modal-dialog-scrollable {
-
 
59
  display: flex; // IE10/11
75
.modal-dialog-scrollable {
Línea 60... Línea 76...
60
  max-height: subtract(100%, $modal-dialog-margin * 2);
76
  height: calc(100% - var(--#{$prefix}modal-margin) * 2);
61
 
77
 
62
  .modal-content {
78
  .modal-content {
63
    max-height: subtract(100vh, $modal-dialog-margin * 2); // IE10/11
79
    max-height: 100%;
Línea 64... Línea -...
64
    overflow: hidden;
-
 
65
  }
-
 
66
 
-
 
67
  .modal-header,
-
 
68
  .modal-footer {
-
 
69
    flex-shrink: 0;
80
    overflow: hidden;
70
  }
81
  }
71
 
82
 
72
  .modal-body {
83
  .modal-body {
Línea 73... Línea 84...
73
    overflow-y: auto;
84
    overflow-y: auto;
74
  }
85
  }
75
}
86
}
76
 
87
 
77
.modal-dialog-centered {
-
 
78
  display: flex;
-
 
79
  align-items: center;
-
 
80
  min-height: subtract(100%, $modal-dialog-margin * 2);
-
 
81
 
-
 
82
  // Ensure `modal-dialog-centered` extends the full height of the view (IE10/11)
-
 
83
  &::before {
-
 
84
    display: block; // IE10
-
 
85
    height: subtract(100vh, $modal-dialog-margin * 2);
-
 
86
    height: min-content; // Reset height to 0 except on IE
-
 
87
    content: "";
-
 
88
  }
-
 
89
 
-
 
90
  // Ensure `.modal-body` shows scrollbar (IE10/11)
-
 
91
  &.modal-dialog-scrollable {
-
 
92
    flex-direction: column;
-
 
93
    justify-content: center;
-
 
94
    height: 100%;
-
 
95
 
-
 
96
    .modal-content {
-
 
97
      max-height: none;
-
 
98
    }
-
 
99
 
-
 
100
    &::before {
88
.modal-dialog-centered {
Línea 101... Línea 89...
101
      content: none;
89
  display: flex;
102
    }
90
  align-items: center;
103
  }
91
  min-height: calc(100% - var(--#{$prefix}modal-margin) * 2);
104
}
92
}
105
 
93
 
106
// Actual modal
94
// Actual modal
107
.modal-content {
95
.modal-content {
108
  position: relative;
96
  position: relative;
109
  display: flex;
97
  display: flex;
110
  flex-direction: column;
98
  flex-direction: column;
111
  width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog`
99
  width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog`
112
  // counteract the pointer-events: none; in the .modal-dialog
100
  // counteract the pointer-events: none; in the .modal-dialog
113
  color: $modal-content-color;
101
  color: var(--#{$prefix}modal-color);
114
  pointer-events: auto;
102
  pointer-events: auto;
115
  background-color: $modal-content-bg;
103
  background-color: var(--#{$prefix}modal-bg);
116
  background-clip: padding-box;
104
  background-clip: padding-box;
117
  border: $modal-content-border-width solid $modal-content-border-color;
105
  border: var(--#{$prefix}modal-border-width) solid var(--#{$prefix}modal-border-color);
Línea 118... Línea 106...
118
  @include border-radius($modal-content-border-radius);
106
  @include border-radius(var(--#{$prefix}modal-border-radius));
119
  @include box-shadow($modal-content-box-shadow-xs);
107
  @include box-shadow(var(--#{$prefix}modal-box-shadow));
120
  // Remove focus outline from opened modal
108
  // Remove focus outline from opened modal
121
  outline: 0;
-
 
122
}
-
 
123
 
109
  outline: 0;
124
// Modal background
110
}
125
.modal-backdrop {
111
 
126
  position: fixed;
112
// Modal background
127
  top: 0;
113
.modal-backdrop {
128
  left: 0;
-
 
129
  z-index: $zindex-modal-backdrop;
-
 
130
  width: 100vw;
114
  // scss-docs-start modal-backdrop-css-vars
131
  height: 100vh;
115
  --#{$prefix}backdrop-zindex: #{$zindex-modal-backdrop};
Línea 132... Línea 116...
132
  background-color: $modal-backdrop-bg;
116
  --#{$prefix}backdrop-bg: #{$modal-backdrop-bg};
133
 
117
  --#{$prefix}backdrop-opacity: #{$modal-backdrop-opacity};
134
  // Fade for backdrop
118
  // scss-docs-end modal-backdrop-css-vars
135
  &.fade { opacity: 0; }
119
 
136
  &.show { opacity: $modal-backdrop-opacity; }
120
  @include overlay-backdrop(var(--#{$prefix}backdrop-zindex), var(--#{$prefix}backdrop-bg), var(--#{$prefix}backdrop-opacity));
137
}
121
}
138
 
122
 
139
// Modal header
123
// Modal header
140
// Top section of the modal w/ title and dismiss
124
// Top section of the modal w/ title and dismiss
141
.modal-header {
125
.modal-header {
142
  display: flex;
126
  display: flex;
143
  align-items: flex-start; // so the close btn always stays on the upper right corner
-
 
144
  justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
127
  flex-shrink: 0;
145
  padding: $modal-header-padding;
128
  align-items: center;
146
  border-bottom: $modal-header-border-width solid $modal-header-border-color;
129
  padding: var(--#{$prefix}modal-header-padding);
147
  @include border-top-radius($modal-content-inner-border-radius);
130
  border-bottom: var(--#{$prefix}modal-header-border-width) solid var(--#{$prefix}modal-header-border-color);
Línea 148... Línea 131...
148
 
131
  @include border-top-radius(var(--#{$prefix}modal-inner-border-radius));
149
  .close {
132
 
150
    padding: $modal-header-padding;
133
  .btn-close {
151
    // auto on the left force icon to the right even when there is no .modal-title
134
    padding: calc(var(--#{$prefix}modal-header-padding-y) * .5) calc(var(--#{$prefix}modal-header-padding-x) * .5);
152
    margin: (-$modal-header-padding-y) (-$modal-header-padding-x) (-$modal-header-padding-y) auto;
135
    margin: calc(-.5 * var(--#{$prefix}modal-header-padding-y)) calc(-.5 * var(--#{$prefix}modal-header-padding-x)) calc(-.5 * var(--#{$prefix}modal-header-padding-y)) auto;
Línea 153... Línea 136...
153
  }
136
  }
154
}
137
}
155
 
138
 
156
// Title text within header
139
// Title text within header
157
.modal-title {
140
.modal-title {
158
  margin-bottom: 0;
141
  margin-bottom: 0;
159
  line-height: $modal-title-line-height;
142
  line-height: var(--#{$prefix}modal-title-line-height);
160
}
143
}
161
 
144
 
Línea 162... Línea 145...
162
// Modal body
145
// Modal body
163
// Where all modal content resides (sibling of .modal-header and .modal-footer)
146
// Where all modal content resides (sibling of .modal-header and .modal-footer)
164
.modal-body {
147
.modal-body {
-
 
148
  position: relative;
165
  position: relative;
149
  // Enable `flex-grow: 1` so that the body take up as much space as possible
166
  // Enable `flex-grow: 1` so that the body take up as much space as possible
150
  // when there should be a fixed height on `.modal-dialog`.
167
  // when there should be a fixed height on `.modal-dialog`.
151
  flex: 1 1 auto;
168
  flex: 1 1 auto;
152
  padding: var(--#{$prefix}modal-padding);
-
 
153
}
169
  padding: $modal-inner-padding;
154
 
170
}
155
// Footer (for actions)
Línea 171... Línea 156...
171
 
156
.modal-footer {
172
// Footer (for actions)
157
  display: flex;
173
.modal-footer {
158
  flex-shrink: 0;
174
  display: flex;
159
  flex-wrap: wrap;
175
  flex-wrap: wrap;
160
  align-items: center; // vertically center
176
  align-items: center; // vertically center
161
  justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
177
  justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
162
  padding: calc(var(--#{$prefix}modal-padding) - var(--#{$prefix}modal-footer-gap) * .5);
Línea 178... Línea -...
178
  padding: $modal-inner-padding - $modal-footer-margin-between * .5;
-
 
179
  border-top: $modal-footer-border-width solid $modal-footer-border-color;
-
 
180
  @include border-bottom-radius($modal-content-inner-border-radius);
-
 
181
 
-
 
182
  // Place margin between footer elements
-
 
183
  // This solution is far from ideal because of the universal selector usage,
-
 
184
  // but is needed to fix https://github.com/twbs/bootstrap/issues/24800
-
 
185
  > * {
-
 
186
    margin: $modal-footer-margin-between * .5;
-
 
187
  }
163
  background-color: var(--#{$prefix}modal-footer-bg);
188
}
164
  border-top: var(--#{$prefix}modal-footer-border-width) solid var(--#{$prefix}modal-footer-border-color);
189
 
-
 
190
// Measure scrollbar width for padding body during modal show/hide
165
  @include border-bottom-radius(var(--#{$prefix}modal-inner-border-radius));
191
.modal-scrollbar-measure {
-
 
192
  position: absolute;
166
 
193
  top: -9999px;
-
 
194
  width: 50px;
-
 
195
  height: 50px;
-
 
196
  overflow: scroll;
-
 
197
}
-
 
198
 
-
 
199
// Scale up the modal
167
  // Place margin between footer elements
200
@include media-breakpoint-up(sm) {
-
 
201
  // Automatically set modal's width for larger viewports
168
  // This solution is far from ideal because of the universal selector usage,
Línea 202... Línea -...
202
  .modal-dialog {
-
 
203
    max-width: $modal-md;
169
  // but is needed to fix https://github.com/twbs/bootstrap/issues/24800
204
    margin: $modal-dialog-margin-y-sm-up auto;
-
 
205
  }
170
  > * {
206
 
171
    margin: calc(var(--#{$prefix}modal-footer-gap) * .5); // Todo in v6: replace with gap on parent class
207
  .modal-dialog-scrollable {
172
  }
208
    max-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);
173
}
209
 
174
 
Línea 210... Línea 175...
210
    .modal-content {
175
// Scale up the modal
211
      max-height: subtract(100vh, $modal-dialog-margin-y-sm-up * 2);
176
@include media-breakpoint-up(sm) {
212
    }
177
  .modal {
213
  }
-
 
214
 
-
 
215
  .modal-dialog-centered {
178
    --#{$prefix}modal-margin: #{$modal-dialog-margin-y-sm-up};
Línea 216... Línea 179...
216
    min-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);
179
    --#{$prefix}modal-box-shadow: #{$modal-content-box-shadow-sm-up};
217
 
180
  }
218
    &::before {
181
 
219
      height: subtract(100vh, $modal-dialog-margin-y-sm-up * 2);
182
  // Automatically set modal's width for larger viewports
220
      height: min-content;
183
  .modal-dialog {
221
    }
184
    max-width: var(--#{$prefix}modal-width);
Línea 222... Línea 185...
222
  }
185
    margin-right: auto;
-
 
186
    margin-left: auto;
223
 
187
  }
-
 
188
 
-
 
189
  .modal-sm {
-
 
190
    --#{$prefix}modal-width: #{$modal-sm};
-
 
191
  }
-
 
192
}
-
 
193
 
-
 
194
@include media-breakpoint-up(lg) {
-
 
195
  .modal-lg,
-
 
196
  .modal-xl {
-
 
197
    --#{$prefix}modal-width: #{$modal-lg};
-
 
198
  }
-
 
199
}
-
 
200
 
-
 
201
@include media-breakpoint-up(xl) {
-
 
202
  .modal-xl {
-
 
203
    --#{$prefix}modal-width: #{$modal-xl};
-
 
204
  }
-
 
205
}
-
 
206
 
-
 
207
// scss-docs-start modal-fullscreen-loop
-
 
208
@each $breakpoint in map-keys($grid-breakpoints) {
-
 
209
  $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
-
 
210
  $postfix: if($infix != "", $infix + "-down", "");
-
 
211
 
-
 
212
  @include media-breakpoint-down($breakpoint) {
-
 
213
    .modal-fullscreen#{$postfix} {
-
 
214
      width: 100vw;
-
 
215
      max-width: none;
-
 
216
      height: 100%;
-
 
217
      margin: 0;
-
 
218
 
224
  .modal-content {
219
      .modal-content {
-
 
220
        height: 100%;