rails_admin 3.0.0.beta2 → 3.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails_admin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +6 -9
- data/Rakefile +11 -0
- data/app/assets/javascripts/{rails_admin.js → rails_admin/application.js} +4 -4
- data/app/assets/stylesheets/rails_admin/application.scss +31 -0
- data/app/controllers/rails_admin/application_controller.rb +1 -1
- data/app/controllers/rails_admin/main_controller.rb +12 -21
- data/app/helpers/rails_admin/application_helper.rb +43 -22
- data/app/helpers/rails_admin/form_builder.rb +3 -3
- data/app/helpers/rails_admin/main_helper.rb +1 -1
- data/app/views/kaminari/ra-twitter-bootstrap/_gap.html.erb +2 -2
- data/app/views/kaminari/ra-twitter-bootstrap/_next_page.html.erb +4 -4
- data/app/views/kaminari/ra-twitter-bootstrap/_page.html.erb +4 -4
- data/app/views/kaminari/ra-twitter-bootstrap/_paginator.html.erb +12 -10
- data/app/views/kaminari/ra-twitter-bootstrap/_prev_page.html.erb +4 -4
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_next_page.html.erb +4 -4
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_paginator.html.erb +6 -4
- data/app/views/kaminari/ra-twitter-bootstrap/without_count/_prev_page.html.erb +4 -4
- data/app/views/layouts/rails_admin/_head.html.erb +2 -2
- data/app/views/layouts/rails_admin/_navigation.html.erb +12 -16
- data/app/views/layouts/rails_admin/_secondary_navigation.html.erb +8 -8
- data/app/views/layouts/rails_admin/_sidebar_navigation.html.erb +1 -5
- data/app/views/layouts/rails_admin/application.html.erb +4 -7
- data/app/views/layouts/rails_admin/{pjax.html.erb → content.html.erb} +7 -5
- data/app/views/layouts/rails_admin/modal.js.erb +1 -1
- data/app/views/rails_admin/main/_dashboard_history.html.erb +1 -1
- data/app/views/rails_admin/main/_delete_notice.html.erb +2 -2
- data/app/views/rails_admin/main/_form_boolean.html.erb +6 -8
- data/app/views/rails_admin/main/_form_colorpicker.html.erb +5 -1
- data/app/views/rails_admin/main/_form_datetime.html.erb +8 -7
- data/app/views/rails_admin/main/_form_enumeration.html.erb +5 -1
- data/app/views/rails_admin/main/_form_file_upload.html.erb +1 -1
- data/app/views/rails_admin/main/_form_filtering_multiselect.html.erb +14 -14
- data/app/views/rails_admin/main/_form_filtering_select.html.erb +16 -21
- data/app/views/rails_admin/main/_form_multiple_file_upload.html.erb +1 -1
- data/app/views/rails_admin/main/_form_nested_many.html.erb +4 -4
- data/app/views/rails_admin/main/_form_nested_one.html.erb +4 -4
- data/app/views/rails_admin/main/_form_polymorphic_association.html.erb +11 -6
- data/app/views/rails_admin/main/_submit_buttons.html.erb +8 -8
- data/app/views/rails_admin/main/bulk_delete.html.erb +1 -1
- data/app/views/rails_admin/main/dashboard.html.erb +4 -4
- data/app/views/rails_admin/main/delete.html.erb +1 -1
- data/app/views/rails_admin/main/edit.html.erb +1 -1
- data/app/views/rails_admin/main/export.html.erb +35 -32
- data/app/views/rails_admin/main/history.html.erb +16 -14
- data/app/views/rails_admin/main/index.html.erb +39 -36
- data/app/views/rails_admin/main/new.html.erb +1 -1
- data/config/locales/rails_admin.en.yml +0 -1
- data/lib/generators/rails_admin/install_generator.rb +8 -7
- data/lib/generators/rails_admin/templates/webpack.config.js +0 -3
- data/lib/rails_admin/abstract_model.rb +3 -4
- data/lib/rails_admin/adapters/active_record/object_extension.rb +1 -1
- data/lib/rails_admin/adapters/active_record/property.rb +1 -1
- data/lib/rails_admin/adapters/active_record.rb +8 -3
- data/lib/rails_admin/adapters/mongoid/property.rb +3 -3
- data/lib/rails_admin/adapters/mongoid.rb +4 -4
- data/lib/rails_admin/config/actions/base.rb +1 -6
- data/lib/rails_admin/config/actions/dashboard.rb +13 -9
- data/lib/rails_admin/config/actions/delete.rb +4 -0
- data/lib/rails_admin/config/actions/edit.rb +4 -0
- data/lib/rails_admin/config/actions/export.rb +2 -1
- data/lib/rails_admin/config/actions/index.rb +2 -1
- data/lib/rails_admin/config/actions/new.rb +7 -1
- data/lib/rails_admin/config/actions/show_in_app.rb +0 -4
- data/lib/rails_admin/config/fields/association.rb +6 -1
- data/lib/rails_admin/config/fields/base.rb +3 -3
- data/lib/rails_admin/config/fields/factories/active_storage.rb +2 -1
- data/lib/rails_admin/config/fields/factories/association.rb +4 -4
- data/lib/rails_admin/config/fields/factories/carrierwave.rb +2 -1
- data/lib/rails_admin/config/fields/factories/devise.rb +2 -1
- data/lib/rails_admin/config/fields/factories/dragonfly.rb +2 -1
- data/lib/rails_admin/config/fields/factories/paperclip.rb +2 -1
- data/lib/rails_admin/config/fields/types/action_text.rb +1 -1
- data/lib/rails_admin/config/fields/types/date.rb +7 -0
- data/lib/rails_admin/config/fields/types/datetime.rb +11 -5
- data/lib/rails_admin/config/fields/types/has_many_association.rb +4 -0
- data/lib/rails_admin/config/fields/types/has_one_association.rb +4 -0
- data/lib/rails_admin/config/fields/types/time.rb +9 -0
- data/lib/rails_admin/config/has_fields.rb +4 -0
- data/lib/rails_admin/config/model.rb +8 -0
- data/lib/rails_admin/config/sections/list.rb +4 -4
- data/lib/rails_admin/config.rb +18 -4
- data/lib/rails_admin/engine.rb +6 -13
- data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +2 -2
- data/lib/rails_admin/support/datetime.rb +50 -53
- data/lib/rails_admin/support/esmodule_preprocessor.rb +2 -1
- data/lib/rails_admin/version.rb +1 -1
- data/package.json +7 -5
- data/src/rails_admin/base.js +3 -6
- data/src/rails_admin/filter-box.js +36 -37
- data/src/rails_admin/filtering-select.js +3 -6
- data/src/rails_admin/i18n.js +0 -3
- data/src/rails_admin/nested-form-hooks.js +16 -8
- data/src/rails_admin/remote-form.js +18 -15
- data/src/rails_admin/styles/base/theming.scss +80 -155
- data/src/rails_admin/styles/base/variables.scss +2 -0
- data/src/rails_admin/styles/base.scss +8 -45
- data/src/rails_admin/styles/filtering-multiselect.scss +2 -2
- data/src/rails_admin/styles/filtering-select.scss +1 -1
- data/src/rails_admin/styles/widgets.scss +1 -10
- data/src/rails_admin/ui.js +19 -57
- data/src/rails_admin/widgets.js +38 -48
- data/vendor/assets/javascripts/rails_admin/bootstrap.js +5046 -0
- data/vendor/assets/javascripts/rails_admin/flatpickr-with-locales.js +10683 -0
- data/vendor/assets/javascripts/rails_admin/popper.js +1974 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_accordion.scss +118 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_alert.scss +57 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_badge.scss +29 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_breadcrumb.scss +28 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_button-group.scss +139 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_buttons.scss +64 -110
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_card.scss +216 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_carousel.scss +162 -176
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_close.scss +31 -26
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_containers.scss +41 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_dropdown.scss +240 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_forms.scss +9 -538
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_functions.scss +302 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_grid.scss +18 -69
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_helpers.scss +9 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_images.scss +42 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_list-group.scss +127 -84
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_mixins.scss +26 -22
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_modal.scss +209 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_nav.scss +139 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_navbar.scss +218 -542
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_offcanvas.scss +83 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_pagination.scss +46 -70
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_placeholders.scss +51 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_popover.scss +158 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_progress.scss +48 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_reboot.scss +625 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_root.scss +54 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_spinners.scss +69 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_tables.scss +100 -178
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_toasts.scss +51 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_tooltip.scss +97 -77
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_transitions.scss +27 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_type.scss +54 -254
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_utilities.scss +628 -55
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_variables.scss +1572 -781
- data/vendor/assets/stylesheets/rails_admin/bootstrap/bootstrap.scss +38 -35
- data/vendor/assets/stylesheets/rails_admin/bootstrap/forms/_floating-labels.scss +63 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/forms/_form-check.scss +152 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/forms/_form-control.scss +219 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/forms/_form-range.scss +91 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/forms/_form-select.scss +72 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/forms/_form-text.scss +11 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/forms/_input-group.scss +121 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/forms/_labels.scss +36 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/forms/_validation.scss +12 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/helpers/_clearfix.scss +3 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/helpers/_colored-links.scss +12 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/helpers/_position.scss +30 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/helpers/_ratio.scss +26 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/helpers/_stacks.scss +15 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/helpers/_stretched-link.scss +15 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/helpers/_text-truncation.scss +7 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/helpers/_visually-hidden.scss +8 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/helpers/_vr.scss +8 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_alert.scss +11 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_backdrop.scss +14 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_border-radius.scss +72 -12
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_box-shadow.scss +18 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_breakpoints.scss +127 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_buttons.scss +113 -30
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_caret.scss +64 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_clearfix.scss +5 -18
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_color-scheme.scss +7 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_container.scss +9 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_deprecate.scss +10 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_forms.scss +130 -70
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_gradients.scss +27 -38
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_grid.scss +127 -98
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_image.scss +6 -24
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_list-group.scss +13 -20
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_lists.scss +7 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_pagination.scss +24 -16
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_reset-text.scss +17 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_resize.scss +1 -1
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_table-variants.scss +21 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/{_text-overflow.scss → _text-truncate.scss} +2 -2
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_transition.scss +26 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_utilities.scss +89 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_visually-hidden.scss +29 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/utilities/_api.scss +47 -0
- data/vendor/assets/stylesheets/rails_admin/bootstrap/vendor/_rfs.scss +354 -0
- data/vendor/assets/stylesheets/rails_admin/flatpickr.css +791 -0
- metadata +88 -94
- data/app/assets/stylesheets/rails_admin.scss.erb +0 -76
- data/lib/generators/rails_admin/templates/environment.js +0 -6
- data/src/rails_admin/styles/themes/cerulean/mixins.scss +0 -0
- data/src/rails_admin/styles/themes/cerulean/theming.scss +0 -135
- data/src/rails_admin/styles/themes/cerulean/variables.scss +0 -830
- data/src/rails_admin/styles/themes/default/mixins.scss +0 -8
- data/src/rails_admin/styles/themes/default/theming.scss +0 -11
- data/src/rails_admin/styles/themes/default/variables.scss +0 -12
- data/src/rails_admin/vendor/jquery.pjax.js +0 -899
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-affix.js +0 -164
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-alert.js +0 -95
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-button.js +0 -125
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-carousel.js +0 -246
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-collapse.js +0 -212
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-dropdown.js +0 -165
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-modal.js +0 -358
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-popover.js +0 -123
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-scrollspy.js +0 -172
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-tab.js +0 -155
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-tooltip.js +0 -677
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-transition.js +0 -59
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-typeahead.js +0 -1782
- data/vendor/assets/javascripts/rails_admin/bootstrap/bootstrap.js +0 -13
- data/vendor/assets/javascripts/rails_admin/bootstrap-datetimepicker.js +0 -2611
- data/vendor/assets/javascripts/rails_admin/jquery.pjax.js +0 -898
- data/vendor/assets/javascripts/rails_admin/moment-with-locales.js +0 -18085
- data/vendor/assets/stylesheets/rails_admin/_bootstrap-datetimepicker.scss +0 -343
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_alerts.scss +0 -68
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_badges.scss +0 -57
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_breadcrumbs.scss +0 -26
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_button-groups.scss +0 -240
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_code.scss +0 -68
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_component-animations.scss +0 -35
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_dropdowns.scss +0 -215
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_glyphicons.scss +0 -237
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_input-groups.scss +0 -166
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_jumbotron.scss +0 -48
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_labels.scss +0 -66
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_media.scss +0 -56
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_modals.scss +0 -150
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_navs.scss +0 -242
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_normalize.scss +0 -425
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_pager.scss +0 -55
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_panels.scss +0 -243
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_popovers.scss +0 -133
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_print.scss +0 -101
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_progress-bars.scss +0 -105
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_responsive-embed.scss +0 -34
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_responsive-utilities.scss +0 -174
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_scaffolding.scss +0 -150
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_theme.scss +0 -258
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_thumbnails.scss +0 -38
- data/vendor/assets/stylesheets/rails_admin/bootstrap/_wells.scss +0 -29
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_alerts.scss +0 -14
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_background-variant.scss +0 -11
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_center-block.scss +0 -7
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_grid-framework.scss +0 -81
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_hide-text.scss +0 -21
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_labels.scss +0 -12
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_nav-divider.scss +0 -10
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_nav-vertical-align.scss +0 -9
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_opacity.scss +0 -8
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_panels.scss +0 -24
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_progress-bar.scss +0 -10
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_reset-filter.scss +0 -8
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_responsive-visibility.scss +0 -21
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_size.scss +0 -10
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_tab-focus.scss +0 -9
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_table-row.scss +0 -28
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_text-emphasis.scss +0 -11
- data/vendor/assets/stylesheets/rails_admin/bootstrap/mixins/_vendor-prefixes.scss +0 -219
- data/vendor/assets/stylesheets/rails_admin/bootstrap-datetimepicker-build.scss +0 -16
@@ -0,0 +1,302 @@
|
|
1
|
+
// Bootstrap functions
|
2
|
+
//
|
3
|
+
// Utility mixins and functions for evaluating source code across our variables, maps, and mixins.
|
4
|
+
|
5
|
+
// Ascending
|
6
|
+
// Used to evaluate Sass maps like our grid breakpoints.
|
7
|
+
@mixin _assert-ascending($map, $map-name) {
|
8
|
+
$prev-key: null;
|
9
|
+
$prev-num: null;
|
10
|
+
@each $key, $num in $map {
|
11
|
+
@if $prev-num == null or unit($num) == "%" or unit($prev-num) == "%" {
|
12
|
+
// Do nothing
|
13
|
+
} @else if not comparable($prev-num, $num) {
|
14
|
+
@warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
|
15
|
+
} @else if $prev-num >= $num {
|
16
|
+
@warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !";
|
17
|
+
}
|
18
|
+
$prev-key: $key;
|
19
|
+
$prev-num: $num;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
// Starts at zero
|
24
|
+
// Used to ensure the min-width of the lowest breakpoint starts at 0.
|
25
|
+
@mixin _assert-starts-at-zero($map, $map-name: "$grid-breakpoints") {
|
26
|
+
@if length($map) > 0 {
|
27
|
+
$values: map-values($map);
|
28
|
+
$first-value: nth($values, 1);
|
29
|
+
@if $first-value != 0 {
|
30
|
+
@warn "First breakpoint in #{$map-name} must start at 0, but starts at #{$first-value}.";
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
// Colors
|
36
|
+
@function to-rgb($value) {
|
37
|
+
@return red($value), green($value), blue($value);
|
38
|
+
}
|
39
|
+
|
40
|
+
// stylelint-disable scss/dollar-variable-pattern
|
41
|
+
@function rgba-css-var($identifier, $target) {
|
42
|
+
@if $identifier == "body" and $target == "bg" {
|
43
|
+
@return rgba(var(--#{$variable-prefix}#{$identifier}-bg-rgb), var(--#{$variable-prefix}#{$target}-opacity));
|
44
|
+
} @if $identifier == "body" and $target == "text" {
|
45
|
+
@return rgba(var(--#{$variable-prefix}#{$identifier}-color-rgb), var(--#{$variable-prefix}#{$target}-opacity));
|
46
|
+
} @else {
|
47
|
+
@return rgba(var(--#{$variable-prefix}#{$identifier}-rgb), var(--#{$variable-prefix}#{$target}-opacity));
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
@function map-loop($map, $func, $args...) {
|
52
|
+
$_map: ();
|
53
|
+
|
54
|
+
@each $key, $value in $map {
|
55
|
+
// allow to pass the $key and $value of the map as an function argument
|
56
|
+
$_args: ();
|
57
|
+
@each $arg in $args {
|
58
|
+
$_args: append($_args, if($arg == "$key", $key, if($arg == "$value", $value, $arg)));
|
59
|
+
}
|
60
|
+
|
61
|
+
$_map: map-merge($_map, ($key: call(get-function($func), $_args...)));
|
62
|
+
}
|
63
|
+
|
64
|
+
@return $_map;
|
65
|
+
}
|
66
|
+
// stylelint-enable scss/dollar-variable-pattern
|
67
|
+
|
68
|
+
@function varify($list) {
|
69
|
+
$result: null;
|
70
|
+
@each $entry in $list {
|
71
|
+
$result: append($result, var(--#{$variable-prefix}#{$entry}), space);
|
72
|
+
}
|
73
|
+
@return $result;
|
74
|
+
}
|
75
|
+
|
76
|
+
// Internal Bootstrap function to turn maps into its negative variant.
|
77
|
+
// It prefixes the keys with `n` and makes the value negative.
|
78
|
+
@function negativify-map($map) {
|
79
|
+
$result: ();
|
80
|
+
@each $key, $value in $map {
|
81
|
+
@if $key != 0 {
|
82
|
+
$result: map-merge($result, ("n" + $key: (-$value)));
|
83
|
+
}
|
84
|
+
}
|
85
|
+
@return $result;
|
86
|
+
}
|
87
|
+
|
88
|
+
// Get multiple keys from a sass map
|
89
|
+
@function map-get-multiple($map, $values) {
|
90
|
+
$result: ();
|
91
|
+
@each $key, $value in $map {
|
92
|
+
@if (index($values, $key) != null) {
|
93
|
+
$result: map-merge($result, ($key: $value));
|
94
|
+
}
|
95
|
+
}
|
96
|
+
@return $result;
|
97
|
+
}
|
98
|
+
|
99
|
+
// Merge multiple maps
|
100
|
+
@function map-merge-multiple($maps...) {
|
101
|
+
$merged-maps: ();
|
102
|
+
|
103
|
+
@each $map in $maps {
|
104
|
+
$merged-maps: map-merge($merged-maps, $map);
|
105
|
+
}
|
106
|
+
@return $merged-maps;
|
107
|
+
}
|
108
|
+
|
109
|
+
// Replace `$search` with `$replace` in `$string`
|
110
|
+
// Used on our SVG icon backgrounds for custom forms.
|
111
|
+
//
|
112
|
+
// @author Hugo Giraudel
|
113
|
+
// @param {String} $string - Initial string
|
114
|
+
// @param {String} $search - Substring to replace
|
115
|
+
// @param {String} $replace ('') - New value
|
116
|
+
// @return {String} - Updated string
|
117
|
+
@function str-replace($string, $search, $replace: "") {
|
118
|
+
$index: str-index($string, $search);
|
119
|
+
|
120
|
+
@if $index {
|
121
|
+
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
122
|
+
}
|
123
|
+
|
124
|
+
@return $string;
|
125
|
+
}
|
126
|
+
|
127
|
+
// See https://codepen.io/kevinweber/pen/dXWoRw
|
128
|
+
//
|
129
|
+
// Requires the use of quotes around data URIs.
|
130
|
+
|
131
|
+
@function escape-svg($string) {
|
132
|
+
@if str-index($string, "data:image/svg+xml") {
|
133
|
+
@each $char, $encoded in $escaped-characters {
|
134
|
+
// Do not escape the url brackets
|
135
|
+
@if str-index($string, "url(") == 1 {
|
136
|
+
$string: url("#{str-replace(str-slice($string, 6, -3), $char, $encoded)}");
|
137
|
+
} @else {
|
138
|
+
$string: str-replace($string, $char, $encoded);
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
@return $string;
|
144
|
+
}
|
145
|
+
|
146
|
+
// Color contrast
|
147
|
+
// See https://github.com/twbs/bootstrap/pull/30168
|
148
|
+
|
149
|
+
// A list of pre-calculated numbers of pow(divide((divide($value, 255) + .055), 1.055), 2.4). (from 0 to 255)
|
150
|
+
// stylelint-disable-next-line scss/dollar-variable-default, scss/dollar-variable-pattern
|
151
|
+
$_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003 .0033 .0037 .004 .0044 .0048 .0052 .0056 .006 .0065 .007 .0075 .008 .0086 .0091 .0097 .0103 .011 .0116 .0123 .013 .0137 .0144 .0152 .016 .0168 .0176 .0185 .0194 .0203 .0212 .0222 .0232 .0242 .0252 .0262 .0273 .0284 .0296 .0307 .0319 .0331 .0343 .0356 .0369 .0382 .0395 .0409 .0423 .0437 .0452 .0467 .0482 .0497 .0513 .0529 .0545 .0561 .0578 .0595 .0612 .063 .0648 .0666 .0685 .0704 .0723 .0742 .0762 .0782 .0802 .0823 .0844 .0865 .0887 .0908 .0931 .0953 .0976 .0999 .1022 .1046 .107 .1095 .1119 .1144 .117 .1195 .1221 .1248 .1274 .1301 .1329 .1356 .1384 .1413 .1441 .147 .15 .1529 .1559 .159 .162 .1651 .1683 .1714 .1746 .1779 .1812 .1845 .1878 .1912 .1946 .1981 .2016 .2051 .2086 .2122 .2159 .2195 .2232 .227 .2307 .2346 .2384 .2423 .2462 .2502 .2542 .2582 .2623 .2664 .2705 .2747 .2789 .2831 .2874 .2918 .2961 .3005 .305 .3095 .314 .3185 .3231 .3278 .3325 .3372 .3419 .3467 .3515 .3564 .3613 .3663 .3712 .3763 .3813 .3864 .3916 .3968 .402 .4072 .4125 .4179 .4233 .4287 .4342 .4397 .4452 .4508 .4564 .4621 .4678 .4735 .4793 .4851 .491 .4969 .5029 .5089 .5149 .521 .5271 .5333 .5395 .5457 .552 .5583 .5647 .5711 .5776 .5841 .5906 .5972 .6038 .6105 .6172 .624 .6308 .6376 .6445 .6514 .6584 .6654 .6724 .6795 .6867 .6939 .7011 .7084 .7157 .7231 .7305 .7379 .7454 .7529 .7605 .7682 .7758 .7835 .7913 .7991 .807 .8148 .8228 .8308 .8388 .8469 .855 .8632 .8714 .8796 .8879 .8963 .9047 .9131 .9216 .9301 .9387 .9473 .956 .9647 .9734 .9823 .9911 1;
|
152
|
+
|
153
|
+
@function color-contrast($background, $color-contrast-dark: $color-contrast-dark, $color-contrast-light: $color-contrast-light, $min-contrast-ratio: $min-contrast-ratio) {
|
154
|
+
$foregrounds: $color-contrast-light, $color-contrast-dark, $white, $black;
|
155
|
+
$max-ratio: 0;
|
156
|
+
$max-ratio-color: null;
|
157
|
+
|
158
|
+
@each $color in $foregrounds {
|
159
|
+
$contrast-ratio: contrast-ratio($background, $color);
|
160
|
+
@if $contrast-ratio > $min-contrast-ratio {
|
161
|
+
@return $color;
|
162
|
+
} @else if $contrast-ratio > $max-ratio {
|
163
|
+
$max-ratio: $contrast-ratio;
|
164
|
+
$max-ratio-color: $color;
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
@warn "Found no color leading to #{$min-contrast-ratio}:1 contrast ratio against #{$background}...";
|
169
|
+
|
170
|
+
@return $max-ratio-color;
|
171
|
+
}
|
172
|
+
|
173
|
+
@function contrast-ratio($background, $foreground: $color-contrast-light) {
|
174
|
+
$l1: luminance($background);
|
175
|
+
$l2: luminance(opaque($background, $foreground));
|
176
|
+
|
177
|
+
@return if($l1 > $l2, divide($l1 + .05, $l2 + .05), divide($l2 + .05, $l1 + .05));
|
178
|
+
}
|
179
|
+
|
180
|
+
// Return WCAG2.0 relative luminance
|
181
|
+
// See https://www.w3.org/WAI/GL/wiki/Relative_luminance
|
182
|
+
// See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
183
|
+
@function luminance($color) {
|
184
|
+
$rgb: (
|
185
|
+
"r": red($color),
|
186
|
+
"g": green($color),
|
187
|
+
"b": blue($color)
|
188
|
+
);
|
189
|
+
|
190
|
+
@each $name, $value in $rgb {
|
191
|
+
$value: if(divide($value, 255) < .03928, divide(divide($value, 255), 12.92), nth($_luminance-list, $value + 1));
|
192
|
+
$rgb: map-merge($rgb, ($name: $value));
|
193
|
+
}
|
194
|
+
|
195
|
+
@return (map-get($rgb, "r") * .2126) + (map-get($rgb, "g") * .7152) + (map-get($rgb, "b") * .0722);
|
196
|
+
}
|
197
|
+
|
198
|
+
// Return opaque color
|
199
|
+
// opaque(#fff, rgba(0, 0, 0, .5)) => #808080
|
200
|
+
@function opaque($background, $foreground) {
|
201
|
+
@return mix(rgba($foreground, 1), $background, opacity($foreground) * 100);
|
202
|
+
}
|
203
|
+
|
204
|
+
// scss-docs-start color-functions
|
205
|
+
// Tint a color: mix a color with white
|
206
|
+
@function tint-color($color, $weight) {
|
207
|
+
@return mix(white, $color, $weight);
|
208
|
+
}
|
209
|
+
|
210
|
+
// Shade a color: mix a color with black
|
211
|
+
@function shade-color($color, $weight) {
|
212
|
+
@return mix(black, $color, $weight);
|
213
|
+
}
|
214
|
+
|
215
|
+
// Shade the color if the weight is positive, else tint it
|
216
|
+
@function shift-color($color, $weight) {
|
217
|
+
@return if($weight > 0, shade-color($color, $weight), tint-color($color, -$weight));
|
218
|
+
}
|
219
|
+
// scss-docs-end color-functions
|
220
|
+
|
221
|
+
// Return valid calc
|
222
|
+
@function add($value1, $value2, $return-calc: true) {
|
223
|
+
@if $value1 == null {
|
224
|
+
@return $value2;
|
225
|
+
}
|
226
|
+
|
227
|
+
@if $value2 == null {
|
228
|
+
@return $value1;
|
229
|
+
}
|
230
|
+
|
231
|
+
@if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
|
232
|
+
@return $value1 + $value2;
|
233
|
+
}
|
234
|
+
|
235
|
+
@return if($return-calc == true, calc(#{$value1} + #{$value2}), $value1 + unquote(" + ") + $value2);
|
236
|
+
}
|
237
|
+
|
238
|
+
@function subtract($value1, $value2, $return-calc: true) {
|
239
|
+
@if $value1 == null and $value2 == null {
|
240
|
+
@return null;
|
241
|
+
}
|
242
|
+
|
243
|
+
@if $value1 == null {
|
244
|
+
@return -$value2;
|
245
|
+
}
|
246
|
+
|
247
|
+
@if $value2 == null {
|
248
|
+
@return $value1;
|
249
|
+
}
|
250
|
+
|
251
|
+
@if type-of($value1) == number and type-of($value2) == number and comparable($value1, $value2) {
|
252
|
+
@return $value1 - $value2;
|
253
|
+
}
|
254
|
+
|
255
|
+
@if type-of($value2) != number {
|
256
|
+
$value2: unquote("(") + $value2 + unquote(")");
|
257
|
+
}
|
258
|
+
|
259
|
+
@return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2);
|
260
|
+
}
|
261
|
+
|
262
|
+
@function divide($dividend, $divisor, $precision: 10) {
|
263
|
+
$sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
|
264
|
+
$dividend: abs($dividend);
|
265
|
+
$divisor: abs($divisor);
|
266
|
+
@if $dividend == 0 {
|
267
|
+
@return 0;
|
268
|
+
}
|
269
|
+
@if $divisor == 0 {
|
270
|
+
@error "Cannot divide by 0";
|
271
|
+
}
|
272
|
+
$remainder: $dividend;
|
273
|
+
$result: 0;
|
274
|
+
$factor: 10;
|
275
|
+
@while ($remainder > 0 and $precision >= 0) {
|
276
|
+
$quotient: 0;
|
277
|
+
@while ($remainder >= $divisor) {
|
278
|
+
$remainder: $remainder - $divisor;
|
279
|
+
$quotient: $quotient + 1;
|
280
|
+
}
|
281
|
+
$result: $result * 10 + $quotient;
|
282
|
+
$factor: $factor * .1;
|
283
|
+
$remainder: $remainder * 10;
|
284
|
+
$precision: $precision - 1;
|
285
|
+
@if ($precision < 0 and $remainder >= $divisor * 5) {
|
286
|
+
$result: $result + 1;
|
287
|
+
}
|
288
|
+
}
|
289
|
+
$result: $result * $factor * $sign;
|
290
|
+
$dividend-unit: unit($dividend);
|
291
|
+
$divisor-unit: unit($divisor);
|
292
|
+
$unit-map: (
|
293
|
+
"px": 1px,
|
294
|
+
"rem": 1rem,
|
295
|
+
"em": 1em,
|
296
|
+
"%": 1%
|
297
|
+
);
|
298
|
+
@if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
|
299
|
+
$result: $result * map-get($unit-map, $dividend-unit);
|
300
|
+
}
|
301
|
+
@return $result;
|
302
|
+
}
|
@@ -1,43 +1,26 @@
|
|
1
|
+
// Row
|
1
2
|
//
|
2
|
-
//
|
3
|
-
// --------------------------------------------------
|
4
|
-
|
5
|
-
|
6
|
-
// Container widths
|
7
|
-
//
|
8
|
-
// Set the container width, and override it for fixed navbars in media queries.
|
3
|
+
// Rows contain your columns.
|
9
4
|
|
10
|
-
|
11
|
-
|
5
|
+
@if $enable-grid-classes {
|
6
|
+
.row {
|
7
|
+
@include make-row();
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
@media (min-width: $screen-md-min) {
|
17
|
-
width: $container-md;
|
18
|
-
}
|
19
|
-
@media (min-width: $screen-lg-min) {
|
20
|
-
width: $container-lg;
|
9
|
+
> * {
|
10
|
+
@include make-col-ready();
|
11
|
+
}
|
21
12
|
}
|
22
13
|
}
|
23
14
|
|
15
|
+
@if $enable-cssgrid {
|
16
|
+
.grid {
|
17
|
+
display: grid;
|
18
|
+
grid-template-rows: repeat(var(--#{$variable-prefix}rows, 1), 1fr);
|
19
|
+
grid-template-columns: repeat(var(--#{$variable-prefix}columns, #{$grid-columns}), 1fr);
|
20
|
+
gap: var(--#{$variable-prefix}gap, #{$grid-gutter-width});
|
24
21
|
|
25
|
-
|
26
|
-
|
27
|
-
// Utilizes the mixin meant for fixed width containers, but without any defined
|
28
|
-
// width for fluid, full width layouts.
|
29
|
-
|
30
|
-
.container-fluid {
|
31
|
-
@include container-fixed();
|
32
|
-
}
|
33
|
-
|
34
|
-
|
35
|
-
// Row
|
36
|
-
//
|
37
|
-
// Rows contain and clear the floats of your columns.
|
38
|
-
|
39
|
-
.row {
|
40
|
-
@include make-row();
|
22
|
+
@include make-cssgrid();
|
23
|
+
}
|
41
24
|
}
|
42
25
|
|
43
26
|
|
@@ -45,40 +28,6 @@
|
|
45
28
|
//
|
46
29
|
// Common styles for small and large grid columns
|
47
30
|
|
48
|
-
@
|
49
|
-
|
50
|
-
|
51
|
-
// Extra small grid
|
52
|
-
//
|
53
|
-
// Columns, offsets, pushes, and pulls for extra small devices like
|
54
|
-
// smartphones.
|
55
|
-
|
56
|
-
@include make-grid(xs);
|
57
|
-
|
58
|
-
|
59
|
-
// Small grid
|
60
|
-
//
|
61
|
-
// Columns, offsets, pushes, and pulls for the small device range, from phones
|
62
|
-
// to tablets.
|
63
|
-
|
64
|
-
@media (min-width: $screen-sm-min) {
|
65
|
-
@include make-grid(sm);
|
66
|
-
}
|
67
|
-
|
68
|
-
|
69
|
-
// Medium grid
|
70
|
-
//
|
71
|
-
// Columns, offsets, pushes, and pulls for the desktop device range.
|
72
|
-
|
73
|
-
@media (min-width: $screen-md-min) {
|
74
|
-
@include make-grid(md);
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
// Large grid
|
79
|
-
//
|
80
|
-
// Columns, offsets, pushes, and pulls for the large desktop device range.
|
81
|
-
|
82
|
-
@media (min-width: $screen-lg-min) {
|
83
|
-
@include make-grid(lg);
|
31
|
+
@if $enable-grid-classes {
|
32
|
+
@include make-grid-columns();
|
84
33
|
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
@import "helpers/clearfix";
|
2
|
+
@import "helpers/colored-links";
|
3
|
+
@import "helpers/ratio";
|
4
|
+
@import "helpers/position";
|
5
|
+
@import "helpers/stacks";
|
6
|
+
@import "helpers/visually-hidden";
|
7
|
+
@import "helpers/stretched-link";
|
8
|
+
@import "helpers/text-truncation";
|
9
|
+
@import "helpers/vr";
|
@@ -0,0 +1,42 @@
|
|
1
|
+
// Responsive images (ensure images don't scale beyond their parents)
|
2
|
+
//
|
3
|
+
// This is purposefully opt-in via an explicit class rather than being the default for all `<img>`s.
|
4
|
+
// We previously tried the "images are responsive by default" approach in Bootstrap v2,
|
5
|
+
// and abandoned it in Bootstrap v3 because it breaks lots of third-party widgets (including Google Maps)
|
6
|
+
// which weren't expecting the images within themselves to be involuntarily resized.
|
7
|
+
// See also https://github.com/twbs/bootstrap/issues/18178
|
8
|
+
.img-fluid {
|
9
|
+
@include img-fluid();
|
10
|
+
}
|
11
|
+
|
12
|
+
|
13
|
+
// Image thumbnails
|
14
|
+
.img-thumbnail {
|
15
|
+
padding: $thumbnail-padding;
|
16
|
+
background-color: $thumbnail-bg;
|
17
|
+
border: $thumbnail-border-width solid $thumbnail-border-color;
|
18
|
+
@include border-radius($thumbnail-border-radius);
|
19
|
+
@include box-shadow($thumbnail-box-shadow);
|
20
|
+
|
21
|
+
// Keep them at most 100% wide
|
22
|
+
@include img-fluid();
|
23
|
+
}
|
24
|
+
|
25
|
+
//
|
26
|
+
// Figures
|
27
|
+
//
|
28
|
+
|
29
|
+
.figure {
|
30
|
+
// Ensures the caption's text aligns with the image.
|
31
|
+
display: inline-block;
|
32
|
+
}
|
33
|
+
|
34
|
+
.figure-img {
|
35
|
+
margin-bottom: $spacer * .5;
|
36
|
+
line-height: 1;
|
37
|
+
}
|
38
|
+
|
39
|
+
.figure-caption {
|
40
|
+
@include font-size($figure-caption-font-size);
|
41
|
+
color: $figure-caption-color;
|
42
|
+
}
|