diff --git a/backend/app/assets/javascripts/spree/backend.js b/backend/app/assets/javascripts/spree/backend.js index 5beba64ea54..0847d535536 100644 --- a/backend/app/assets/javascripts/spree/backend.js +++ b/backend/app/assets/javascripts/spree/backend.js @@ -10,7 +10,7 @@ //= require solidus_admin/underscore //= require solidus_admin/backbone //= require solidus_admin/backbone-nested-models -//= require solidus_admin/tether +//= require solidus_admin/popover //= require solidus_admin/bootstrap //= require prism //= require spree diff --git a/backend/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss b/backend/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss index 97e8980c5af..4c064b00845 100644 --- a/backend/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +++ b/backend/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss @@ -7,10 +7,10 @@ // // Grayscale and brand colors for use across Bootstrap. -$brand-primary: $color-3 !default; -$brand-success: $color-2 !default; -$brand-warning: $color-6 !default; -$brand-danger: $color-5 !default; +$blue: $color-3 !default; +$red: $color-5 !default; +$orange: $color-6 !default; +$green: $color-2 !default; // Body // @@ -23,10 +23,9 @@ $body-color: $color-4 !default; // // Style anchor elements. -$link-color: $color-3 !default; -$link-decoration: none !default; -$link-hover-color: $color-2 !default; -$link-hover-decoration: none !default; +$link-decoration: none !default; +$link-hover-color: $color-2 !default; +$link-hover-decoration: none !default; // Grid columns // @@ -47,12 +46,12 @@ $font-size-root: 13px !default; $font-weight-normal: 400 !default; $font-weight-bold: 600 !default; -$font-size-h1: $font-size-root + 12 !default; -$font-size-h2: $font-size-root + 10 !default; -$font-size-h3: $font-size-root + 8 !default; -$font-size-h4: $font-size-root + 6 !default; -$font-size-h5: $font-size-root + 4 !default; -$font-size-h6: $font-size-root + 2 !default; +$h1-font-size: $font-size-root + 12 !default; +$h2-font-size: $font-size-root + 10 !default; +$h3-font-size: $font-size-root + 8 !default; +$h4-font-size: $font-size-root + 6 !default; +$h5-font-size: $font-size-root + 4 !default; +$h6-font-size: $font-size-root + 2 !default; $headings-font-weight: $font-weight-bold !default; $headings-color: $color-4 !default; @@ -67,9 +66,9 @@ $border-radius: 3px !default; $input-color: $color-3 !default; $input-border-color: $color-border !default; -$input-border-focus: $color-2 !default; +$input-focus-border-color: $color-2 !default; -$custom-select-focus-border-color: $input-border-focus !default; +$custom-select-focus-border-color: $input-focus-border-color !default; // Dropdowns // @@ -78,10 +77,6 @@ $custom-select-focus-border-color: $input-border-focus !default; $dropdown-link-hover-color: #fff !default; $dropdown-link-hover-bg: $color-3 !default; -// Badges - -$badge-default-bg: $color-7 !default; - // Breadcrumbs $breadcrumb-bg: transparent !default; diff --git a/backend/app/assets/stylesheets/spree/backend/components/_date-picker.scss b/backend/app/assets/stylesheets/spree/backend/components/_date-picker.scss index 5da4054b89b..ae951848a8d 100644 --- a/backend/app/assets/stylesheets/spree/backend/components/_date-picker.scss +++ b/backend/app/assets/stylesheets/spree/backend/components/_date-picker.scss @@ -1,6 +1,6 @@ .date-range-filter { .range-divider { - color: $gray; + color: $gray-800; } } diff --git a/backend/app/assets/stylesheets/spree/backend/components/_messages.scss b/backend/app/assets/stylesheets/spree/backend/components/_messages.scss index b4c644a2cce..1f45e2361c7 100644 --- a/backend/app/assets/stylesheets/spree/backend/components/_messages.scss +++ b/backend/app/assets/stylesheets/spree/backend/components/_messages.scss @@ -1,14 +1,14 @@ .errorExplanation { padding: 5px; - border: 1px solid very-light($brand-danger, 12); - background-color: very-light($brand-danger, 6); + border: 1px solid very-light(theme-color("danger"), 12); + background-color: very-light(theme-color("danger"), 6); border-radius: 3px; - color: very-light($brand-danger, 30); + color: very-light(theme-color("danger"), 30); margin-bottom: 15px; h2 { font-size: 140%; - color: very-light($brand-danger, 30); + color: very-light(theme-color("danger"), 30); margin-bottom: 5px; } @@ -37,9 +37,9 @@ color: $color-1; font-weight: $font-weight-bold; - &.notice { background-color: rgba($brand-warning, 0.8) } - &.success { background-color: rgba($brand-success, 0.8) } - &.error { background-color: rgba($brand-danger, 0.8) } + &.notice { background-color: rgba(theme-color("warning"), 0.8) } + &.success { background-color: rgba(theme-color("success"), 0.8) } + &.error { background-color: rgba(theme-color("danger"), 0.8) } } .alert { @@ -50,5 +50,5 @@ text-decoration: underline; } - &.error a { color: very-light($brand-danger, 10) } + &.error a { color: very-light(theme-color("danger"), 10) } } diff --git a/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss b/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss index 524ac5b0637..2556efca89d 100644 --- a/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss +++ b/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss @@ -28,7 +28,7 @@ nav.menu { .admin-nav { border-right: $border-sidebar; background: $color-sidebar-bg; - z-index: $zindex-navbar; + z-index: $zindex-sticky; } .admin-nav-header { diff --git a/backend/app/assets/stylesheets/spree/backend/components/_number_with_currency.scss b/backend/app/assets/stylesheets/spree/backend/components/_number_with_currency.scss index da3417c553d..aa5a7ed991e 100644 --- a/backend/app/assets/stylesheets/spree/backend/components/_number_with_currency.scss +++ b/backend/app/assets/stylesheets/spree/backend/components/_number_with_currency.scss @@ -17,7 +17,7 @@ border-right: 0; &:focus + .number-with-currency-select { - border-left-color: $input-border-focus; + border-left-color: $input-focus-border-color; } } diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/_bootstrap_tooltip.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_bootstrap_tooltip.scss index 98c8f3b5ee6..4dc9abfd4d2 100644 --- a/backend/app/assets/stylesheets/spree/backend/plugins/_bootstrap_tooltip.scss +++ b/backend/app/assets/stylesheets/spree/backend/plugins/_bootstrap_tooltip.scss @@ -3,30 +3,26 @@ background-color: $color; } - &.tooltip-top, - &.bs-tether-element-attached-bottom { - .tooltip-inner::before { + &.bs-tooltip-top { + .arrow::before { border-top-color: $color; } } - &.tooltip-right, - &.bs-tether-element-attached-left { - .tooltip-inner::before { + &.bs-tooltip-right { + .arrow::before { border-right-color: $color; } } - &.tooltip-bottom, - &.bs-tether-element-attached-top { - .tooltip-inner::before { + &.bs-tooltip-bottom { + .arrow::before { border-bottom-color: $color; } } - &.tooltip-left, - &.bs-tether-element-attached-right { - .tooltip-inner::before { + &.bs-tooltip-left { + .arrow::before { border-left-color: $color; } } @@ -36,12 +32,12 @@ pointer-events: none; &.action-edit, &.action-save, &.action-capture, &.action-add { - @include bootstrap-tooltip-color($brand-success); + @include bootstrap-tooltip-color(theme-color("success")); } &.action-clone, &.action-cancel { - @include bootstrap-tooltip-color($brand-warning); + @include bootstrap-tooltip-color(theme-color("warning")); } &.action-void, &.action-failure, &.action-remove { - @include bootstrap-tooltip-color($brand-danger); + @include bootstrap-tooltip-color(theme-color("danger")); } } diff --git a/backend/app/assets/stylesheets/spree/backend/plugins/_select2.scss b/backend/app/assets/stylesheets/spree/backend/plugins/_select2.scss index c85ebb5985a..3e2ebdbc4ed 100644 --- a/backend/app/assets/stylesheets/spree/backend/plugins/_select2.scss +++ b/backend/app/assets/stylesheets/spree/backend/plugins/_select2.scss @@ -3,7 +3,8 @@ border: $input-btn-border-width solid $input-border-color; @include border-radius($input-border-radius); background: $input-bg; - height: calc(#{$input-height} + #{2*$input-btn-border-width}); + height: $input-height; + padding: 0; .select2-arrow { background: transparent; @@ -17,7 +18,8 @@ } >.select2-chosen { - line-height: $input-height; + padding: $input-btn-padding-y $input-btn-padding-x; + line-height: $input-btn-line-height; color: $input-color; } } @@ -39,7 +41,7 @@ .select2-choices.select2-choices, /* Needs extra specificity */ .select2-choice { box-shadow: none; /* Remove default outline */ - border-color: $input-border-focus; + border-color: $input-focus-border-color; } } @@ -49,7 +51,7 @@ } .select2-search-choice { - background: $badge-default-bg; + background: $gray-200; border: 0; margin: 2px 0 3px 5px; // adjust the margin to respect the adjusted line height } @@ -72,7 +74,7 @@ } .select2-drop-active { - border: $input-btn-border-width solid $input-border-focus; + border: $input-btn-border-width solid $input-focus-border-color; border-top: 0; } diff --git a/backend/app/assets/stylesheets/spree/backend/sections/_orders.scss b/backend/app/assets/stylesheets/spree/backend/sections/_orders.scss index d4c98128b47..5076a42a7bf 100644 --- a/backend/app/assets/stylesheets/spree/backend/sections/_orders.scss +++ b/backend/app/assets/stylesheets/spree/backend/sections/_orders.scss @@ -17,7 +17,7 @@ .order-total { font-size: 35px; font-weight: $font-weight-bold; - color: $brand-success; + color: theme-color("success"); } } @@ -28,7 +28,7 @@ .customer { font-size: 20px; font-weight: $font-weight-bold; - color: $brand-success; + color: theme-color("success"); } } @@ -37,10 +37,10 @@ color: $body-color; .shipment-number { - color: $brand-success; + color: theme-color("success"); } .stock-location-name { - color: $brand-success; + color: theme-color("success"); } } } @@ -83,11 +83,11 @@ form.admin-ship-shipment { table.line-items { input.error { - border-color: $brand-danger; + border-color: theme-color("danger"); } .select2-container.error { border-radius: 4px; - border: 1px solid $brand-danger; + border: 1px solid theme-color("danger"); } } diff --git a/backend/app/assets/stylesheets/spree/backend/sections/_products.scss b/backend/app/assets/stylesheets/spree/backend/sections/_products.scss index bc060bed102..42982ba7c99 100644 --- a/backend/app/assets/stylesheets/spree/backend/sections/_products.scss +++ b/backend/app/assets/stylesheets/spree/backend/sections/_products.scss @@ -48,7 +48,7 @@ div[data-hook="admin_products_index_search_buttons"] { } &.with-images { - border-color: $brand-success; + border-color: theme-color("success"); } } diff --git a/backend/app/assets/stylesheets/spree/backend/sections/_promotions.scss b/backend/app/assets/stylesheets/spree/backend/sections/_promotions.scss index 0c045e8177b..bb6ee05d565 100644 --- a/backend/app/assets/stylesheets/spree/backend/sections/_promotions.scss +++ b/backend/app/assets/stylesheets/spree/backend/sections/_promotions.scss @@ -121,7 +121,7 @@ cursor: pointer; &:hover { - color: $brand-danger; + color: theme-color("danger"); } } } diff --git a/backend/app/assets/stylesheets/spree/backend/sections/_stock_management.scss b/backend/app/assets/stylesheets/spree/backend/sections/_stock_management.scss index 4f057c8430d..5f155691596 100644 --- a/backend/app/assets/stylesheets/spree/backend/sections/_stock_management.scss +++ b/backend/app/assets/stylesheets/spree/backend/sections/_stock_management.scss @@ -31,12 +31,12 @@ } input.error { - border-color: $brand-danger; + border-color: theme-color("danger"); } .select2-container.error { border-radius: 4px; - border: 1px solid $brand-danger; + border: 1px solid theme-color("danger"); } } diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_forms.scss b/backend/app/assets/stylesheets/spree/backend/shared/_forms.scss index d7d496016a1..4abaf6ad7c1 100644 --- a/backend/app/assets/stylesheets/spree/backend/shared/_forms.scss +++ b/backend/app/assets/stylesheets/spree/backend/shared/_forms.scss @@ -8,25 +8,25 @@ input[type="url"], input[type="number"], input[type="tel"], textarea { - padding: $input-padding-y $input-padding-x; + padding: $input-btn-padding-y $input-btn-padding-x; color: $input-color; border: $input-btn-border-width solid $input-border-color; border-radius: $input-border-radius; background: $input-bg; font-size: $font-size-base; - line-height: $input-line-height; + line-height: $input-btn-line-height; &:focus { - border-color: $input-border-focus; + border-color: $input-focus-border-color; outline: 0; } &:disabled { - background: $input-bg-disabled; + background: $input-disabled-bg; } &::placeholder { - color: $input-color-placeholder; + color: $input-placeholder-color; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526. opacity: 1; } @@ -68,7 +68,7 @@ button, .button { &:not(.close) { @extend .btn; - @include button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border); + @include button-variant(theme-color("primary"), theme-color("primary")); } &:before { @@ -134,21 +134,21 @@ span.info { &.withError { .field_with_errors { label { - color: very-light($brand-danger, 30); + color: very-light(theme-color("danger"), 30); } input { - border-color: very-light($brand-danger, 15); + border-color: very-light(theme-color("danger"), 15); } } .formError { - color: very-light($brand-danger, 30); + color: very-light(theme-color("danger"), 30); font-style: italic; font-size: 85%; } .select2-container { border-radius: 4px; - border: 1px solid very-light($brand-danger, 15); + border: 1px solid very-light(theme-color("danger"), 15); } } } diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_header.scss b/backend/app/assets/stylesheets/spree/backend/shared/_header.scss index d2943177bc6..e6144fdddbb 100644 --- a/backend/app/assets/stylesheets/spree/backend/shared/_header.scss +++ b/backend/app/assets/stylesheets/spree/backend/shared/_header.scss @@ -1,7 +1,7 @@ .main-header { display: flex; align-items: center; - padding: 15px map-get($grid-gutter-widths, "xl"); + padding: 15px $grid-gutter-width; background-color: very-light($color-3, 4); border-bottom: 1px solid $color-border; height: $main-header-height; diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_layout.scss b/backend/app/assets/stylesheets/spree/backend/shared/_layout.scss index 3c60c2ee307..8d8ab3cc72a 100644 --- a/backend/app/assets/stylesheets/spree/backend/shared/_layout.scss +++ b/backend/app/assets/stylesheets/spree/backend/shared/_layout.scss @@ -15,7 +15,7 @@ body { } .content-wrapper { - @include padding(1rem map-get($grid-gutter-widths, "xl") null); + @include padding(1rem $grid-gutter-width null); &:not(.full-width) { @include margin(null auto); diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_tables.scss b/backend/app/assets/stylesheets/spree/backend/shared/_tables.scss index de3d6a8ff44..25228a18c6b 100644 --- a/backend/app/assets/stylesheets/spree/backend/shared/_tables.scss +++ b/backend/app/assets/stylesheets/spree/backend/shared/_tables.scss @@ -74,27 +74,27 @@ table { } .fa-trash:hover, .fa-void:hover, .fa-failure:hover { - color: $brand-danger; + color: theme-color("danger"); } .fa-cancel:hover { - color: $brand-warning; + color: theme-color("warning"); } .fa-edit:hover, .fa-capture:hover, .fa-ok:hover, .fa-plus:hover, .fa-save:hover { - color: $brand-success; + color: theme-color("success"); } .fa-copy:hover { - color: $brand-warning; + color: theme-color("warning"); } .fa-thumbs-up:hover { - color: $brand-success; + color: theme-color("success"); } .fa-thumbs-down:hover { - color: $brand-danger; + color: theme-color("danger"); } } @@ -159,8 +159,8 @@ table { } &.deleted td { - background-color: very-light($brand-danger, 6); - border-color: very-light($brand-danger, 15); + background-color: very-light(theme-color("danger"), 6); + border-color: very-light(theme-color("danger"), 15); } &.ui-sortable-placeholder td { diff --git a/backend/app/assets/stylesheets/spree/backend/shared/_typography.scss b/backend/app/assets/stylesheets/spree/backend/shared/_typography.scss index bde43997137..3ecd2ec3479 100644 --- a/backend/app/assets/stylesheets/spree/backend/shared/_typography.scss +++ b/backend/app/assets/stylesheets/spree/backend/shared/_typography.scss @@ -20,12 +20,12 @@ hr { // Headings //-------------------------------------------------------------- -h1 { line-height: $font-size-h1 + 6 } -h2 { line-height: $font-size-h1 + 4 } -h3 { line-height: $font-size-h1 + 2 } -h4 { line-height: $font-size-h1 } -h5 { line-height: $font-size-h1 } -h6 { line-height: $font-size-h1 } +h1 { line-height: $h1-font-size + 6 } +h2 { line-height: $h1-font-size + 4 } +h3 { line-height: $h1-font-size + 2 } +h4 { line-height: $h1-font-size } +h5 { line-height: $h1-font-size } +h6 { line-height: $h1-font-size } // Lists diff --git a/backend/lib/spree/backend.rb b/backend/lib/spree/backend.rb index ab59e90ef0f..25da78fd501 100644 --- a/backend/lib/spree/backend.rb +++ b/backend/lib/spree/backend.rb @@ -6,6 +6,7 @@ require 'bourbon' require 'handlebars_assets' require 'font-awesome-rails' +require 'autoprefixer-rails' require 'jbuilder' require 'spree_core' diff --git a/backend/solidus_backend.gemspec b/backend/solidus_backend.gemspec index 1c24c789d9d..852faab1c63 100644 --- a/backend/solidus_backend.gemspec +++ b/backend/solidus_backend.gemspec @@ -34,4 +34,5 @@ Gem::Specification.new do |s| s.add_dependency 'jbuilder', '~> 2.6' s.add_dependency 'handlebars_assets', '~> 0.23' + s.add_dependency 'autoprefixer-rails', '~> 7.1' end diff --git a/backend/vendor/assets/javascripts/solidus_admin/bootstrap.js b/backend/vendor/assets/javascripts/solidus_admin/bootstrap.js index 25687733265..7597fb3280b 100644 --- a/backend/vendor/assets/javascripts/solidus_admin/bootstrap.js +++ b/backend/vendor/assets/javascripts/solidus_admin/bootstrap.js @@ -1,5 +1,5 @@ /*! - * Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com) + * Bootstrap v4.0.0-beta (https://getbootstrap.com) * Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ @@ -8,16 +8,14 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.') } -+function ($) { +(function ($) { var version = $.fn.jquery.split(' ')[0].split('.') if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) { throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0') } -}(jQuery); - - -+function () { +})(jQuery); +(function () { var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -30,7 +28,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.6): util.js + * Bootstrap (v4.0.0-beta): util.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -52,10 +50,9 @@ var Util = function ($) { MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend', transition: 'transitionend' - }; - // shoutout AngusCroll (https://goo.gl/pxwQGp) - function toType(obj) { + // shoutout AngusCroll (https://goo.gl/pxwQGp) + };function toType(obj) { return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); } @@ -141,13 +138,16 @@ var Util = function ($) { }, getSelectorFromElement: function getSelectorFromElement(element) { var selector = element.getAttribute('data-target'); - - if (!selector) { + if (!selector || selector === '#') { selector = element.getAttribute('href') || ''; - selector = /^#[a-z]/i.test(selector) ? selector : null; } - return selector; + try { + var $selector = $(selector); + return $selector.length > 0 ? selector : null; + } catch (error) { + return null; + } }, reflow: function reflow(element) { return element.offsetHeight; @@ -180,7 +180,7 @@ var Util = function ($) { /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.6): alert.js + * Bootstrap (v4.0.0-beta): alert.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -194,7 +194,7 @@ var Alert = function ($) { */ var NAME = 'alert'; - var VERSION = '4.0.0-alpha.6'; + var VERSION = '4.0.0-beta'; var DATA_KEY = 'bs.alert'; var EVENT_KEY = '.' + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -215,14 +215,14 @@ var Alert = function ($) { ALERT: 'alert', FADE: 'fade', SHOW: 'show' - }; - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; var Alert = function () { function Alert(element) { _classCallCheck(this, Alert); @@ -359,7 +359,7 @@ var Alert = function ($) { /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.6): button.js + * Bootstrap (v4.0.0-beta): button.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -373,7 +373,7 @@ var Button = function ($) { */ var NAME = 'button'; - var VERSION = '4.0.0-alpha.6'; + var VERSION = '4.0.0-beta'; var DATA_KEY = 'bs.button'; var EVENT_KEY = '.' + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -396,14 +396,14 @@ var Button = function ($) { var Event = { CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY, FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY) - }; - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; var Button = function () { function Button(element) { _classCallCheck(this, Button); @@ -417,6 +417,7 @@ var Button = function ($) { Button.prototype.toggle = function toggle() { var triggerChangeEvent = true; + var addAriaPressed = true; var rootElement = $(this._element).closest(Selector.DATA_TOGGLE)[0]; if (rootElement) { @@ -436,15 +437,21 @@ var Button = function ($) { } if (triggerChangeEvent) { + if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { + return; + } input.checked = !$(this._element).hasClass(ClassName.ACTIVE); $(input).trigger('change'); } input.focus(); + addAriaPressed = false; } } - this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)); + if (addAriaPressed) { + this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)); + } if (triggerChangeEvent) { $(this._element).toggleClass(ClassName.ACTIVE); @@ -522,7 +529,7 @@ var Button = function ($) { /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.6): carousel.js + * Bootstrap (v4.0.0-beta): carousel.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -536,7 +543,7 @@ var Carousel = function ($) { */ var NAME = 'carousel'; - var VERSION = '4.0.0-alpha.6'; + var VERSION = '4.0.0-beta'; var DATA_KEY = 'bs.carousel'; var EVENT_KEY = '.' + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -544,6 +551,7 @@ var Carousel = function ($) { var TRANSITION_DURATION = 600; var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key + var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch var Default = { interval: 5000, @@ -574,6 +582,7 @@ var Carousel = function ($) { KEYDOWN: 'keydown' + EVENT_KEY, MOUSEENTER: 'mouseenter' + EVENT_KEY, MOUSELEAVE: 'mouseleave' + EVENT_KEY, + TOUCHEND: 'touchend' + EVENT_KEY, LOAD_DATA_API: 'load' + EVENT_KEY + DATA_API_KEY, CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY }; @@ -597,14 +606,14 @@ var Carousel = function ($) { INDICATORS: '.carousel-indicators', DATA_SLIDE: '[data-slide], [data-slide-to]', DATA_RIDE: '[data-ride="carousel"]' - }; - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; var Carousel = function () { function Carousel(element, config) { _classCallCheck(this, Carousel); @@ -616,6 +625,8 @@ var Carousel = function ($) { this._isPaused = false; this._isSliding = false; + this.touchTimeout = null; + this._config = this._getConfig(config); this._element = $(element)[0]; this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0]; @@ -628,10 +639,9 @@ var Carousel = function ($) { // public Carousel.prototype.next = function next() { - if (this._isSliding) { - throw new Error('Carousel is sliding'); + if (!this._isSliding) { + this._slide(Direction.NEXT); } - this._slide(Direction.NEXT); }; Carousel.prototype.nextWhenVisible = function nextWhenVisible() { @@ -642,10 +652,9 @@ var Carousel = function ($) { }; Carousel.prototype.prev = function prev() { - if (this._isSliding) { - throw new Error('Carousel is sliding'); + if (!this._isSliding) { + this._slide(Direction.PREV); } - this._slide(Direction.PREVIOUS); }; Carousel.prototype.pause = function pause(event) { @@ -701,7 +710,7 @@ var Carousel = function ($) { return; } - var direction = index > activeIndex ? Direction.NEXT : Direction.PREVIOUS; + var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; this._slide(direction, this._items[index]); }; @@ -737,12 +746,30 @@ var Carousel = function ($) { }); } - if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) { + if (this._config.pause === 'hover') { $(this._element).on(Event.MOUSEENTER, function (event) { return _this4.pause(event); }).on(Event.MOUSELEAVE, function (event) { return _this4.cycle(event); }); + if ('ontouchstart' in document.documentElement) { + // if it's a touch-enabled device, mouseenter/leave are fired as + // part of the mouse compatibility events on first tap - the carousel + // would stop cycling until user tapped out of it; + // here, we listen for touchend, explicitly pause the carousel + // (as if it's the second time we tap on it, mouseenter compat event + // is NOT fired) and after a timeout (to allow for mouse compatibility + // events to fire) we explicitly restart cycling + $(this._element).on(Event.TOUCHEND, function () { + _this4.pause(); + if (_this4.touchTimeout) { + clearTimeout(_this4.touchTimeout); + } + _this4.touchTimeout = setTimeout(function (event) { + return _this4.cycle(event); + }, TOUCHEVENT_COMPAT_WAIT + _this4._config.interval); + }); + } } }; @@ -772,7 +799,7 @@ var Carousel = function ($) { Carousel.prototype._getItemByDirection = function _getItemByDirection(direction, activeElement) { var isNextDirection = direction === Direction.NEXT; - var isPrevDirection = direction === Direction.PREVIOUS; + var isPrevDirection = direction === Direction.PREV; var activeIndex = this._getItemIndex(activeElement); var lastItemIndex = this._items.length - 1; var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; @@ -781,16 +808,20 @@ var Carousel = function ($) { return activeElement; } - var delta = direction === Direction.PREVIOUS ? -1 : 1; + var delta = direction === Direction.PREV ? -1 : 1; var itemIndex = (activeIndex + delta) % this._items.length; return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; }; Carousel.prototype._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { + var targetIndex = this._getItemIndex(relatedTarget); + var fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0]); var slideEvent = $.Event(Event.SLIDE, { relatedTarget: relatedTarget, - direction: eventDirectionName + direction: eventDirectionName, + from: fromIndex, + to: targetIndex }); $(this._element).trigger(slideEvent); @@ -814,8 +845,9 @@ var Carousel = function ($) { var _this5 = this; var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + var activeElementIndex = this._getItemIndex(activeElement); var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); - + var nextElementIndex = this._getItemIndex(nextElement); var isCycling = Boolean(this._interval); var directionalClassName = void 0; @@ -857,7 +889,9 @@ var Carousel = function ($) { var slidEvent = $.Event(Event.SLID, { relatedTarget: nextElement, - direction: eventDirectionName + direction: eventDirectionName, + from: activeElementIndex, + to: nextElementIndex }); if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { @@ -1002,7 +1036,7 @@ var Carousel = function ($) { /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.6): collapse.js + * Bootstrap (v4.0.0-beta): collapse.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -1016,7 +1050,7 @@ var Collapse = function ($) { */ var NAME = 'collapse'; - var VERSION = '4.0.0-alpha.6'; + var VERSION = '4.0.0-beta'; var DATA_KEY = 'bs.collapse'; var EVENT_KEY = '.' + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -1054,16 +1088,16 @@ var Collapse = function ($) { }; var Selector = { - ACTIVES: '.card > .show, .card > .collapsing', + ACTIVES: '.show, .collapsing', DATA_TOGGLE: '[data-toggle="collapse"]' - }; - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; var Collapse = function () { function Collapse(element, config) { _classCallCheck(this, Collapse); @@ -1072,6 +1106,14 @@ var Collapse = function ($) { this._element = element; this._config = this._getConfig(config); this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]'))); + var tabToggles = $(Selector.DATA_TOGGLE); + for (var i = 0; i < tabToggles.length; i++) { + var elem = tabToggles[i]; + var selector = Util.getSelectorFromElement(elem); + if (selector !== null && $(selector).filter(element).length > 0) { + this._triggerArray.push(elem); + } + } this._parent = this._config.parent ? this._getParent() : null; @@ -1099,11 +1141,7 @@ var Collapse = function ($) { Collapse.prototype.show = function show() { var _this6 = this; - if (this._isTransitioning) { - throw new Error('Collapse is transitioning'); - } - - if ($(this._element).hasClass(ClassName.SHOW)) { + if (this._isTransitioning || $(this._element).hasClass(ClassName.SHOW)) { return; } @@ -1111,7 +1149,7 @@ var Collapse = function ($) { var activesData = void 0; if (this._parent) { - actives = $.makeArray($(this._parent).find(Selector.ACTIVES)); + actives = $.makeArray($(this._parent).children().children(Selector.ACTIVES)); if (!actives.length) { actives = null; } @@ -1142,7 +1180,6 @@ var Collapse = function ($) { $(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING); this._element.style[dimension] = 0; - this._element.setAttribute('aria-expanded', true); if (this._triggerArray.length) { $(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true); @@ -1176,11 +1213,7 @@ var Collapse = function ($) { Collapse.prototype.hide = function hide() { var _this7 = this; - if (this._isTransitioning) { - throw new Error('Collapse is transitioning'); - } - - if (!$(this._element).hasClass(ClassName.SHOW)) { + if (this._isTransitioning || !$(this._element).hasClass(ClassName.SHOW)) { return; } @@ -1191,18 +1224,24 @@ var Collapse = function ($) { } var dimension = this._getDimension(); - var offsetDimension = dimension === Dimension.WIDTH ? 'offsetWidth' : 'offsetHeight'; - this._element.style[dimension] = this._element[offsetDimension] + 'px'; + this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + 'px'; Util.reflow(this._element); $(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW); - this._element.setAttribute('aria-expanded', false); - if (this._triggerArray.length) { - $(this._triggerArray).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); + for (var i = 0; i < this._triggerArray.length; i++) { + var trigger = this._triggerArray[i]; + var selector = Util.getSelectorFromElement(trigger); + if (selector !== null) { + var $elem = $(selector); + if (!$elem.hasClass(ClassName.SHOW)) { + $(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false); + } + } + } } this.setTransitioning(true); @@ -1266,7 +1305,6 @@ var Collapse = function ($) { Collapse.prototype._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { if (element) { var isOpen = $(element).hasClass(ClassName.SHOW); - element.setAttribute('aria-expanded', isOpen); if (triggerArray.length) { $(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); @@ -1327,13 +1365,18 @@ var Collapse = function ($) { */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { - event.preventDefault(); - - var target = Collapse._getTargetFromElement(this); - var data = $(target).data(DATA_KEY); - var config = data ? 'toggle' : $(this).data(); + if (!/input|textarea/i.test(event.target.tagName)) { + event.preventDefault(); + } - Collapse._jQueryInterface.call($(target), config); + var $trigger = $(this); + var selector = Util.getSelectorFromElement(this); + $(selector).each(function () { + var $target = $(this); + var data = $target.data(DATA_KEY); + var config = data ? 'toggle' : $trigger.data(); + Collapse._jQueryInterface.call($target, config); + }); }); /** @@ -1352,15 +1395,25 @@ var Collapse = function ($) { return Collapse; }(jQuery); +/* global Popper */ + /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.6): dropdown.js + * Bootstrap (v4.0.0-beta): dropdown.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ var Dropdown = function ($) { + /** + * Check for Popper dependency + * Popper - https://popper.js.org + */ + if (typeof Popper === 'undefined') { + throw new Error('Bootstrap dropdown require Popper.js (https://popper.js.org)'); + } + /** * ------------------------------------------------------------------------ * Constants @@ -1368,15 +1421,18 @@ var Dropdown = function ($) { */ var NAME = 'dropdown'; - var VERSION = '4.0.0-alpha.6'; + var VERSION = '4.0.0-beta'; var DATA_KEY = 'bs.dropdown'; var EVENT_KEY = '.' + DATA_KEY; var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key + var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key + var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) + var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + '|' + ARROW_DOWN_KEYCODE + '|' + ESCAPE_KEYCODE); var Event = { HIDE: 'hide' + EVENT_KEY, @@ -1385,37 +1441,60 @@ var Dropdown = function ($) { SHOWN: 'shown' + EVENT_KEY, CLICK: 'click' + EVENT_KEY, CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY, - FOCUSIN_DATA_API: 'focusin' + EVENT_KEY + DATA_API_KEY, - KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY + KEYDOWN_DATA_API: 'keydown' + EVENT_KEY + DATA_API_KEY, + KEYUP_DATA_API: 'keyup' + EVENT_KEY + DATA_API_KEY }; var ClassName = { - BACKDROP: 'dropdown-backdrop', DISABLED: 'disabled', - SHOW: 'show' + SHOW: 'show', + DROPUP: 'dropup', + MENURIGHT: 'dropdown-menu-right', + MENULEFT: 'dropdown-menu-left' }; var Selector = { - BACKDROP: '.dropdown-backdrop', DATA_TOGGLE: '[data-toggle="dropdown"]', FORM_CHILD: '.dropdown form', - ROLE_MENU: '[role="menu"]', - ROLE_LISTBOX: '[role="listbox"]', + MENU: '.dropdown-menu', NAVBAR_NAV: '.navbar-nav', - VISIBLE_ITEMS: '[role="menu"] li:not(.disabled) a, ' + '[role="listbox"] li:not(.disabled) a' + VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled)' }; - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ + var AttachmentMap = { + TOP: 'top-start', + TOPEND: 'top-end', + BOTTOM: 'bottom-start', + BOTTOMEND: 'bottom-end' + }; + + var Default = { + placement: AttachmentMap.BOTTOM, + offset: 0, + flip: true + }; + + var DefaultType = { + placement: 'string', + offset: '(number|string)', + flip: 'boolean' + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + + }; var Dropdown = function () { - function Dropdown(element) { + function Dropdown(element, config) { _classCallCheck(this, Dropdown); this._element = element; + this._popper = null; + this._config = this._getConfig(config); + this._menu = this._getMenuElement(); + this._inNavbar = this._detectNavbar(); this._addEventListeners(); } @@ -1425,58 +1504,144 @@ var Dropdown = function ($) { // public Dropdown.prototype.toggle = function toggle() { - if (this.disabled || $(this).hasClass(ClassName.DISABLED)) { - return false; + if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) { + return; } - var parent = Dropdown._getParentFromElement(this); - var isActive = $(parent).hasClass(ClassName.SHOW); + var parent = Dropdown._getParentFromElement(this._element); + var isActive = $(this._menu).hasClass(ClassName.SHOW); Dropdown._clearMenus(); if (isActive) { - return false; - } - - if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) { - - // if mobile we use a backdrop because click events don't delegate - var dropdown = document.createElement('div'); - dropdown.className = ClassName.BACKDROP; - $(dropdown).insertBefore(this); - $(dropdown).on('click', Dropdown._clearMenus); + return; } var relatedTarget = { - relatedTarget: this + relatedTarget: this._element }; var showEvent = $.Event(Event.SHOW, relatedTarget); $(parent).trigger(showEvent); if (showEvent.isDefaultPrevented()) { - return false; + return; } - this.focus(); - this.setAttribute('aria-expanded', true); + var element = this._element; + // for dropup with alignment we use the parent as popper container + if ($(parent).hasClass(ClassName.DROPUP)) { + if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) { + element = parent; + } + } + this._popper = new Popper(element, this._menu, this._getPopperConfig()); + + // if this is a touch-enabled device we add extra + // empty mouseover listeners to the body's immediate children; + // only needed because of broken event delegation on iOS + // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html + if ('ontouchstart' in document.documentElement && !$(parent).closest(Selector.NAVBAR_NAV).length) { + $('body').children().on('mouseover', null, $.noop); + } - $(parent).toggleClass(ClassName.SHOW); - $(parent).trigger($.Event(Event.SHOWN, relatedTarget)); + this._element.focus(); + this._element.setAttribute('aria-expanded', true); - return false; + $(this._menu).toggleClass(ClassName.SHOW); + $(parent).toggleClass(ClassName.SHOW).trigger($.Event(Event.SHOWN, relatedTarget)); }; Dropdown.prototype.dispose = function dispose() { $.removeData(this._element, DATA_KEY); $(this._element).off(EVENT_KEY); this._element = null; + this._menu = null; + if (this._popper !== null) { + this._popper.destroy(); + } + this._popper = null; + }; + + Dropdown.prototype.update = function update() { + this._inNavbar = this._detectNavbar(); + if (this._popper !== null) { + this._popper.scheduleUpdate(); + } }; // private Dropdown.prototype._addEventListeners = function _addEventListeners() { - $(this._element).on(Event.CLICK, this.toggle); + var _this9 = this; + + $(this._element).on(Event.CLICK, function (event) { + event.preventDefault(); + event.stopPropagation(); + _this9.toggle(); + }); + }; + + Dropdown.prototype._getConfig = function _getConfig(config) { + var elementData = $(this._element).data(); + if (elementData.placement !== undefined) { + elementData.placement = AttachmentMap[elementData.placement.toUpperCase()]; + } + + config = $.extend({}, this.constructor.Default, $(this._element).data(), config); + + Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); + + return config; + }; + + Dropdown.prototype._getMenuElement = function _getMenuElement() { + if (!this._menu) { + var parent = Dropdown._getParentFromElement(this._element); + this._menu = $(parent).find(Selector.MENU)[0]; + } + return this._menu; + }; + + Dropdown.prototype._getPlacement = function _getPlacement() { + var $parentDropdown = $(this._element).parent(); + var placement = this._config.placement; + + // Handle dropup + if ($parentDropdown.hasClass(ClassName.DROPUP) || this._config.placement === AttachmentMap.TOP) { + placement = AttachmentMap.TOP; + if ($(this._menu).hasClass(ClassName.MENURIGHT)) { + placement = AttachmentMap.TOPEND; + } + } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) { + placement = AttachmentMap.BOTTOMEND; + } + return placement; + }; + + Dropdown.prototype._detectNavbar = function _detectNavbar() { + return $(this._element).closest('.navbar').length > 0; + }; + + Dropdown.prototype._getPopperConfig = function _getPopperConfig() { + var popperConfig = { + placement: this._getPlacement(), + modifiers: { + offset: { + offset: this._config.offset + }, + flip: { + enabled: this._config.flip + } + } + + // Disable Popper.js for Dropdown in Navbar + };if (this._inNavbar) { + popperConfig.modifiers.applyStyle = { + enabled: !this._inNavbar + }; + } + return popperConfig; }; // static @@ -1484,9 +1649,10 @@ var Dropdown = function ($) { Dropdown._jQueryInterface = function _jQueryInterface(config) { return this.each(function () { var data = $(this).data(DATA_KEY); + var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null; if (!data) { - data = new Dropdown(this); + data = new Dropdown(this, _config); $(this).data(DATA_KEY, data); } @@ -1494,34 +1660,34 @@ var Dropdown = function ($) { if (data[config] === undefined) { throw new Error('No method named "' + config + '"'); } - data[config].call(this); + data[config](); } }); }; Dropdown._clearMenus = function _clearMenus(event) { - if (event && event.which === RIGHT_MOUSE_BUTTON_WHICH) { + if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { return; } - var backdrop = $(Selector.BACKDROP)[0]; - if (backdrop) { - backdrop.parentNode.removeChild(backdrop); - } - var toggles = $.makeArray($(Selector.DATA_TOGGLE)); - for (var i = 0; i < toggles.length; i++) { var parent = Dropdown._getParentFromElement(toggles[i]); + var context = $(toggles[i]).data(DATA_KEY); var relatedTarget = { relatedTarget: toggles[i] }; + if (!context) { + continue; + } + + var dropdownMenu = context._menu; if (!$(parent).hasClass(ClassName.SHOW)) { continue; } - if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'focusin') && $.contains(parent, event.target)) { + if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) { continue; } @@ -1531,8 +1697,15 @@ var Dropdown = function ($) { continue; } + // if this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + if ('ontouchstart' in document.documentElement) { + $('body').children().off('mouseover', null, $.noop); + } + toggles[i].setAttribute('aria-expanded', 'false'); + $(dropdownMenu).removeClass(ClassName.SHOW); $(parent).removeClass(ClassName.SHOW).trigger($.Event(Event.HIDDEN, relatedTarget)); } }; @@ -1549,7 +1722,7 @@ var Dropdown = function ($) { }; Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { - if (!/(38|40|27|32)/.test(event.which) || /input|textarea/i.test(event.target.tagName)) { + if (!REGEXP_KEYDOWN.test(event.which) || /button/i.test(event.target.tagName) && event.which === SPACE_KEYCODE || /input|textarea/i.test(event.target.tagName)) { return; } @@ -1563,7 +1736,7 @@ var Dropdown = function ($) { var parent = Dropdown._getParentFromElement(this); var isActive = $(parent).hasClass(ClassName.SHOW); - if (!isActive && event.which !== ESCAPE_KEYCODE || isActive && event.which === ESCAPE_KEYCODE) { + if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { if (event.which === ESCAPE_KEYCODE) { var toggle = $(parent).find(Selector.DATA_TOGGLE)[0]; @@ -1604,6 +1777,16 @@ var Dropdown = function ($) { get: function get() { return VERSION; } + }, { + key: 'Default', + get: function get() { + return Default; + } + }, { + key: 'DefaultType', + get: function get() { + return DefaultType; + } }]); return Dropdown; @@ -1615,7 +1798,11 @@ var Dropdown = function ($) { * ------------------------------------------------------------------------ */ - $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_MENU, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.ROLE_LISTBOX, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + ' ' + Event.FOCUSIN_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, Dropdown.prototype.toggle).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { + $(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + ' ' + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { + event.preventDefault(); + event.stopPropagation(); + Dropdown._jQueryInterface.call($(this), 'toggle'); + }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { e.stopPropagation(); }); @@ -1637,7 +1824,7 @@ var Dropdown = function ($) { /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.6): modal.js + * Bootstrap (v4.0.0-beta): modal.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -1651,7 +1838,7 @@ var Modal = function ($) { */ var NAME = 'modal'; - var VERSION = '4.0.0-alpha.6'; + var VERSION = '4.0.0-beta'; var DATA_KEY = 'bs.modal'; var EVENT_KEY = '.' + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -1700,15 +1887,16 @@ var Modal = function ($) { DIALOG: '.modal-dialog', DATA_TOGGLE: '[data-toggle="modal"]', DATA_DISMISS: '[data-dismiss="modal"]', - FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top' - }; + FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', + NAVBAR_TOGGLER: '.navbar-toggler' - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; var Modal = function () { function Modal(element, config) { _classCallCheck(this, Modal); @@ -1720,7 +1908,6 @@ var Modal = function ($) { this._isShown = false; this._isBodyOverflowing = false; this._ignoreBackdropClick = false; - this._isTransitioning = false; this._originalBodyPadding = 0; this._scrollbarWidth = 0; } @@ -1734,15 +1921,16 @@ var Modal = function ($) { }; Modal.prototype.show = function show(relatedTarget) { - var _this9 = this; + var _this10 = this; if (this._isTransitioning) { - throw new Error('Modal is transitioning'); + return; } if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) { this._isTransitioning = true; } + var showEvent = $.Event(Event.SHOW, { relatedTarget: relatedTarget }); @@ -1764,39 +1952,41 @@ var Modal = function ($) { this._setResizeEvent(); $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) { - return _this9.hide(event); + return _this10.hide(event); }); $(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () { - $(_this9._element).one(Event.MOUSEUP_DISMISS, function (event) { - if ($(event.target).is(_this9._element)) { - _this9._ignoreBackdropClick = true; + $(_this10._element).one(Event.MOUSEUP_DISMISS, function (event) { + if ($(event.target).is(_this10._element)) { + _this10._ignoreBackdropClick = true; } }); }); this._showBackdrop(function () { - return _this9._showElement(relatedTarget); + return _this10._showElement(relatedTarget); }); }; Modal.prototype.hide = function hide(event) { - var _this10 = this; + var _this11 = this; if (event) { event.preventDefault(); } - if (this._isTransitioning) { - throw new Error('Modal is transitioning'); + if (this._isTransitioning || !this._isShown) { + return; } var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); + if (transition) { this._isTransitioning = true; } var hideEvent = $.Event(Event.HIDE); + $(this._element).trigger(hideEvent); if (!this._isShown || hideEvent.isDefaultPrevented()) { @@ -1816,8 +2006,9 @@ var Modal = function ($) { $(this._dialog).off(Event.MOUSEDOWN_DISMISS); if (transition) { + $(this._element).one(Util.TRANSITION_END, function (event) { - return _this10._hideModal(event); + return _this11._hideModal(event); }).emulateTransitionEnd(TRANSITION_DURATION); } else { this._hideModal(); @@ -1836,10 +2027,13 @@ var Modal = function ($) { this._isShown = null; this._isBodyOverflowing = null; this._ignoreBackdropClick = null; - this._originalBodyPadding = null; this._scrollbarWidth = null; }; + Modal.prototype.handleUpdate = function handleUpdate() { + this._adjustDialog(); + }; + // private Modal.prototype._getConfig = function _getConfig(config) { @@ -1849,7 +2043,7 @@ var Modal = function ($) { }; Modal.prototype._showElement = function _showElement(relatedTarget) { - var _this11 = this; + var _this12 = this; var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE); @@ -1877,11 +2071,11 @@ var Modal = function ($) { }); var transitionComplete = function transitionComplete() { - if (_this11._config.focus) { - _this11._element.focus(); + if (_this12._config.focus) { + _this12._element.focus(); } - _this11._isTransitioning = false; - $(_this11._element).trigger(shownEvent); + _this12._isTransitioning = false; + $(_this12._element).trigger(shownEvent); }; if (transition) { @@ -1892,23 +2086,24 @@ var Modal = function ($) { }; Modal.prototype._enforceFocus = function _enforceFocus() { - var _this12 = this; + var _this13 = this; $(document).off(Event.FOCUSIN) // guard against infinite focus loop .on(Event.FOCUSIN, function (event) { - if (document !== event.target && _this12._element !== event.target && !$(_this12._element).has(event.target).length) { - _this12._element.focus(); + if (document !== event.target && _this13._element !== event.target && !$(_this13._element).has(event.target).length) { + _this13._element.focus(); } }); }; Modal.prototype._setEscapeEvent = function _setEscapeEvent() { - var _this13 = this; + var _this14 = this; if (this._isShown && this._config.keyboard) { $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { if (event.which === ESCAPE_KEYCODE) { - _this13.hide(); + event.preventDefault(); + _this14.hide(); } }); } else if (!this._isShown) { @@ -1917,11 +2112,11 @@ var Modal = function ($) { }; Modal.prototype._setResizeEvent = function _setResizeEvent() { - var _this14 = this; + var _this15 = this; if (this._isShown) { $(window).on(Event.RESIZE, function (event) { - return _this14._handleUpdate(event); + return _this15.handleUpdate(event); }); } else { $(window).off(Event.RESIZE); @@ -1929,16 +2124,16 @@ var Modal = function ($) { }; Modal.prototype._hideModal = function _hideModal() { - var _this15 = this; + var _this16 = this; this._element.style.display = 'none'; - this._element.setAttribute('aria-hidden', 'true'); + this._element.setAttribute('aria-hidden', true); this._isTransitioning = false; this._showBackdrop(function () { $(document.body).removeClass(ClassName.OPEN); - _this15._resetAdjustments(); - _this15._resetScrollbar(); - $(_this15._element).trigger(Event.HIDDEN); + _this16._resetAdjustments(); + _this16._resetScrollbar(); + $(_this16._element).trigger(Event.HIDDEN); }); }; @@ -1950,7 +2145,7 @@ var Modal = function ($) { }; Modal.prototype._showBackdrop = function _showBackdrop(callback) { - var _this16 = this; + var _this17 = this; var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : ''; @@ -1967,17 +2162,17 @@ var Modal = function ($) { $(this._backdrop).appendTo(document.body); $(this._element).on(Event.CLICK_DISMISS, function (event) { - if (_this16._ignoreBackdropClick) { - _this16._ignoreBackdropClick = false; + if (_this17._ignoreBackdropClick) { + _this17._ignoreBackdropClick = false; return; } if (event.target !== event.currentTarget) { return; } - if (_this16._config.backdrop === 'static') { - _this16._element.focus(); + if (_this17._config.backdrop === 'static') { + _this17._element.focus(); } else { - _this16.hide(); + _this17.hide(); } }); @@ -2001,7 +2196,7 @@ var Modal = function ($) { $(this._backdrop).removeClass(ClassName.SHOW); var callbackRemove = function callbackRemove() { - _this16._removeBackdrop(); + _this17._removeBackdrop(); if (callback) { callback(); } @@ -2022,10 +2217,6 @@ var Modal = function ($) { // todo (fat): these should probably be refactored out of modal.js // ---------------------------------------------------------------------- - Modal.prototype._handleUpdate = function _handleUpdate() { - this._adjustDialog(); - }; - Modal.prototype._adjustDialog = function _adjustDialog() { var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; @@ -2049,17 +2240,55 @@ var Modal = function ($) { }; Modal.prototype._setScrollbar = function _setScrollbar() { - var bodyPadding = parseInt($(Selector.FIXED_CONTENT).css('padding-right') || 0, 10); - - this._originalBodyPadding = document.body.style.paddingRight || ''; + var _this18 = this; if (this._isBodyOverflowing) { - document.body.style.paddingRight = bodyPadding + this._scrollbarWidth + 'px'; + // Note: DOMNode.style.paddingRight returns the actual value or '' if not set + // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set + + // Adjust fixed content padding + $(Selector.FIXED_CONTENT).each(function (index, element) { + var actualPadding = $(element)[0].style.paddingRight; + var calculatedPadding = $(element).css('padding-right'); + $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this18._scrollbarWidth + 'px'); + }); + + // Adjust navbar-toggler margin + $(Selector.NAVBAR_TOGGLER).each(function (index, element) { + var actualMargin = $(element)[0].style.marginRight; + var calculatedMargin = $(element).css('margin-right'); + $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this18._scrollbarWidth + 'px'); + }); + + // Adjust body padding + var actualPadding = document.body.style.paddingRight; + var calculatedPadding = $('body').css('padding-right'); + $('body').data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + 'px'); } }; Modal.prototype._resetScrollbar = function _resetScrollbar() { - document.body.style.paddingRight = this._originalBodyPadding; + // Restore fixed content padding + $(Selector.FIXED_CONTENT).each(function (index, element) { + var padding = $(element).data('padding-right'); + if (typeof padding !== 'undefined') { + $(element).css('padding-right', padding).removeData('padding-right'); + } + }); + + // Restore navbar-toggler margin + $(Selector.NAVBAR_TOGGLER).each(function (index, element) { + var margin = $(element).data('margin-right'); + if (typeof margin !== 'undefined') { + $(element).css('margin-right', margin).removeData('margin-right'); + } + }); + + // Restore body padding + var padding = $('body').data('padding-right'); + if (typeof padding !== 'undefined') { + $('body').css('padding-right', padding).removeData('padding-right'); + } }; Modal.prototype._getScrollbarWidth = function _getScrollbarWidth() { @@ -2067,7 +2296,7 @@ var Modal = function ($) { var scrollDiv = document.createElement('div'); scrollDiv.className = ClassName.SCROLLBAR_MEASURER; document.body.appendChild(scrollDiv); - var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; + var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); return scrollbarWidth; }; @@ -2117,7 +2346,7 @@ var Modal = function ($) { */ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { - var _this17 = this; + var _this19 = this; var target = void 0; var selector = Util.getSelectorFromElement(this); @@ -2139,8 +2368,8 @@ var Modal = function ($) { } $target.one(Event.HIDDEN, function () { - if ($(_this17).is(':visible')) { - _this17.focus(); + if ($(_this19).is(':visible')) { + _this19.focus(); } }); }); @@ -2166,7 +2395,7 @@ var Modal = function ($) { /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0-alpha.6): scrollspy.js + * Bootstrap (v4.0.0-beta): scrollspy.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -2180,7 +2409,7 @@ var ScrollSpy = function ($) { */ var NAME = 'scrollspy'; - var VERSION = '4.0.0-alpha.6'; + var VERSION = '4.0.0-beta'; var DATA_KEY = 'bs.scrollspy'; var EVENT_KEY = '.' + DATA_KEY; var DATA_API_KEY = '.data-api'; @@ -2207,18 +2436,15 @@ var ScrollSpy = function ($) { var ClassName = { DROPDOWN_ITEM: 'dropdown-item', DROPDOWN_MENU: 'dropdown-menu', - NAV_LINK: 'nav-link', - NAV: 'nav', ACTIVE: 'active' }; var Selector = { DATA_SPY: '[data-spy="scroll"]', ACTIVE: '.active', - LIST_ITEM: '.list-item', - LI: 'li', - LI_DROPDOWN: 'li.dropdown', + NAV_LIST_GROUP: '.nav, .list-group', NAV_LINKS: '.nav-link', + LIST_ITEMS: '.list-group-item', DROPDOWN: '.dropdown', DROPDOWN_ITEMS: '.dropdown-item', DROPDOWN_TOGGLE: '.dropdown-toggle' @@ -2227,31 +2453,31 @@ var ScrollSpy = function ($) { var OffsetMethod = { OFFSET: 'offset', POSITION: 'position' - }; - /** - * ------------------------------------------------------------------------ - * Class Definition - * ------------------------------------------------------------------------ - */ + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + }; var ScrollSpy = function () { function ScrollSpy(element, config) { - var _this18 = this; + var _this20 = this; _classCallCheck(this, ScrollSpy); this._element = element; this._scrollElement = element.tagName === 'BODY' ? window : element; this._config = this._getConfig(config); - this._selector = this._config.target + ' ' + Selector.NAV_LINKS + ',' + (this._config.target + ' ' + Selector.DROPDOWN_ITEMS); + this._selector = this._config.target + ' ' + Selector.NAV_LINKS + ',' + (this._config.target + ' ' + Selector.LIST_ITEMS + ',') + (this._config.target + ' ' + Selector.DROPDOWN_ITEMS); this._offsets = []; this._targets = []; this._activeTarget = null; this._scrollHeight = 0; $(this._scrollElement).on(Event.SCROLL, function (event) { - return _this18._process(event); + return _this20._process(event); }); this.refresh(); @@ -2263,7 +2489,7 @@ var ScrollSpy = function ($) { // public ScrollSpy.prototype.refresh = function refresh() { - var _this19 = this; + var _this21 = this; var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET; @@ -2286,9 +2512,12 @@ var ScrollSpy = function ($) { target = $(targetSelector)[0]; } - if (target && (target.offsetWidth || target.offsetHeight)) { - // todo (fat): remove sketch reliance on jQuery position/offset - return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; + if (target) { + var targetBCR = target.getBoundingClientRect(); + if (targetBCR.width || targetBCR.height) { + // todo (fat): remove sketch reliance on jQuery position/offset + return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; + } } return null; }).filter(function (item) { @@ -2296,8 +2525,8 @@ var ScrollSpy = function ($) { }).sort(function (a, b) { return a[0] - b[0]; }).forEach(function (item) { - _this19._offsets.push(item[0]); - _this19._targets.push(item[1]); + _this21._offsets.push(item[0]); + _this21._targets.push(item[1]); }); }; @@ -2343,7 +2572,7 @@ var ScrollSpy = function ($) { }; ScrollSpy.prototype._getOffsetHeight = function _getOffsetHeight() { - return this._scrollElement === window ? window.innerHeight : this._scrollElement.offsetHeight; + return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; }; ScrollSpy.prototype._process = function _process() { @@ -2395,9 +2624,11 @@ var ScrollSpy = function ($) { $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE); $link.addClass(ClassName.ACTIVE); } else { - // todo (fat) this is kinda sus... - // recursively add actives to tested nav-links - $link.parents(Selector.LI).find('> ' + Selector.NAV_LINKS).addClass(ClassName.ACTIVE); + // Set triggered link as active + $link.addClass(ClassName.ACTIVE); + // Set triggered links parents as active + // With both
` content to break out of wrapping code snippets + // Don't allow content to break outside overflow: auto; } @@ -210,33 +245,22 @@ pre { // figure { - // Normalize adds `margin` to `figure`s as browsers apply it inconsistently. - // We reset that to create a better flow in-page. + // Apply a consistent margin strategy (matches our type styles). margin: 0 0 1rem; } // -// Images +// Images and content // img { - // By default, ``s are `inline-block`. This assumes that, and vertically - // centers them. This won't apply should you reset them to `block` level. vertical-align: middle; - // Note: ``s are deliberately not made responsive by default. - // For the rationale behind this, see the comments on the `.img-fluid` class. + border-style: none; // Remove the border on images inside links in IE 10-. } - -// iOS "clickable elements" fix for role="button" -// -// Fixes "clickability" issue (and more generally, the firing of events such as focus as well) -// for traditionally non-focusable elements with role="button" -// see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile - -[role="button"] { - cursor: pointer; +svg:not(:root) { + overflow: hidden; // Hide the overflow in IE } @@ -268,10 +292,7 @@ textarea { // table { - // No longer part of Normalize since v4 - border-collapse: collapse; - // Reset for nesting within parents with `background-color`. - background-color: $table-bg; + border-collapse: collapse; // Prevent double borders } caption { @@ -283,7 +304,7 @@ caption { } th { - // Centered by default, but left-align-ed to match the `td`s below. + // Matches default `` alignment text-align: left; } @@ -310,20 +331,47 @@ button:focus { input, button, select, +optgroup, textarea { - // Normalize includes `font: inherit;`, so `font-family`. `font-size`, etc are - // properly inherited. However, `line-height` isn't inherited there. + margin: 0; // Remove the margin in Firefox and Safari + font-family: inherit; + font-size: inherit; line-height: inherit; } +button, +input { + overflow: visible; // Show the overflow in Edge +} + +button, +select { + text-transform: none; // Remove the inheritance of text transform in Firefox +} + +// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` +// controls in Android 4. +// 2. Correct the inability to style clickable types in iOS and Safari. +button, +html [type="button"], // 1 +[type="reset"], +[type="submit"] { + -webkit-appearance: button; // 2 +} + +// Remove inner border and padding from Firefox, but don't restore the outline like Normalize. +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + padding: 0; + border-style: none; +} + input[type="radio"], input[type="checkbox"] { - // Apply a disabled cursor for radios and checkboxes. - // - // Note: Neither radios nor checkboxes can be readonly. - &:disabled { - cursor: $cursor-disabled; - } + box-sizing: border-box; // 1. Add the correct box sizing in IE 10- + padding: 0; // 2. Remove the padding in IE 10- } @@ -340,6 +388,7 @@ input[type="month"] { } textarea { + overflow: auto; // Remove the default vertical scrollbar in IE. // Textareas should really only resize vertically so they don't break their (horizontal) containers. resize: vertical; } @@ -357,33 +406,76 @@ fieldset { border: 0; } +// 1. Correct the text wrapping in Edge and IE. +// 2. Correct the color inheritance from `fieldset` elements in IE. legend { - // Reset the entire legend element to match the `fieldset` display: block; width: 100%; + max-width: 100%; // 1 padding: 0; margin-bottom: .5rem; font-size: 1.5rem; line-height: inherit; + color: inherit; // 2 + white-space: normal; // 1 +} + +progress { + vertical-align: baseline; // Add the correct vertical alignment in Chrome, Firefox, and Opera. +} + +// Correct the cursor style of increment and decrement buttons in Chrome. +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; } -input[type="search"] { +[type="search"] { // This overrides the extra rounded corners on search inputs in iOS so that our // `.form-control` class can properly style them. Note that this cannot simply // be added to `.form-control` as it's not specific enough. For details, see // https://github.com/twbs/bootstrap/issues/11586. + outline-offset: -2px; // 2. Correct the outline style in Safari. + -webkit-appearance: none; +} + +// +// Remove the inner padding and cancel buttons in Chrome and Safari on macOS. +// + +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } -// todo: needed? +// +// 1. Correct the inability to style clickable types in iOS and Safari. +// 2. Change font properties to `inherit` in Safari. +// + +::-webkit-file-upload-button { + font: inherit; // 2 + -webkit-appearance: button; // 1 +} + +// +// Correct element displays +// + output { display: inline-block; -// font-size: $font-size-base; -// line-height: $line-height; -// color: $input-color; +} + +summary { + display: list-item; // Add the correct display in all browsers +} + +template { + display: none; // Add the correct display in IE } // Always hide an element with the `hidden` HTML attribute (from PureCSS). +// Needed for proper display in IE 10-. [hidden] { display: none !important; } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_tables.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_tables.scss index 47be2c50847..a652d17c5fa 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_tables.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_tables.scss @@ -6,6 +6,7 @@ width: 100%; max-width: 100%; margin-bottom: $spacer; + background-color: $table-bg; // Reset for nesting within parents with `background-color`. th, td { @@ -36,7 +37,7 @@ .table-sm { th, td { - padding: $table-sm-cell-padding; + padding: $table-cell-padding-sm; } } @@ -68,7 +69,7 @@ .table-striped { tbody tr:nth-of-type(odd) { - background-color: $table-bg-accent; + background-color: $table-accent-bg; } } @@ -80,7 +81,7 @@ .table-hover { tbody tr { @include hover { - background-color: $table-bg-hover; + background-color: $table-hover-bg; } } } @@ -91,12 +92,11 @@ // Exact selectors below required to override `.table-striped` and prevent // inheritance to nested tables. -// Generate the contextual variants -@include table-row-variant(active, $table-bg-active); -@include table-row-variant(success, $state-success-bg); -@include table-row-variant(info, $state-info-bg); -@include table-row-variant(warning, $state-warning-bg); -@include table-row-variant(danger, $state-danger-bg); +@each $color, $value in $theme-colors { + @include table-row-variant($color, theme-color-level($color, -9)); +} + +@include table-row-variant(active, $table-active-bg); // Inverse styles @@ -124,14 +124,27 @@ th, td, thead th { - border-color: $body-bg; + border-color: $table-inverse-border-color; } &.table-bordered { border: 0; } -} + &.table-striped { + tbody tr:nth-of-type(odd) { + background-color: $table-inverse-accent-bg; + } + } + + &.table-hover { + tbody tr { + @include hover { + background-color: $table-inverse-hover-bg; + } + } + } +} // Responsive tables @@ -141,13 +154,15 @@ // will display normally. .table-responsive { - display: block; - width: 100%; - overflow-x: auto; - -ms-overflow-style: -ms-autohiding-scrollbar; // See https://github.com/twbs/bootstrap/pull/10057 - - // Prevent double border on horizontal scroll due to use of `display: block;` - &.table-bordered { - border: 0; + @include media-breakpoint-down(md) { + display: block; + width: 100%; + overflow-x: auto; + -ms-overflow-style: -ms-autohiding-scrollbar; // See https://github.com/twbs/bootstrap/pull/10057 + + // Prevent double border on horizontal scroll due to use of `display: block;` + &.table-bordered { + border: 0; + } } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_tooltip.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_tooltip.scss index 24e198d464e..fe97fbbbd0d 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_tooltip.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_tooltip.scss @@ -3,6 +3,7 @@ position: absolute; z-index: $zindex-tooltip; display: block; + margin: $tooltip-margin; // Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element. // So reset our font and text properties to avoid inheriting weird values. @include reset-text(); @@ -13,62 +14,86 @@ &.show { opacity: $tooltip-opacity; } - &.tooltip-top, - &.bs-tether-element-attached-bottom { - padding: $tooltip-arrow-width 0; - margin-top: -$tooltip-margin; + .arrow { + position: absolute; + display: block; + width: $tooltip-arrow-width; + height: $tooltip-arrow-height; + } - .tooltip-inner::before { + &.bs-tooltip-top { + padding: $tooltip-arrow-width 0; + .arrow { bottom: 0; - left: 50%; - margin-left: -$tooltip-arrow-width; + } + + .arrow::before { + margin-left: -($tooltip-arrow-width - 2); content: ""; border-width: $tooltip-arrow-width $tooltip-arrow-width 0; border-top-color: $tooltip-arrow-color; } } - &.tooltip-right, - &.bs-tether-element-attached-left { + &.bs-tooltip-right { padding: 0 $tooltip-arrow-width; - margin-left: $tooltip-margin; - - .tooltip-inner::before { - top: 50%; + .arrow { left: 0; - margin-top: -$tooltip-arrow-width; + } + + .arrow::before { + margin-top: -($tooltip-arrow-width - 2); content: ""; border-width: $tooltip-arrow-width $tooltip-arrow-width $tooltip-arrow-width 0; border-right-color: $tooltip-arrow-color; } } - &.tooltip-bottom, - &.bs-tether-element-attached-top { + &.bs-tooltip-bottom { padding: $tooltip-arrow-width 0; - margin-top: $tooltip-margin; - - .tooltip-inner::before { + .arrow { top: 0; - left: 50%; - margin-left: -$tooltip-arrow-width; + } + + .arrow::before { + margin-left: -($tooltip-arrow-width - 2); content: ""; border-width: 0 $tooltip-arrow-width $tooltip-arrow-width; border-bottom-color: $tooltip-arrow-color; } } - &.tooltip-left, - &.bs-tether-element-attached-right { + &.bs-tooltip-left { padding: 0 $tooltip-arrow-width; - margin-left: -$tooltip-margin; + .arrow { + right: 0; + } - .tooltip-inner::before { - top: 50%; + .arrow::before { right: 0; - margin-top: -$tooltip-arrow-width; + margin-top: -($tooltip-arrow-width - 2); content: ""; border-width: $tooltip-arrow-width 0 $tooltip-arrow-width $tooltip-arrow-width; border-left-color: $tooltip-arrow-color; } } + &.bs-tooltip-auto { + &[x-placement^="top"] { + @extend .bs-tooltip-top; + } + &[x-placement^="right"] { + @extend .bs-tooltip-right; + } + &[x-placement^="bottom"] { + @extend .bs-tooltip-bottom; + } + &[x-placement^="left"] { + @extend .bs-tooltip-left; + } + } + + .arrow::before { + position: absolute; + border-color: transparent; + border-style: solid; + } } // Wrapper for the tooltip content @@ -79,12 +104,4 @@ text-align: center; background-color: $tooltip-bg; @include border-radius($border-radius); - - &::before { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_type.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_type.scss index 13a64b06f38..8928341da88 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_type.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_type.scss @@ -11,12 +11,12 @@ h1, h2, h3, h4, h5, h6, color: $headings-color; } -h1, .h1 { font-size: $font-size-h1; } -h2, .h2 { font-size: $font-size-h2; } -h3, .h3 { font-size: $font-size-h3; } -h4, .h4 { font-size: $font-size-h4; } -h5, .h5 { font-size: $font-size-h5; } -h6, .h6 { font-size: $font-size-h6; } +h1, .h1 { font-size: $h1-font-size; } +h2, .h2 { font-size: $h2-font-size; } +h3, .h3 { font-size: $h3-font-size; } +h4, .h4 { font-size: $h4-font-size; } +h5, .h5 { font-size: $h5-font-size; } +h6, .h6 { font-size: $h6-font-size; } .lead { font-size: $lead-font-size; @@ -51,8 +51,8 @@ h6, .h6 { font-size: $font-size-h6; } // hr { - margin-top: $spacer-y; - margin-bottom: $spacer-y; + margin-top: 1rem; + margin-bottom: 1rem; border: 0; border-top: $hr-border-width solid $hr-border-color; } @@ -108,10 +108,8 @@ mark, // Blockquotes .blockquote { - padding: ($spacer / 2) $spacer; margin-bottom: $spacer; font-size: $blockquote-font-size; - border-left: $blockquote-border-width solid $blockquote-border-color; } .blockquote-footer { @@ -123,21 +121,3 @@ mark, content: "\2014 \00A0"; // em dash, nbsp } } - -// Opposite alignment of blockquote -.blockquote-reverse { - padding-right: $spacer; - padding-left: 0; - text-align: right; - border-right: $blockquote-border-width solid $blockquote-border-color; - border-left: 0; -} - -.blockquote-reverse .blockquote-footer { - &::before { - content: ""; - } - &::after { - content: "\00A0 \2014"; // nbsp, em dash - } -} diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_utilities.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_utilities.scss index 7d08ff2f8ca..7b2a1ebe9d0 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_utilities.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_utilities.scss @@ -3,6 +3,7 @@ @import "utilities/borders"; @import "utilities/clearfix"; @import "utilities/display"; +@import "utilities/embed"; @import "utilities/flex"; @import "utilities/float"; @import "utilities/position"; diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_variables.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_variables.scss index 36dc429c8aa..e2bacef4af5 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_variables.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_variables.scss @@ -2,11 +2,13 @@ // // Copy settings from this file into the provided `_custom.scss` to override // the Bootstrap defaults without modifying key, versioned files. - +// +// Variables should follow the `$component-state-property-size` formula for +// consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs. // Table of Contents // -// Colors +// Color system // Options // Spacing // Body @@ -21,8 +23,8 @@ // Forms // Dropdowns // Z-index master list -// Navbar // Navs +// Navbar // Pagination // Jumbotron // Form states and alerts @@ -41,82 +43,75 @@ // Close // Code -@mixin _assert-ascending($map, $map-name) { - $prev-key: null; - $prev-num: null; - @each $key, $num in $map { - @if $prev-num == null { - // Do nothing - } @else if not comparable($prev-num, $num) { - @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}' !"; - } @else if $prev-num >= $num { - @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}' !"; - } - $prev-key: $key; - $prev-num: $num; - } -} - -// Replace `$search` with `$replace` in `$string` -// @author Hugo Giraudel -// @param {String} $string - Initial string -// @param {String} $search - Substring to replace -// @param {String} $replace ('') - New value -// @return {String} - Updated string -@function str-replace($string, $search, $replace: "") { - $index: str-index($string, $search); - - @if $index { - @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace); - } - - @return $string; -} - -@mixin _assert-starts-at-zero($map) { - $values: map-values($map); - $first-value: nth($values, 1); - @if $first-value != 0 { - @warn "First breakpoint in `$grid-breakpoints` must start at 0, but starts at #{$first-value}."; - } -} - - -// General variable structure -// -// Variable format should follow the `$component-modifier-state-property` order. - -// Colors // -// Grayscale and brand colors for use across Bootstrap. +// Color system +// -// Start with assigning color names to specific hex values. $white: #fff !default; +$gray-100: #f8f9fa !default; +$gray-200: #e9ecef !default; +$gray-300: #dee2e6 !default; +$gray-400: #ced4da !default; +$gray-500: #adb5bd !default; +$gray-600: #868e96 !default; +$gray-700: #495057 !default; +$gray-800: #343a40 !default; +$gray-900: #212529 !default; $black: #000 !default; -$red: #d9534f !default; -$orange: #f0ad4e !default; -$yellow: #ffd500 !default; -$green: #5cb85c !default; -$blue: #0275d8 !default; -$teal: #5bc0de !default; -$pink: #ff5b77 !default; -$purple: #613d7c !default; - -// Create grayscale -$gray-dark: #292b2c !default; -$gray: #464a4c !default; -$gray-light: #636c72 !default; -$gray-lighter: #eceeef !default; -$gray-lightest: #f7f7f9 !default; - -// Reassign color vars to semantic color scheme -$brand-primary: $blue !default; -$brand-success: $green !default; -$brand-info: $teal !default; -$brand-warning: $orange !default; -$brand-danger: $red !default; -$brand-inverse: $gray-dark !default; + +$grays: ( + 100: $gray-100, + 200: $gray-200, + 300: $gray-300, + 400: $gray-400, + 500: $gray-500, + 600: $gray-600, + 700: $gray-700, + 800: $gray-800, + 900: $gray-900 +) !default; + +$blue: #007bff !default; +$indigo: #6610f2 !default; +$purple: #6f42c1 !default; +$pink: #e83e8c !default; +$red: #dc3545 !default; +$orange: #fd7e14 !default; +$yellow: #ffc107 !default; +$green: #28a745 !default; +$teal: #20c997 !default; +$cyan: #17a2b8 !default; + +$colors: ( + blue: $blue, + indigo: $indigo, + purple: $purple, + pink: $pink, + red: $red, + orange: $orange, + yellow: $yellow, + green: $green, + teal: $teal, + cyan: $cyan, + white: $white, + gray: $gray-600, + gray-dark: $gray-800 +) !default; + +$theme-colors: ( + primary: $blue, + secondary: $gray-600, + success: $green, + info: $cyan, + warning: $yellow, + danger: $red, + light: $gray-100, + dark: $gray-800 +) !default; + +// Set a specific jump point for requesting color jumps +$theme-color-interval: 8% !default; // Options @@ -138,36 +133,15 @@ $enable-print-styles: true !default; // variables. Mostly focused on spacing. // You can add more entries to the $spacers map, should you need more variation. -$spacer: 1rem !default; -$spacer-x: $spacer !default; -$spacer-y: $spacer !default; +$spacer: 1rem !default; $spacers: ( - 0: ( - x: 0, - y: 0 - ), - 1: ( - x: ($spacer-x * .25), - y: ($spacer-y * .25) - ), - 2: ( - x: ($spacer-x * .5), - y: ($spacer-y * .5) - ), - 3: ( - x: $spacer-x, - y: $spacer-y - ), - 4: ( - x: ($spacer-x * 1.5), - y: ($spacer-y * 1.5) - ), - 5: ( - x: ($spacer-x * 3), - y: ($spacer-y * 3) - ) + 0: 0, + 1: ($spacer * .25), + 2: ($spacer * .5), + 3: $spacer, + 4: ($spacer * 1.5), + 5: ($spacer * 3) ) !default; -$border-width: 1px !default; // This variable affects the `.h-*` and `.w-*` classes. $sizes: ( @@ -182,16 +156,13 @@ $sizes: ( // Settings for the `` element. $body-bg: $white !default; -$body-color: $gray-dark !default; -$inverse-bg: $gray-dark !default; -$inverse-color: $gray-lighter !default; - +$body-color: $gray-900 !default; // Links // // Style anchor elements. -$link-color: $brand-primary !default; +$link-color: theme-color("primary") !default; $link-decoration: none !default; $link-hover-color: darken($link-color, 15%) !default; $link-hover-decoration: underline !default; @@ -230,29 +201,43 @@ $container-max-widths: ( // // Set the number of columns and specify the width of the gutters. -$grid-columns: 12 !default; -$grid-gutter-width-base: 30px !default; -$grid-gutter-widths: ( - xs: $grid-gutter-width-base, - sm: $grid-gutter-width-base, - md: $grid-gutter-width-base, - lg: $grid-gutter-width-base, - xl: $grid-gutter-width-base -) !default; +$grid-columns: 12 !default; +$grid-gutter-width: 30px !default; + +// Components +// +// Define common padding and border radius sizes and more. + +$line-height-lg: 1.5 !default; +$line-height-sm: 1.5 !default; + +$border-width: 1px !default; + +$border-radius: .25rem !default; +$border-radius-lg: .3rem !default; +$border-radius-sm: .2rem !default; + +$component-active-color: $white !default; +$component-active-bg: theme-color("primary") !default; + +$caret-width: .3em !default; + +$transition-base: all .2s ease-in-out !default; +$transition-fade: opacity .15s linear !default; +$transition-collapse: height .35s ease !default; + // Fonts // // Font, line-height, and color for body text, headings, and more. -$font-family-sans-serif: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !default; -$font-family-serif: Georgia, "Times New Roman", Times, serif !default; +$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !default; $font-family-monospace: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default; $font-family-base: $font-family-sans-serif !default; $font-size-base: 1rem !default; // Assumes the browser default, typically `16px` $font-size-lg: 1.25rem !default; $font-size-sm: .875rem !default; -$font-size-xs: .75rem !default; $font-weight-normal: normal !default; $font-weight-bold: bold !default; @@ -260,12 +245,12 @@ $font-weight-bold: bold !default; $font-weight-base: $font-weight-normal !default; $line-height-base: 1.5 !default; -$font-size-h1: 2.5rem !default; -$font-size-h2: 2rem !default; -$font-size-h3: 1.75rem !default; -$font-size-h4: 1.5rem !default; -$font-size-h5: 1.25rem !default; -$font-size-h6: 1rem !default; +$h1-font-size: 2.5rem !default; +$h2-font-size: 2rem !default; +$h3-font-size: 1.75rem !default; +$h4-font-size: 1.5rem !default; +$h5-font-size: 1.25rem !default; +$h6-font-size: 1rem !default; $headings-margin-bottom: ($spacer / 2) !default; $headings-font-family: inherit !default; @@ -289,14 +274,10 @@ $lead-font-weight: 300 !default; $small-font-size: 80% !default; -$text-muted: $gray-light !default; - -$abbr-border-color: $gray-light !default; +$text-muted: $gray-600 !default; -$blockquote-small-color: $gray-light !default; +$blockquote-small-color: $gray-600 !default; $blockquote-font-size: ($font-size-base * 1.25) !default; -$blockquote-border-color: $gray-lighter !default; -$blockquote-border-width: .25rem !default; $hr-border-color: rgba($black,.1) !default; $hr-border-width: $border-width !default; @@ -310,26 +291,7 @@ $nested-kbd-font-weight: $font-weight-bold !default; $list-inline-padding: 5px !default; - -// Components -// -// Define common padding and border radius sizes and more. - -$line-height-lg: (4 / 3) !default; -$line-height-sm: 1.5 !default; - -$border-radius: .25rem !default; -$border-radius-lg: .3rem !default; -$border-radius-sm: .2rem !default; - -$component-active-color: $white !default; -$component-active-bg: $brand-primary !default; - -$caret-width: .3em !default; - -$transition-base: all .2s ease-in-out !default; -$transition-fade: opacity .15s linear !default; -$transition-collapse: height .35s ease !default; +$mark-bg: #fcf8e3 !default; // Tables @@ -337,89 +299,65 @@ $transition-collapse: height .35s ease !default; // Customizes the `.table` component with basic values, each used across all table variations. $table-cell-padding: .75rem !default; -$table-sm-cell-padding: .3rem !default; +$table-cell-padding-sm: .3rem !default; $table-bg: transparent !default; +$table-accent-bg: rgba($black,.05) !default; +$table-hover-bg: rgba($black,.075) !default; +$table-active-bg: $table-hover-bg !default; -$table-inverse-bg: $gray-dark !default; -$table-inverse-color: $body-bg !default; - -$table-bg-accent: rgba($black,.05) !default; -$table-bg-hover: rgba($black,.075) !default; -$table-bg-active: $table-bg-hover !default; +$table-border-width: $border-width !default; +$table-border-color: $gray-200 !default; -$table-head-bg: $gray-lighter !default; -$table-head-color: $gray !default; +$table-head-bg: $gray-200 !default; +$table-head-color: $gray-700 !default; -$table-border-width: $border-width !default; -$table-border-color: $gray-lighter !default; +$table-inverse-bg: $gray-900 !default; +$table-inverse-accent-bg: rgba($white, .05) !default; +$table-inverse-hover-bg: rgba($white, .075) !default; +$table-inverse-border-color: lighten($gray-900, 7.5%) !default; +$table-inverse-color: $body-bg !default; // Buttons // // For each of Bootstrap's buttons, define text, background and border color. -$btn-padding-x: 1rem !default; -$btn-padding-y: .5rem !default; -$btn-line-height: 1.25 !default; -$btn-font-weight: $font-weight-normal !default; -$btn-box-shadow: inset 0 1px 0 rgba($white,.15), 0 1px 1px rgba($black,.075) !default; -$btn-focus-box-shadow: 0 0 0 2px rgba($brand-primary, .25) !default; -$btn-active-box-shadow: inset 0 3px 5px rgba($black,.125) !default; - -$btn-primary-color: $white !default; -$btn-primary-bg: $brand-primary !default; -$btn-primary-border: $btn-primary-bg !default; +$input-btn-padding-y: .5rem !default; +$input-btn-padding-x: .75rem !default; +$input-btn-line-height: 1.25 !default; -$btn-secondary-color: $gray-dark !default; -$btn-secondary-bg: $white !default; -$btn-secondary-border: #ccc !default; +$input-btn-padding-y-sm: .25rem !default; +$input-btn-padding-x-sm: .5rem !default; +$input-btn-line-height-sm: 1.5 !default; -$btn-info-color: $white !default; -$btn-info-bg: $brand-info !default; -$btn-info-border: $btn-info-bg !default; +$input-btn-padding-y-lg: .5rem !default; +$input-btn-padding-x-lg: 1rem !default; +$input-btn-line-height-lg: 1.5 !default; -$btn-success-color: $white !default; -$btn-success-bg: $brand-success !default; -$btn-success-border: $btn-success-bg !default; - -$btn-warning-color: $white !default; -$btn-warning-bg: $brand-warning !default; -$btn-warning-border: $btn-warning-bg !default; - -$btn-danger-color: $white !default; -$btn-danger-bg: $brand-danger !default; -$btn-danger-border: $btn-danger-bg !default; - -$btn-link-disabled-color: $gray-light !default; - -$btn-padding-x-sm: .5rem !default; -$btn-padding-y-sm: .25rem !default; +$btn-font-weight: $font-weight-normal !default; +$btn-box-shadow: inset 0 1px 0 rgba($white,.15), 0 1px 1px rgba($black,.075) !default; +$btn-focus-box-shadow: 0 0 0 3px rgba(theme-color("primary"), .25) !default; +$btn-active-box-shadow: inset 0 3px 5px rgba($black,.125) !default; -$btn-padding-x-lg: 1.5rem !default; -$btn-padding-y-lg: .75rem !default; +$btn-link-disabled-color: $gray-600 !default; $btn-block-spacing-y: .5rem !default; -$btn-toolbar-margin: .5rem !default; // Allows for customizing button radius independently from global border radius $btn-border-radius: $border-radius !default; $btn-border-radius-lg: $border-radius-lg !default; $btn-border-radius-sm: $border-radius-sm !default; -$btn-transition: all .2s ease-in-out !default; +$btn-transition: all .15s ease-in-out !default; // Forms -$input-padding-x: .75rem !default; -$input-padding-y: .5rem !default; -$input-line-height: 1.25 !default; - $input-bg: $white !default; -$input-bg-disabled: $gray-lighter !default; +$input-disabled-bg: $gray-200 !default; -$input-color: $gray !default; +$input-color: $gray-700 !default; $input-border-color: rgba($black,.15) !default; $input-btn-border-width: $border-width !default; // For form controls and buttons $input-box-shadow: inset 0 1px 1px rgba($black,.075) !default; @@ -428,27 +366,27 @@ $input-border-radius: $border-radius !default; $input-border-radius-lg: $border-radius-lg !default; $input-border-radius-sm: $border-radius-sm !default; -$input-bg-focus: $input-bg !default; -$input-border-focus: lighten($brand-primary, 25%) !default; -$input-box-shadow-focus: $input-box-shadow, rgba($input-border-focus, .6) !default; -$input-color-focus: $input-color !default; +$input-focus-bg: $input-bg !default; +$input-focus-border-color: lighten(theme-color("primary"), 25%) !default; +$input-focus-box-shadow: $input-box-shadow, $btn-focus-box-shadow !default; +$input-focus-color: $input-color !default; + +$input-placeholder-color: $gray-600 !default; -$input-color-placeholder: $gray-light !default; +$input-height-border: $input-btn-border-width * 2 !default; -$input-padding-x-sm: .5rem !default; -$input-padding-y-sm: .25rem !default; +$input-height-inner: ($font-size-base * $input-btn-line-height) + ($input-btn-padding-y * 2) !default; +$input-height: calc(#{$input-height-inner} + #{$input-height-border}) !default; -$input-padding-x-lg: 1.5rem !default; -$input-padding-y-lg: .75rem !default; +$input-height-inner-sm: ($font-size-sm * $input-btn-line-height-sm) + ($input-btn-padding-y-sm * 2) !default; +$input-height-sm: calc(#{$input-height-inner-sm} + #{$input-height-border}) !default; -$input-height: (($font-size-base * $input-line-height) + ($input-padding-y * 2)) !default; -$input-height-lg: (($font-size-lg * $line-height-lg) + ($input-padding-y-lg * 2)) !default; -$input-height-sm: (($font-size-sm * $line-height-sm) + ($input-padding-y-sm * 2)) !default; +$input-height-inner-lg: ($font-size-sm * $input-btn-line-height-lg) + ($input-btn-padding-y-lg * 2) !default; +$input-height-lg: calc(#{$input-height-inner-lg} + #{$input-height-border}) !default; $input-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s !default; $form-text-margin-top: .25rem !default; -$form-feedback-margin-top: $form-text-margin-top !default; $form-check-margin-bottom: .5rem !default; $form-check-input-gutter: 1.25rem !default; @@ -457,56 +395,53 @@ $form-check-input-margin-x: .25rem !default; $form-check-inline-margin-x: .75rem !default; -$form-group-margin-bottom: $spacer-y !default; +$form-group-margin-bottom: 1rem !default; -$input-group-addon-bg: $gray-lighter !default; +$input-group-addon-bg: $gray-200 !default; $input-group-addon-border-color: $input-border-color !default; -$cursor-disabled: not-allowed !default; - $custom-control-gutter: 1.5rem !default; -$custom-control-spacer-x: 1rem !default; $custom-control-spacer-y: .25rem !default; +$custom-control-spacer-x: 1rem !default; $custom-control-indicator-size: 1rem !default; -$custom-control-indicator-margin-y: (($line-height-base * 1rem) - $custom-control-indicator-size) / -2 !default; $custom-control-indicator-bg: #ddd !default; $custom-control-indicator-bg-size: 50% 50% !default; $custom-control-indicator-box-shadow: inset 0 .25rem .25rem rgba($black,.1) !default; -$custom-control-disabled-cursor: $cursor-disabled !default; -$custom-control-disabled-indicator-bg: $gray-lighter !default; -$custom-control-disabled-description-color: $gray-light !default; +$custom-control-indicator-disabled-bg: $gray-200 !default; +$custom-control-description-disabled-color: $gray-600 !default; -$custom-control-checked-indicator-color: $white !default; -$custom-control-checked-indicator-bg: $brand-primary !default; -$custom-control-checked-indicator-box-shadow: none !default; +$custom-control-indicator-checked-color: $white !default; +$custom-control-indicator-checked-bg: theme-color("primary") !default; +$custom-control-indicator-checked-box-shadow: none !default; -$custom-control-focus-indicator-box-shadow: 0 0 0 1px $body-bg, 0 0 0 3px $brand-primary !default; +$custom-control-indicator-focus-box-shadow: 0 0 0 1px $body-bg, 0 0 0 3px theme-color("primary") !default; -$custom-control-active-indicator-color: $white !default; -$custom-control-active-indicator-bg: lighten($brand-primary, 35%) !default; -$custom-control-active-indicator-box-shadow: none !default; +$custom-control-indicator-active-color: $white !default; +$custom-control-indicator-active-bg: lighten(theme-color("primary"), 35%) !default; +$custom-control-indicator-active-box-shadow: none !default; -$custom-checkbox-radius: $border-radius !default; -$custom-checkbox-checked-icon: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#{$custom-control-checked-indicator-color}' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E"), "#", "%23") !default; +$custom-checkbox-indicator-border-radius: $border-radius !default; +$custom-checkbox-indicator-icon-checked: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#{$custom-control-indicator-checked-color}' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E"), "#", "%23") !default; -$custom-checkbox-indeterminate-bg: $brand-primary !default; -$custom-checkbox-indeterminate-indicator-color: $custom-control-checked-indicator-color !default; -$custom-checkbox-indeterminate-icon: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='#{$custom-checkbox-indeterminate-indicator-color}' d='M0 2h4'/%3E%3C/svg%3E"), "#", "%23") !default; -$custom-checkbox-indeterminate-box-shadow: none !default; +$custom-checkbox-indicator-indeterminate-bg: theme-color("primary") !default; +$custom-checkbox-indicator-indeterminate-color: $custom-control-indicator-checked-color !default; +$custom-checkbox-indicator-icon-indeterminate: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='#{$custom-checkbox-indicator-indeterminate-color}' d='M0 2h4'/%3E%3C/svg%3E"), "#", "%23") !default; +$custom-checkbox-indicator-indeterminate-box-shadow: none !default; -$custom-radio-radius: 50% !default; -$custom-radio-checked-icon: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='#{$custom-control-checked-indicator-color}'/%3E%3C/svg%3E"), "#", "%23") !default; +$custom-radio-indicator-border-radius: 50% !default; +$custom-radio-indicator-icon-checked: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='#{$custom-control-indicator-checked-color}'/%3E%3C/svg%3E"), "#", "%23") !default; -$custom-select-padding-x: .75rem !default; $custom-select-padding-y: .375rem !default; +$custom-select-padding-x: .75rem !default; +$custom-select-height: $input-height !default; $custom-select-indicator-padding: 1rem !default; // Extra padding to account for the presence of the background-image based indicator -$custom-select-line-height: $input-line-height !default; +$custom-select-line-height: $input-btn-line-height !default; $custom-select-color: $input-color !default; -$custom-select-disabled-color: $gray-light !default; +$custom-select-disabled-color: $gray-600 !default; $custom-select-bg: $white !default; -$custom-select-disabled-bg: $gray-lighter !default; +$custom-select-disabled-bg: $gray-200 !default; $custom-select-bg-size: 8px 10px !default; // In pixels because image dimensions $custom-select-indicator-color: #333 !default; $custom-select-indicator: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E"), "#", "%23") !default; @@ -514,27 +449,27 @@ $custom-select-border-width: $input-btn-border-width !default; $custom-select-border-color: $input-border-color !default; $custom-select-border-radius: $border-radius !default; -$custom-select-focus-border-color: lighten($brand-primary, 25%) !default; +$custom-select-focus-border-color: lighten(theme-color("primary"), 25%) !default; $custom-select-focus-box-shadow: inset 0 1px 2px rgba($black, .075), 0 0 5px rgba($custom-select-focus-border-color, .5) !default; -$custom-select-sm-padding-y: .2rem !default; -$custom-select-sm-font-size: 75% !default; +$custom-select-font-size-sm: 75% !default; +$custom-select-height-sm: $input-height-sm !default; $custom-file-height: 2.5rem !default; $custom-file-width: 14rem !default; -$custom-file-focus-box-shadow: 0 0 0 .075rem $white, 0 0 0 .2rem $brand-primary !default; +$custom-file-focus-box-shadow: 0 0 0 .075rem $white, 0 0 0 .2rem theme-color("primary") !default; -$custom-file-padding-x: .5rem !default; $custom-file-padding-y: 1rem !default; +$custom-file-padding-x: .5rem !default; $custom-file-line-height: 1.5 !default; -$custom-file-color: $gray !default; +$custom-file-color: $gray-700 !default; $custom-file-bg: $white !default; $custom-file-border-width: $border-width !default; $custom-file-border-color: $input-border-color !default; $custom-file-border-radius: $border-radius !default; $custom-file-box-shadow: inset 0 .2rem .4rem rgba($black,.05) !default; $custom-file-button-color: $custom-file-color !default; -$custom-file-button-bg: $gray-lighter !default; +$custom-file-button-bg: $gray-200 !default; $custom-file-text: ( placeholder: ( en: "Choose file..." @@ -545,15 +480,9 @@ $custom-file-text: ( ) !default; -// Form validation icons -$form-icon-success-color: $brand-success !default; -$form-icon-success: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#{$form-icon-success-color}' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E"), "#", "%23") !default; - -$form-icon-warning-color: $brand-warning !default; -$form-icon-warning: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#{$form-icon-warning-color}' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E"), "#", "%23") !default; - -$form-icon-danger-color: $brand-danger !default; -$form-icon-danger: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$form-icon-danger-color}' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E"), "#", "%23") !default; +// Form validation +$form-feedback-valid-color: theme-color("success") !default; +$form-feedback-invalid-color: theme-color("danger") !default; // Dropdowns @@ -562,25 +491,26 @@ $form-icon-danger: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns $dropdown-min-width: 10rem !default; $dropdown-padding-y: .5rem !default; -$dropdown-margin-top: .125rem !default; +$dropdown-spacer: .125rem !default; $dropdown-bg: $white !default; $dropdown-border-color: rgba($black,.15) !default; $dropdown-border-width: $border-width !default; -$dropdown-divider-bg: $gray-lighter !default; +$dropdown-divider-bg: $gray-200 !default; $dropdown-box-shadow: 0 .5rem 1rem rgba($black,.175) !default; -$dropdown-link-color: $gray-dark !default; -$dropdown-link-hover-color: darken($gray-dark, 5%) !default; -$dropdown-link-hover-bg: $gray-lightest !default; +$dropdown-link-color: $gray-900 !default; +$dropdown-link-hover-color: darken($gray-900, 5%) !default; +$dropdown-link-hover-bg: $gray-100 !default; $dropdown-link-active-color: $component-active-color !default; $dropdown-link-active-bg: $component-active-bg !default; -$dropdown-link-disabled-color: $gray-light !default; +$dropdown-link-disabled-color: $gray-600 !default; +$dropdown-item-padding-y: .25rem !default; $dropdown-item-padding-x: 1.5rem !default; -$dropdown-header-color: $gray-light !default; +$dropdown-header-color: $gray-600 !default; // Z-index master list @@ -588,75 +518,70 @@ $dropdown-header-color: $gray-light !default; // Warning: Avoid customizing these values. They're used for a bird's eye view // of components dependent on the z-axis and are designed to all work together. -$zindex-dropdown-backdrop: 990 !default; -$zindex-navbar: 1000 !default; $zindex-dropdown: 1000 !default; +$zindex-sticky: 1020 !default; $zindex-fixed: 1030 !default; -$zindex-sticky: 1030 !default; $zindex-modal-backdrop: 1040 !default; $zindex-modal: 1050 !default; $zindex-popover: 1060 !default; $zindex-tooltip: 1070 !default; +// Navs + +$nav-link-padding-y: .5rem !default; +$nav-link-padding-x: 1rem !default; +$nav-link-disabled-color: $gray-600 !default; + +$nav-tabs-border-color: #ddd !default; +$nav-tabs-border-width: $border-width !default; +$nav-tabs-border-radius: $border-radius !default; +$nav-tabs-link-hover-border-color: $gray-200 !default; +$nav-tabs-link-active-color: $gray-700 !default; +$nav-tabs-link-active-bg: $body-bg !default; +$nav-tabs-link-active-border-color: #ddd !default; + +$nav-pills-border-radius: $border-radius !default; +$nav-pills-link-active-color: $component-active-color !default; +$nav-pills-link-active-bg: $component-active-bg !default; // Navbar -$navbar-border-radius: $border-radius !default; -$navbar-padding-x: $spacer !default; $navbar-padding-y: ($spacer / 2) !default; +$navbar-padding-x: $spacer !default; -$navbar-brand-padding-y: .25rem !default; +$navbar-brand-font-size: $font-size-lg !default; +// Compute the navbar-brand padding-y so the navbar-brand will have the same height as navbar-text and nav-link +$nav-link-height: $navbar-brand-font-size * $line-height-base !default; +$navbar-brand-height: ($font-size-base * $line-height-base + $nav-link-padding-y * 2) !default; +$navbar-brand-padding-y: ($navbar-brand-height - $nav-link-height) / 2 !default; -$navbar-toggler-padding-x: .75rem !default; $navbar-toggler-padding-y: .25rem !default; +$navbar-toggler-padding-x: .75rem !default; $navbar-toggler-font-size: $font-size-lg !default; $navbar-toggler-border-radius: $btn-border-radius !default; -$navbar-inverse-color: rgba($white,.5) !default; -$navbar-inverse-hover-color: rgba($white,.75) !default; -$navbar-inverse-active-color: rgba($white,1) !default; -$navbar-inverse-disabled-color: rgba($white,.25) !default; -$navbar-inverse-toggler-bg: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-inverse-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E"), "#", "%23") !default; -$navbar-inverse-toggler-border: rgba($white,.1) !default; +$navbar-dark-color: rgba($white,.5) !default; +$navbar-dark-hover-color: rgba($white,.75) !default; +$navbar-dark-active-color: rgba($white,1) !default; +$navbar-dark-disabled-color: rgba($white,.25) !default; +$navbar-dark-toggler-icon-bg: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-dark-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"), "#", "%23") !default; +$navbar-dark-toggler-border-color: rgba($white,.1) !default; $navbar-light-color: rgba($black,.5) !default; $navbar-light-hover-color: rgba($black,.7) !default; $navbar-light-active-color: rgba($black,.9) !default; $navbar-light-disabled-color: rgba($black,.3) !default; -$navbar-light-toggler-bg: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-light-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 8h24M4 16h24M4 24h24'/%3E%3C/svg%3E"), "#", "%23") !default; -$navbar-light-toggler-border: rgba($black,.1) !default; - -// Navs - -$nav-item-margin: .2rem !default; -$nav-item-inline-spacer: 1rem !default; -$nav-link-padding: .5em 1em !default; -$nav-link-hover-bg: $gray-lighter !default; -$nav-disabled-link-color: $gray-light !default; - -$nav-tabs-border-color: #ddd !default; -$nav-tabs-border-width: $border-width !default; -$nav-tabs-border-radius: $border-radius !default; -$nav-tabs-link-hover-border-color: $gray-lighter !default; -$nav-tabs-active-link-hover-color: $gray !default; -$nav-tabs-active-link-hover-bg: $body-bg !default; -$nav-tabs-active-link-hover-border-color: #ddd !default; -$nav-tabs-justified-link-border-color: #ddd !default; -$nav-tabs-justified-active-link-border-color: $body-bg !default; - -$nav-pills-border-radius: $border-radius !default; -$nav-pills-active-link-color: $component-active-color !default; -$nav-pills-active-link-bg: $component-active-bg !default; - +$navbar-light-toggler-icon-bg: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-light-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"), "#", "%23") !default; +$navbar-light-toggler-border-color: rgba($black,.1) !default; // Pagination -$pagination-padding-x: .75rem !default; $pagination-padding-y: .5rem !default; -$pagination-padding-x-sm: .5rem !default; +$pagination-padding-x: .75rem !default; $pagination-padding-y-sm: .25rem !default; -$pagination-padding-x-lg: 1.5rem !default; +$pagination-padding-x-sm: .5rem !default; $pagination-padding-y-lg: .75rem !default; +$pagination-padding-x-lg: 1.5rem !default; $pagination-line-height: 1.25 !default; $pagination-color: $link-color !default; @@ -665,62 +590,38 @@ $pagination-border-width: $border-width !default; $pagination-border-color: #ddd !default; $pagination-hover-color: $link-hover-color !default; -$pagination-hover-bg: $gray-lighter !default; -$pagination-hover-border: #ddd !default; +$pagination-hover-bg: $gray-200 !default; +$pagination-hover-border-color: #ddd !default; $pagination-active-color: $white !default; -$pagination-active-bg: $brand-primary !default; -$pagination-active-border: $brand-primary !default; +$pagination-active-bg: theme-color("primary") !default; +$pagination-active-border-color: theme-color("primary") !default; -$pagination-disabled-color: $gray-light !default; +$pagination-disabled-color: $gray-600 !default; $pagination-disabled-bg: $white !default; -$pagination-disabled-border: #ddd !default; +$pagination-disabled-border-color: #ddd !default; // Jumbotron $jumbotron-padding: 2rem !default; -$jumbotron-bg: $gray-lighter !default; - - -// Form states and alerts -// -// Define colors for form feedback states and, by default, alerts. - -$state-success-text: #3c763d !default; -$state-success-bg: #dff0d8 !default; -$state-success-border: darken($state-success-bg, 5%) !default; - -$state-info-text: #31708f !default; -$state-info-bg: #d9edf7 !default; -$state-info-border: darken($state-info-bg, 7%) !default; - -$state-warning-text: #8a6d3b !default; -$state-warning-bg: #fcf8e3 !default; -$mark-bg: $state-warning-bg !default; -$state-warning-border: darken($state-warning-bg, 5%) !default; - -$state-danger-text: #a94442 !default; -$state-danger-bg: #f2dede !default; -$state-danger-border: darken($state-danger-bg, 5%) !default; +$jumbotron-bg: $gray-200 !default; // Cards -$card-spacer-x: 1.25rem !default; $card-spacer-y: .75rem !default; +$card-spacer-x: 1.25rem !default; $card-border-width: 1px !default; $card-border-radius: $border-radius !default; $card-border-color: rgba($black,.125) !default; -$card-border-radius-inner: calc(#{$card-border-radius} - #{$card-border-width}) !default; -$card-cap-bg: $gray-lightest !default; +$card-inner-border-radius: calc(#{$card-border-radius} - #{$card-border-width}) !default; +$card-cap-bg: rgba($black, .03) !default; $card-bg: $white !default; -$card-link-hover-color: $white !default; - $card-img-overlay-padding: 1.25rem !default; -$card-deck-margin: ($grid-gutter-width-base / 2) !default; +$card-deck-margin: ($grid-gutter-width / 2) !default; $card-columns-count: 3 !default; $card-columns-gap: 1.25rem !default; @@ -735,9 +636,11 @@ $tooltip-bg: $black !default; $tooltip-opacity: .9 !default; $tooltip-padding-y: 3px !default; $tooltip-padding-x: 8px !default; -$tooltip-margin: 3px !default; +$tooltip-margin: 0 !default; + $tooltip-arrow-width: 5px !default; +$tooltip-arrow-height: 5px !default; $tooltip-arrow-color: $tooltip-bg !default; @@ -750,14 +653,17 @@ $popover-border-width: $border-width !default; $popover-border-color: rgba($black,.2) !default; $popover-box-shadow: 0 5px 10px rgba($black,.2) !default; -$popover-title-bg: darken($popover-bg, 3%) !default; -$popover-title-padding-x: 14px !default; -$popover-title-padding-y: 8px !default; +$popover-header-bg: darken($popover-bg, 3%) !default; +$popover-header-color: $headings-color !default; +$popover-header-padding-y: 8px !default; +$popover-header-padding-x: 14px !default; -$popover-content-padding-x: 14px !default; -$popover-content-padding-y: 9px !default; +$popover-body-color: $body-color !default; +$popover-body-padding-y: 9px !default; +$popover-body-padding-x: 14px !default; $popover-arrow-width: 10px !default; +$popover-arrow-height: 5px !default; $popover-arrow-color: $popover-bg !default; $popover-arrow-outer-width: ($popover-arrow-width + 1px) !default; @@ -766,19 +672,11 @@ $popover-arrow-outer-color: fade-in($popover-border-color, .05) !defau // Badges -$badge-default-bg: $gray-light !default; -$badge-primary-bg: $brand-primary !default; -$badge-success-bg: $brand-success !default; -$badge-info-bg: $brand-info !default; -$badge-warning-bg: $brand-warning !default; -$badge-danger-bg: $brand-danger !default; - $badge-color: $white !default; -$badge-link-hover-color: $white !default; $badge-font-size: 75% !default; $badge-font-weight: $font-weight-bold !default; -$badge-padding-x: .4em !default; $badge-padding-y: .25em !default; +$badge-padding-x: .4em !default; $badge-pill-padding-x: .6em !default; // Use a higher than normal value to ensure completely rounded edges when @@ -792,19 +690,19 @@ $badge-pill-border-radius: 10rem !default; $modal-inner-padding: 15px !default; $modal-dialog-margin: 10px !default; -$modal-dialog-sm-up-margin-y: 30px !default; +$modal-dialog-margin-y-sm-up: 30px !default; $modal-title-line-height: $line-height-base !default; $modal-content-bg: $white !default; $modal-content-border-color: rgba($black,.2) !default; $modal-content-border-width: $border-width !default; -$modal-content-xs-box-shadow: 0 3px 9px rgba($black,.5) !default; -$modal-content-sm-up-box-shadow: 0 5px 15px rgba($black,.5) !default; +$modal-content-box-shadow-xs: 0 3px 9px rgba($black,.5) !default; +$modal-content-box-shadow-sm-up: 0 5px 15px rgba($black,.5) !default; $modal-backdrop-bg: $black !default; $modal-backdrop-opacity: .5 !default; -$modal-header-border-color: $gray-lighter !default; +$modal-header-border-color: $gray-200 !default; $modal-footer-border-color: $modal-header-border-color !default; $modal-header-border-width: $modal-content-border-width !default; $modal-footer-border-width: $modal-header-border-width !default; @@ -821,68 +719,49 @@ $modal-transition: transform .3s ease-out !default; // // Define alert colors, border radius, and padding. -$alert-padding-x: 1.25rem !default; $alert-padding-y: .75rem !default; -$alert-margin-bottom: $spacer-y !default; +$alert-padding-x: 1.25rem !default; +$alert-margin-bottom: 1rem !default; $alert-border-radius: $border-radius !default; $alert-link-font-weight: $font-weight-bold !default; $alert-border-width: $border-width !default; -$alert-success-bg: $state-success-bg !default; -$alert-success-text: $state-success-text !default; -$alert-success-border: $state-success-border !default; - -$alert-info-bg: $state-info-bg !default; -$alert-info-text: $state-info-text !default; -$alert-info-border: $state-info-border !default; - -$alert-warning-bg: $state-warning-bg !default; -$alert-warning-text: $state-warning-text !default; -$alert-warning-border: $state-warning-border !default; - -$alert-danger-bg: $state-danger-bg !default; -$alert-danger-text: $state-danger-text !default; -$alert-danger-border: $state-danger-border !default; - // Progress bars $progress-height: 1rem !default; $progress-font-size: .75rem !default; -$progress-bg: $gray-lighter !default; +$progress-bg: $gray-200 !default; $progress-border-radius: $border-radius !default; $progress-box-shadow: inset 0 .1rem .1rem rgba($black,.1) !default; $progress-bar-color: $white !default; -$progress-bar-bg: $brand-primary !default; +$progress-bar-bg: theme-color("primary") !default; $progress-bar-animation-timing: 1s linear infinite !default; +$progress-bar-transition: width .6s ease !default; // List group -$list-group-color: $body-color !default; $list-group-bg: $white !default; $list-group-border-color: rgba($black,.125) !default; $list-group-border-width: $border-width !default; $list-group-border-radius: $border-radius !default; -$list-group-item-padding-x: 1.25rem !default; $list-group-item-padding-y: .75rem !default; +$list-group-item-padding-x: 1.25rem !default; -$list-group-hover-bg: $gray-lightest !default; -$list-group-active-color: $component-active-color !default; -$list-group-active-bg: $component-active-bg !default; -$list-group-active-border: $list-group-active-bg !default; -$list-group-active-text-color: lighten($list-group-active-bg, 50%) !default; +$list-group-hover-bg: $gray-100 !default; +$list-group-active-color: $component-active-color !default; +$list-group-active-bg: $component-active-bg !default; +$list-group-active-border-color: $list-group-active-bg !default; -$list-group-disabled-color: $gray-light !default; +$list-group-disabled-color: $gray-600 !default; $list-group-disabled-bg: $list-group-bg !default; -$list-group-disabled-text-color: $list-group-disabled-color !default; -$list-group-link-color: $gray !default; -$list-group-link-heading-color: $gray-dark !default; -$list-group-link-hover-color: $list-group-link-color !default; +$list-group-action-color: $gray-700 !default; +$list-group-action-hover-color: $list-group-action-color !default; -$list-group-link-active-color: $list-group-color !default; -$list-group-link-active-bg: $gray-lighter !default; +$list-group-action-active-color: $body-color !default; +$list-group-action-active-bg: $gray-200 !default; // Image thumbnails @@ -899,7 +778,7 @@ $thumbnail-transition: all .2s ease-in-out !default; // Figures $figure-caption-font-size: 90% !default; -$figure-caption-color: $gray-light !default; +$figure-caption-color: $gray-600 !default; // Breadcrumbs @@ -908,9 +787,9 @@ $breadcrumb-padding-y: .75rem !default; $breadcrumb-padding-x: 1rem !default; $breadcrumb-item-padding: .5rem !default; -$breadcrumb-bg: $gray-lighter !default; -$breadcrumb-divider-color: $gray-light !default; -$breadcrumb-active-color: $gray-light !default; +$breadcrumb-bg: $gray-200 !default; +$breadcrumb-divider-color: $gray-600 !default; +$breadcrumb-active-color: $gray-600 !default; $breadcrumb-divider: "/" !default; @@ -933,7 +812,7 @@ $carousel-control-icon-width: 20px !default; $carousel-control-prev-icon-bg: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3E%3Cpath d='M4 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E"), "#", "%23") !default; $carousel-control-next-icon-bg: str-replace(url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E"), "#", "%23") !default; -$carousel-transition: transform .6s ease-in-out !default; +$carousel-transition: transform .6s ease !default; // Close @@ -943,19 +822,16 @@ $close-font-weight: $font-weight-bold !default; $close-color: $black !default; $close-text-shadow: 0 1px 0 $white !default; - // Code $code-font-size: 90% !default; -$code-padding-x: .4rem !default; $code-padding-y: .2rem !default; +$code-padding-x: .4rem !default; $code-color: #bd4147 !default; -$code-bg: $gray-lightest !default; +$code-bg: $gray-100 !default; $kbd-color: $white !default; -$kbd-bg: $gray-dark !default; +$kbd-bg: $gray-900 !default; -$pre-bg: $gray-lightest !default; -$pre-color: $gray-dark !default; -$pre-border-color: #ccc !default; +$pre-color: $gray-900 !default; $pre-scrollable-max-height: 340px !default; diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-grid.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-grid.scss index 182b9626b60..4b2bddd5d3d 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-grid.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-grid.scss @@ -22,22 +22,16 @@ html { box-sizing: inherit; } - -// -// Variables -// - +@import "functions"; @import "variables"; // // Grid mixins // -@import "mixins/clearfix"; @import "mixins/breakpoints"; @import "mixins/grid-framework"; @import "mixins/grid"; -@import "custom"; - @import "grid"; +@import "utilities/flex"; diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-reboot.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-reboot.scss index 978b086a1a2..2700a570560 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-reboot.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-reboot.scss @@ -2,9 +2,8 @@ // // Includes only Normalize and our custom Reboot reset. +@import "functions"; @import "variables"; @import "mixins"; -@import "custom"; -@import "normalize"; @import "reboot"; diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap.scss index 88a60cafa0b..648f446b6e6 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap.scss @@ -1,20 +1,14 @@ /*! - * Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com) + * Bootstrap v4.0.0-beta (https://getbootstrap.com) * Copyright 2011-2017 The Bootstrap Authors * Copyright 2011-2017 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ -// Core variables and mixins +@import "functions"; @import "variables"; @import "mixins"; -@import "custom"; - -// Reset and dependencies -@import "normalize"; @import "print"; - -// Core CSS @import "reboot"; @import "type"; @import "images"; @@ -23,8 +17,6 @@ @import "tables"; @import "forms"; @import "buttons"; - -// Components @import "transitions"; @import "dropdown"; @import "button-group"; @@ -41,14 +33,9 @@ @import "progress"; @import "media"; @import "list-group"; -@import "responsive-embed"; @import "close"; - -// Components w/ JavaScript @import "modal"; @import "tooltip"; @import "popover"; @import "carousel"; - -// Utility classes @import "utilities"; diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_alert.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_alert.scss index 6ed3a81ab1d..d938e897225 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_alert.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_alert.scss @@ -1,14 +1,13 @@ -// Alerts - -@mixin alert-variant($background, $border, $body-color) { +@mixin alert-variant($background, $border, $color) { + color: $color; background-color: $background; border-color: $border; - color: $body-color; hr { border-top-color: darken($border, 5%); } + .alert-link { - color: darken($body-color, 10%); + color: darken($color, 10%); } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_badge.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_badge.scss index 9fa44b64781..257a6abb7d8 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_badge.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_badge.scss @@ -1,11 +1,12 @@ -// Badges - -@mixin badge-variant($color) { - background-color: $color; +@mixin badge-variant($bg) { + @include color-yiq($bg); + background-color: $bg; &[href] { @include hover-focus { - background-color: darken($color, 10%); + @include color-yiq($bg); + text-decoration: none; + background-color: darken($bg, 10%); } } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_border-radius.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_border-radius.scss index 54f29f41da4..2024febcfa8 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_border-radius.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_border-radius.scss @@ -8,15 +8,15 @@ @mixin border-top-radius($radius) { @if $enable-rounded { - border-top-right-radius: $radius; border-top-left-radius: $radius; + border-top-right-radius: $radius; } } @mixin border-right-radius($radius) { @if $enable-rounded { - border-bottom-right-radius: $radius; border-top-right-radius: $radius; + border-bottom-right-radius: $radius; } } @@ -29,7 +29,7 @@ @mixin border-left-radius($radius) { @if $enable-rounded { - border-bottom-left-radius: $radius; border-top-left-radius: $radius; + border-bottom-left-radius: $radius; } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_box-shadow.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_box-shadow.scss new file mode 100644 index 00000000000..b2410e53ac3 --- /dev/null +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_box-shadow.scss @@ -0,0 +1,5 @@ +@mixin box-shadow($shadow...) { + @if $enable-shadows { + box-shadow: $shadow; + } +} diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_breakpoints.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_breakpoints.scss index 6fd2e8e1e86..8d7378d360c 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_breakpoints.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_breakpoints.scss @@ -2,7 +2,7 @@ // // Breakpoints are defined as a map of (name: minimum width), order from small to large: // -// (xs: 0, sm: 576px, md: 768px) +// (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px) // // The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default. @@ -10,9 +10,9 @@ // // >> breakpoint-next(sm) // md -// >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px)) +// >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // md -// >> breakpoint-next(sm, $breakpoint-names: (xs sm md)) +// >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl)) // md @function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) { $n: index($breakpoint-names, $name); @@ -21,7 +21,7 @@ // Minimum breakpoint width. Null for the smallest (first) breakpoint. // -// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px)) +// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // 576px @function breakpoint-min($name, $breakpoints: $grid-breakpoints) { $min: map-get($breakpoints, $name); @@ -31,7 +31,7 @@ // Maximum breakpoint width. Null for the largest (last) breakpoint. // The maximum value is calculated as the minimum of the next one less 0.1. // -// >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px)) +// >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // 767px @function breakpoint-max($name, $breakpoints: $grid-breakpoints) { $next: breakpoint-next($name, $breakpoints); @@ -41,9 +41,9 @@ // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront. // Useful for making responsive utilities. // -// >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px)) +// >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // "" (Returns a blank string) -// >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px)) +// >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) // "-sm" @function breakpoint-infix($name, $breakpoints: $grid-breakpoints) { @return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}"); @@ -78,10 +78,11 @@ // Media that spans multiple breakpoint widths. // Makes the @content apply between the min and max breakpoints @mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) { - @include media-breakpoint-up($lower, $breakpoints) { - @include media-breakpoint-down($upper, $breakpoints) { - @content; - } + $min: breakpoint-min($lower, $breakpoints); + $max: breakpoint-max($upper, $breakpoints); + + @media (min-width: $min) and (max-width: $max) { + @content; } } @@ -89,7 +90,16 @@ // No minimum for the smallest breakpoint, and no maximum for the largest one. // Makes the @content apply only to the given breakpoint, not viewports any wider or narrower. @mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) { - @include media-breakpoint-between($name, $name, $breakpoints) { - @content; + $min: breakpoint-min($name, $breakpoints); + $max: breakpoint-max($name, $breakpoints); + + @if $min != null and $max != null { + @media (min-width: $min) and (max-width: $max) { + @content; + } + } @else if $max == null { + @include media-breakpoint-up($name) + } @else if $min == null { + @include media-breakpoint-down($name) } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_buttons.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_buttons.scss index f9981e326ae..f7ec5764e7b 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_buttons.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_buttons.scss @@ -3,28 +3,25 @@ // Easily pump out default styles, as well as :hover, :focus, :active, // and disabled options for all buttons -@mixin button-variant($color, $background, $border) { - $active-background: darken($background, 10%); - $active-border: darken($border, 12%); - - color: $color; +@mixin button-variant($background, $border, $active-background: darken($background, 7.5%), $active-border: darken($border, 10%)) { + @include color-yiq($background); background-color: $background; border-color: $border; @include box-shadow($btn-box-shadow); - // Hover and focus styles are shared - @include hover { - color: $color; + &:hover { + @include color-yiq($background); background-color: $active-background; border-color: $active-border; } + &:focus, &.focus { // Avoid using mixin so we can pass custom focus shadow properly @if $enable-shadows { - box-shadow: $btn-box-shadow, 0 0 0 2px rgba($border, .5); + box-shadow: $btn-box-shadow, 0 0 0 3px rgba($border, .5); } @else { - box-shadow: 0 0 0 2px rgba($border, .5); + box-shadow: 0 0 0 3px rgba($border, .5); } } @@ -38,7 +35,6 @@ &:active, &.active, .show > &.dropdown-toggle { - color: $color; background-color: $active-background; background-image: none; // Remove the gradient for the pressed/active state border-color: $active-border; @@ -48,8 +44,8 @@ @mixin button-outline-variant($color, $color-hover: #fff) { color: $color; - background-image: none; background-color: transparent; + background-image: none; border-color: $color; @include hover { @@ -60,7 +56,7 @@ &:focus, &.focus { - box-shadow: 0 0 0 2px rgba($color, .5); + box-shadow: 0 0 0 3px rgba($color, .5); } &.disabled, @@ -79,8 +75,9 @@ } // Button sizes -@mixin button-size($padding-y, $padding-x, $font-size, $border-radius) { +@mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) { padding: $padding-y $padding-x; font-size: $font-size; + line-height: $line-height; @include border-radius($border-radius); } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_cards.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_cards.scss deleted file mode 100644 index 4b1232d8b20..00000000000 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_cards.scss +++ /dev/null @@ -1,47 +0,0 @@ -// Card variants - -@mixin card-variant($background, $border) { - background-color: $background; - border-color: $border; - - .card-header, - .card-footer { - background-color: transparent; - } -} - -@mixin card-outline-variant($color) { - background-color: transparent; - border-color: $color; -} - -// -// Inverse text within a card for use with dark backgrounds -// - -@mixin card-inverse { - color: rgba(255,255,255,.65); - - .card-header, - .card-footer { - background-color: transparent; - border-color: rgba(255,255,255,.2); - } - .card-header, - .card-footer, - .card-title, - .card-blockquote { - color: #fff; - } - .card-link, - .card-text, - .card-subtitle, - .card-blockquote .blockquote-footer { - color: rgba(255,255,255,.65); - } - .card-link { - @include hover-focus { - color: $card-link-hover-color; - } - } -} diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_clearfix.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_clearfix.scss index b72cf27128a..11a977b7373 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_clearfix.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_clearfix.scss @@ -1,7 +1,7 @@ @mixin clearfix() { &::after { display: block; - content: ""; clear: both; + content: ""; } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_forms.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_forms.scss index c8aea9669d8..4a1e0bc3114 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_forms.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_forms.scss @@ -1,39 +1,7 @@ -// Form validation states -// -// Used in _forms.scss to generate the form validation CSS for warnings, errors, -// and successes. - -@mixin form-control-validation($color) { - // Color the label and help text - .form-control-feedback, - .form-control-label, - .col-form-label, - .form-check-label, - .custom-control { - color: $color; - } - - // Set the border and box shadow on specific inputs to match - .form-control { - border-color: $color; - - &:focus { - @include box-shadow($input-box-shadow, 0 0 6px lighten($color, 20%)); - } - } - - // Set validation states also for addons - .input-group-addon { - color: $color; - border-color: $color; - background-color: lighten($color, 40%); - } -} - // Form control focus state // // Generate a customized focus state and for any input with the specified color, -// which defaults to the `@input-border-focus` variable. +// which defaults to the `@input-border-color-focus` variable. // // We highly encourage you to not customize the default value, but instead use // this to tweak colors on an as-needed basis. This aesthetic change is based on @@ -44,36 +12,70 @@ // contrast against a dark gray background. @mixin form-control-focus() { &:focus { - color: $input-color-focus; - background-color: $input-bg-focus; - border-color: $input-border-focus; + color: $input-focus-color; + background-color: $input-focus-bg; + border-color: $input-focus-border-color; outline: none; - @include box-shadow($input-box-shadow-focus); + @include box-shadow($input-focus-box-shadow); } } -// Form control sizing -// -// Relative text size, padding, and border-radii changes for form controls. For -// horizontal sizing, wrap controls in the predefined grid classes. `` -// element gets special love because it's special, and that's a fact! -@mixin input-size($parent, $input-height, $padding-y, $padding-x, $font-size, $line-height, $border-radius) { - #{$parent} { - height: $input-height; - padding: $padding-y $padding-x; - font-size: $font-size; - line-height: $line-height; - @include border-radius($border-radius); +@mixin form-validation-state($state, $color) { + + .form-control, + .custom-select { + .was-validated &:#{$state}, + &.is-#{$state} { + border-color: $color; + + &:focus { + box-shadow: 0 0 0 .2rem rgba($color,.25); + } + + ~ .invalid-feedback, + ~ .invalid-tooltip { + display: block; + } + } } - select#{$parent} { - height: $input-height; - line-height: $input-height; + + // TODO: redo check markup lol crap + .form-check-input { + .was-validated &:#{$state}, + &.is-#{$state} { + + .form-check-label { + color: $color; + } + } } - textarea#{$parent}, - select[multiple]#{$parent} { - height: auto; + // custom radios and checks + .custom-control-input { + .was-validated &:#{$state}, + &.is-#{$state} { + ~ .custom-control-indicator { + background-color: rgba($color, .25); + } + ~ .custom-control-description { + color: $color; + } + } + } + + // custom file + .custom-file-input { + .was-validated &:#{$state}, + &.is-#{$state} { + ~ .custom-file-control { + border-color: $color; + + &::before { border-color: inherit; } + } + &:focus { + box-shadow: 0 0 0 .2rem rgba($color,.25); + } + } } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_gradients.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_gradients.scss index 8bfd97c4d8d..bad79f96175 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_gradients.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_gradients.scss @@ -17,8 +17,8 @@ } @mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) { - background-repeat: repeat-x; background-image: linear-gradient($deg, $start-color, $end-color); + background-repeat: repeat-x; } @mixin gradient-x-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) { background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color); diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid-framework.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid-framework.scss index 0aa814ab2d8..d8195ddfa19 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid-framework.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid-framework.scss @@ -3,14 +3,14 @@ // Used only by Bootstrap to generate the correct number of grid classes given // any value of `$grid-columns`. -@mixin make-grid-columns($columns: $grid-columns, $gutters: $grid-gutter-widths, $breakpoints: $grid-breakpoints) { +@mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) { // Common properties for all breakpoints %grid-column { position: relative; width: 100%; min-height: 1px; // Prevent columns from collapsing when empty - - @include make-gutters($gutters); + padding-right: ($gutter / 2); + padding-left: ($gutter / 2); } @each $breakpoint in map-keys($breakpoints) { @@ -22,7 +22,8 @@ @extend %grid-column; } } - .col#{$infix} { + .col#{$infix}, + .col#{$infix}-auto { @extend %grid-column; } @@ -36,6 +37,7 @@ .col#{$infix}-auto { flex: 0 0 auto; width: auto; + max-width: none; // Reset earlier grid tiers } @for $i from 1 through $columns { @@ -44,20 +46,9 @@ } } - @each $modifier in (pull, push) { - @for $i from 0 through $columns { - .#{$modifier}#{$infix}-#{$i} { - @include make-col-modifier($modifier, $i, $columns) - } - } - } - - // `$columns - 1` because offsetting by the width of an entire row isn't possible - @for $i from 0 through ($columns - 1) { - @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-xs-0 - .offset#{$infix}-#{$i} { - @include make-col-modifier(offset, $i, $columns) - } + @for $i from 1 through $columns { + .order#{$infix}-#{$i} { + order: $i; } } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid.scss index 9cd8c7bbbbd..67dbcd38ece 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid.scss @@ -2,18 +2,12 @@ // // Generate semantic grid columns with these mixins. -@mixin make-container($gutters: $grid-gutter-widths) { - position: relative; - margin-left: auto; +@mixin make-container() { margin-right: auto; - - @each $breakpoint in map-keys($gutters) { - @include media-breakpoint-up($breakpoint) { - $gutter: map-get($gutters, $breakpoint); - padding-right: ($gutter / 2); - padding-left: ($gutter / 2); - } - } + margin-left: auto; + padding-right: ($grid-gutter-width / 2); + padding-left: ($grid-gutter-width / 2); + width: 100%; } @@ -21,80 +15,33 @@ @mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) { @each $breakpoint, $container-max-width in $max-widths { @include media-breakpoint-up($breakpoint, $breakpoints) { - width: $container-max-width; - max-width: 100%; + max-width: $container-max-width; } } } -@mixin make-gutters($gutters: $grid-gutter-widths) { - @each $breakpoint in map-keys($gutters) { - @include media-breakpoint-up($breakpoint) { - $gutter: map-get($gutters, $breakpoint); - padding-right: ($gutter / 2); - padding-left: ($gutter / 2); - } - } -} - -@mixin make-row($gutters: $grid-gutter-widths) { +@mixin make-row() { display: flex; flex-wrap: wrap; - - @each $breakpoint in map-keys($gutters) { - @include media-breakpoint-up($breakpoint) { - $gutter: map-get($gutters, $breakpoint); - margin-right: ($gutter / -2); - margin-left: ($gutter / -2); - } - } + margin-right: ($grid-gutter-width / -2); + margin-left: ($grid-gutter-width / -2); } -@mixin make-col-ready($gutters: $grid-gutter-widths) { +@mixin make-col-ready() { position: relative; // Prevent columns from becoming too narrow when at smaller grid tiers by // always setting `width: 100%;`. This works because we use `flex` values // later on to override this initial width. width: 100%; min-height: 1px; // Prevent collapsing - - @each $breakpoint in map-keys($gutters) { - @include media-breakpoint-up($breakpoint) { - $gutter: map-get($gutters, $breakpoint); - padding-right: ($gutter / 2); - padding-left: ($gutter / 2); - } - } + padding-right: ($grid-gutter-width / 2); + padding-left: ($grid-gutter-width / 2); } @mixin make-col($size, $columns: $grid-columns) { flex: 0 0 percentage($size / $columns); - // width: percentage($size / $columns); // Add a `max-width` to ensure content within each column does not blow out // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari // do not appear to require this. max-width: percentage($size / $columns); } - -@mixin make-col-offset($size, $columns: $grid-columns) { - margin-left: percentage($size / $columns); -} - -@mixin make-col-push($size, $columns: $grid-columns) { - left: if($size > 0, percentage($size / $columns), auto); -} - -@mixin make-col-pull($size, $columns: $grid-columns) { - right: if($size > 0, percentage($size / $columns), auto); -} - -@mixin make-col-modifier($type, $size, $columns) { - // Work around the lack of dynamic mixin @include support (https://github.com/sass/sass/issues/626) - @if $type == push { - @include make-col-push($size, $columns); - } @else if $type == pull { - @include make-col-pull($size, $columns); - } @else if $type == offset { - @include make-col-offset($size, $columns); - } -} diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_hover.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_hover.scss index 6dd55e705a6..4aa4b1d5d46 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_hover.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_hover.scss @@ -8,16 +8,18 @@ // } // } // @else { +// scss-lint:disable Indentation &:hover { @content } +// scss-lint:enable Indentation // } } + @mixin hover-focus { @if $enable-hover-media-query { &:focus { @content } @include hover { @content } - } - @else { + } @else { &:focus, &:hover { @content @@ -32,8 +34,7 @@ @content } @include hover { @content } - } - @else { + } @else { &, &:focus, &:hover { @@ -49,8 +50,7 @@ @content } @include hover { @content } - } - @else { + } @else { &:focus, &:active, &:hover { diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_list-group.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_list-group.scss index 3db5b096a42..ba27b5041da 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_list-group.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_list-group.scss @@ -6,14 +6,11 @@ background-color: $background; } + //scss-lint:disable QualifyingElement a.list-group-item-#{$state}, button.list-group-item-#{$state} { color: $color; - .list-group-item-heading { - color: inherit; - } - @include hover-focus { color: $color; background-color: darken($background, 5%); @@ -25,4 +22,5 @@ border-color: $color; } } + // scss-lint:enable QualifyingElement } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_nav-divider.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_nav-divider.scss index fb3d12e9f69..493de03a34a 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_nav-divider.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_nav-divider.scss @@ -3,8 +3,8 @@ // Dividers (basically an hr) within dropdowns and nav lists @mixin nav-divider($color: #e5e5e5) { - height: 1px; - margin: ($spacer-y / 2) 0; + height: 0; + margin: ($spacer / 2) 0; overflow: hidden; - background-color: $color; + border-top: 1px solid $color; } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_pagination.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_pagination.scss index 8cd9317cf52..ff36eb6b40a 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_pagination.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_pagination.scss @@ -4,6 +4,7 @@ .page-link { padding: $padding-y $padding-x; font-size: $font-size; + line-height: $line-height; } .page-item { diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_reset-text.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_reset-text.scss index b952730977b..4cf9e79c749 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_reset-text.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_reset-text.scss @@ -1,17 +1,18 @@ +// scss-lint:disable DuplicateProperty @mixin reset-text { font-family: $font-family-base; // We deliberately do NOT reset font-size or word-wrap. font-style: normal; font-weight: $font-weight-normal; - letter-spacing: normal; - line-break: auto; line-height: $line-height-base; text-align: left; // Fallback for where `start` is not supported text-align: start; text-decoration: none; text-shadow: none; text-transform: none; - white-space: normal; + letter-spacing: normal; word-break: normal; word-spacing: normal; + white-space: normal; + line-break: auto; } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_resize.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_resize.scss index 83fa6379179..66f233a63c9 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_resize.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_resize.scss @@ -1,6 +1,6 @@ // Resize anything @mixin resizable($direction) { - resize: $direction; // Options: horizontal, vertical, both overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` + resize: $direction; // Options: horizontal, vertical, both } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_screen-reader.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_screen-reader.scss index c208583249e..a5fa51c5c88 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_screen-reader.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_screen-reader.scss @@ -1,15 +1,17 @@ // Only display content to screen readers // // See: http://a11yproject.com/posts/how-to-hide-content +// See: http://hugogiraudel.com/2016/10/13/css-hide-and-seek/ @mixin sr-only { position: absolute; width: 1px; height: 1px; padding: 0; - margin: -1px; overflow: hidden; clip: rect(0,0,0,0); + white-space: nowrap; + clip-path: inset(50%); border: 0; } @@ -25,8 +27,9 @@ position: static; width: auto; height: auto; - margin: 0; overflow: visible; clip: auto; + white-space: normal; + clip-path: none; } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_text-truncate.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_text-truncate.scss index 5a40bf533a9..3504bb1aa5d 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_text-truncate.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_text-truncate.scss @@ -5,4 +5,4 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -} \ No newline at end of file +} diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_transforms.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_transforms.scss deleted file mode 100644 index 4005c9d028d..00000000000 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_transforms.scss +++ /dev/null @@ -1,14 +0,0 @@ -// Applies the given styles only when the browser support CSS3 3D transforms. -@mixin if-supports-3d-transforms() { - @media (-webkit-transform-3d) { - // Old Safari, Old Android - // http://caniuse.com/#feat=css-featurequeries - // https://developer.mozilla.org/en-US/docs/Web/CSS/@media/-webkit-transform-3d - @content; - } - - @supports (transform: translate3d(0,0,0)) { - // The Proper Way: Using a CSS feature query - @content; - } -} diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_transition.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_transition.scss new file mode 100644 index 00000000000..7e33dee3194 --- /dev/null +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_transition.scss @@ -0,0 +1,9 @@ +@mixin transition($transition...) { + @if $enable-transitions { + @if length($transition) == 0 { + transition: $transition-base; + } @else { + transition: $transition; + } + } +} diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_visibility.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_visibility.scss index 88c50b05d5c..f67fc1c529e 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_visibility.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_visibility.scss @@ -1,5 +1,5 @@ // Visibility -@mixin invisible { - visibility: hidden !important; +@mixin invisible($visibility) { + visibility: $visibility !important; } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_background.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_background.scss index b9ac295231c..1ef34fd8eed 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_background.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_background.scss @@ -1,19 +1,6 @@ -// -// Contextual backgrounds -// - -.bg-faded { - background-color: darken($body-bg, 3%); +@each $color, $value in $theme-colors { + @include bg-variant('.bg-#{$color}', $value); } -@include bg-variant('.bg-primary', $brand-primary); - -@include bg-variant('.bg-success', $brand-success); - -@include bg-variant('.bg-info', $brand-info); - -@include bg-variant('.bg-warning', $brand-warning); - -@include bg-variant('.bg-danger', $brand-danger); - -@include bg-variant('.bg-inverse', $brand-inverse); +.bg-white { background-color: $white !important; } +.bg-transparent { background-color: transparent !important; } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_borders.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_borders.scss index b256881e5ec..82e177c80bf 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_borders.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_borders.scss @@ -2,30 +2,45 @@ // Border // +.border { border: 1px solid $gray-200 !important; } .border-0 { border: 0 !important; } .border-top-0 { border-top: 0 !important; } .border-right-0 { border-right: 0 !important; } .border-bottom-0 { border-bottom: 0 !important; } .border-left-0 { border-left: 0 !important; } +@each $color, $value in $theme-colors { + .border-#{$color} { + border-color: $value !important; + } +} + +.border-white { + border-color: $white !important; +} + // // Border-radius // .rounded { - @include border-radius($border-radius); + border-radius: $border-radius !important; } .rounded-top { - @include border-top-radius($border-radius); + border-top-left-radius: $border-radius !important; + border-top-right-radius: $border-radius !important; } .rounded-right { - @include border-right-radius($border-radius); + border-top-right-radius: $border-radius !important; + border-bottom-right-radius: $border-radius !important; } .rounded-bottom { - @include border-bottom-radius($border-radius); + border-bottom-right-radius: $border-radius !important; + border-bottom-left-radius: $border-radius !important; } .rounded-left { - @include border-left-radius($border-radius); + border-top-left-radius: $border-radius !important; + border-bottom-left-radius: $border-radius !important; } .rounded-circle { diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_display.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_display.scss index ae942a6fb97..45353620ab4 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_display.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_display.scss @@ -1,5 +1,5 @@ // -// Display utilities +// Utilities for common `display` values // @each $breakpoint in map-keys($grid-breakpoints) { @@ -16,3 +16,38 @@ .d#{$infix}-inline-flex { display: inline-flex !important; } } } + + +// +// Utilities for toggling `display` in print +// + +.d-print-block { + display: none !important; + + @media print { + display: block !important; + } +} + +.d-print-inline { + display: none !important; + + @media print { + display: inline !important; + } +} + +.d-print-inline-block { + display: none !important; + + @media print { + display: inline-block !important; + } +} + +.d-print-none { + @media print { + display: none !important; + } +} diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_responsive-embed.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_embed.scss similarity index 100% rename from backend/vendor/assets/stylesheets/solidus_admin/bootstrap/_responsive-embed.scss rename to backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_embed.scss diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_flex.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_flex.scss index 1b98aaa3fa8..b28c0b97de9 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_flex.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_flex.scss @@ -6,10 +6,6 @@ @include media-breakpoint-up($breakpoint) { $infix: breakpoint-infix($breakpoint, $grid-breakpoints); - .flex#{$infix}-first { order: -1; } - .flex#{$infix}-last { order: 1; } - .flex#{$infix}-unordered { order: 0; } - .flex#{$infix}-row { flex-direction: row !important; } .flex#{$infix}-column { flex-direction: column !important; } .flex#{$infix}-row-reverse { flex-direction: row-reverse !important; } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_position.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_position.scss index 2cf08bfa013..74b8d39e703 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_position.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_position.scss @@ -17,7 +17,9 @@ } .sticky-top { - position: sticky; - top: 0; - z-index: $zindex-sticky; + @supports (position: sticky) { + position: sticky; + top: 0; + z-index: $zindex-sticky; + } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_spacing.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_spacing.scss index 6056e2b7e27..c89816b5efc 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_spacing.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_spacing.scss @@ -5,22 +5,20 @@ $infix: breakpoint-infix($breakpoint, $grid-breakpoints); @each $prop, $abbrev in (margin: m, padding: p) { - @each $size, $lengths in $spacers { - $length-x: map-get($lengths, x); - $length-y: map-get($lengths, y); + @each $size, $length in $spacers { - .#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length-y $length-x !important; } - .#{$abbrev}t#{$infix}-#{$size} { #{$prop}-top: $length-y !important; } - .#{$abbrev}r#{$infix}-#{$size} { #{$prop}-right: $length-x !important; } - .#{$abbrev}b#{$infix}-#{$size} { #{$prop}-bottom: $length-y !important; } - .#{$abbrev}l#{$infix}-#{$size} { #{$prop}-left: $length-x !important; } + .#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; } + .#{$abbrev}t#{$infix}-#{$size} { #{$prop}-top: $length !important; } + .#{$abbrev}r#{$infix}-#{$size} { #{$prop}-right: $length !important; } + .#{$abbrev}b#{$infix}-#{$size} { #{$prop}-bottom: $length !important; } + .#{$abbrev}l#{$infix}-#{$size} { #{$prop}-left: $length !important; } .#{$abbrev}x#{$infix}-#{$size} { - #{$prop}-right: $length-x !important; - #{$prop}-left: $length-x !important; + #{$prop}-right: $length !important; + #{$prop}-left: $length !important; } .#{$abbrev}y#{$infix}-#{$size} { - #{$prop}-top: $length-y !important; - #{$prop}-bottom: $length-y !important; + #{$prop}-top: $length !important; + #{$prop}-bottom: $length !important; } } } diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_text.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_text.scss index 4ac90533acb..d337e0d63ea 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_text.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_text.scss @@ -34,25 +34,13 @@ // Contextual colors -.text-white { - color: #fff !important; -} - -@include text-emphasis-variant('.text-muted', $text-muted); - -@include text-emphasis-variant('.text-primary', $brand-primary); - -@include text-emphasis-variant('.text-success', $brand-success); +.text-white { color: #fff !important; } -@include text-emphasis-variant('.text-info', $brand-info); - -@include text-emphasis-variant('.text-warning', $brand-warning); - -@include text-emphasis-variant('.text-danger', $brand-danger); - -// Font color +@each $color, $value in $theme-colors { + @include text-emphasis-variant('.text-#{$color}', $value); +} -@include text-emphasis-variant('.text-gray-dark', $gray-dark); +.text-muted { color: $text-muted !important; } // Misc diff --git a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_visibility.scss b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_visibility.scss index fcedc9cb912..823406dc3c7 100644 --- a/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_visibility.scss +++ b/backend/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_visibility.scss @@ -2,54 +2,10 @@ // Visibility utilities // -.invisible { - @include invisible(); -} - -// Responsive visibility utilities - -@each $bp in map-keys($grid-breakpoints) { - .hidden-#{$bp}-up { - @include media-breakpoint-up($bp) { - display: none !important; - } - } - .hidden-#{$bp}-down { - @include media-breakpoint-down($bp) { - display: none !important; - } - } +.visible { + @include invisible(visible); } - -// Print utilities -// -// Media queries are placed on the inside to be mixin-friendly. - -.visible-print-block { - display: none !important; - - @media print { - display: block !important; - } -} -.visible-print-inline { - display: none !important; - - @media print { - display: inline !important; - } -} -.visible-print-inline-block { - display: none !important; - - @media print { - display: inline-block !important; - } -} - -.hidden-print { - @media print { - display: none !important; - } +.invisible { + @include invisible(hidden); }