diff options
| author | Mark Otto <[email protected]> | 2016-07-23 21:05:18 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-07-23 21:05:18 -0700 |
| commit | 7fd00263e35f891bfc792f9dd12c17a5025cd93c (patch) | |
| tree | 28d07418fb7abfacccb317b501937e02ffccf096 /scss | |
| parent | d4457b33032d2540a4a3b7fa600f22055ce2000d (diff) | |
| parent | 38312640df9c4b84a47e62d7dfeb16b25049aafb (diff) | |
| download | bootstrap-7fd00263e35f891bfc792f9dd12c17a5025cd93c.tar.xz bootstrap-7fd00263e35f891bfc792f9dd12c17a5025cd93c.zip | |
Merge branch 'v4-dev' into v4-navbars
Diffstat (limited to 'scss')
| -rw-r--r-- | scss/.scss-lint.yml | 2 | ||||
| -rw-r--r-- | scss/_popover.scss | 6 | ||||
| -rw-r--r-- | scss/_reboot.scss | 5 | ||||
| -rw-r--r-- | scss/_variables.scss | 7 | ||||
| -rw-r--r-- | scss/bootstrap.scss | 1 | ||||
| -rw-r--r-- | scss/mixins/_grid-framework.scss | 32 | ||||
| -rw-r--r-- | scss/mixins/_grid.scss | 13 | ||||
| -rw-r--r-- | scss/mixins/_hover.scss | 19 | ||||
| -rw-r--r-- | scss/mixins/_tab-focus.scss | 6 | ||||
| -rw-r--r-- | scss/utilities/_flex.scss | 1 |
10 files changed, 62 insertions, 30 deletions
diff --git a/scss/.scss-lint.yml b/scss/.scss-lint.yml index af837e4d0..66c63335c 100644 --- a/scss/.scss-lint.yml +++ b/scss/.scss-lint.yml @@ -457,7 +457,7 @@ linters: Shorthand: enabled: true - allowed_shorthands: [1, 2, 3] + allowed_shorthands: [1, 2, 3, 4] SingleLinePerProperty: enabled: false diff --git a/scss/_popover.scss b/scss/_popover.scss index 9ea8c1475..6e6fe3c9c 100644 --- a/scss/_popover.scss +++ b/scss/_popover.scss @@ -5,7 +5,7 @@ z-index: $zindex-popover; display: block; max-width: $popover-max-width; - padding: 1px; + padding: $popover-inner-padding; // 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(); @@ -112,6 +112,10 @@ border-bottom: $popover-border-width solid darken($popover-title-bg, 5%); $offset-border-width: ($border-width / $font-size-root); @include border-radius(($border-radius-lg - $offset-border-width) ($border-radius-lg - $offset-border-width) 0 0); + + &:empty { + display: none; + } } .popover-content { diff --git a/scss/_reboot.scss b/scss/_reboot.scss index e30de2c1b..02c579d32 100644 --- a/scss/_reboot.scss +++ b/scss/_reboot.scss @@ -171,12 +171,13 @@ a { } } -// And undo these styles for placeholder links/named anchors (without href). +// And undo these styles for placeholder links/named anchors (without href) +// which have not been made explicitly keyboard-focusable (without tabindex). // It would be more straightforward to just use a[href] in previous block, but that // causes specificity issues in many other styles that are too complex to fix. // See https://github.com/twbs/bootstrap/issues/19402 -a:not([href]) { +a:not([href]):not([tabindex]) { color: inherit; text-decoration: none; diff --git a/scss/_variables.scss b/scss/_variables.scss index 842b433a1..90d6e5b51 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -21,7 +21,11 @@ $prev-key: null; $prev-num: null; @each $key, $num in $map { - @if $prev-num != null and $prev-num >= $num { + @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; @@ -614,6 +618,7 @@ $tooltip-arrow-color: $tooltip-bg !default; // Popovers +$popover-inner-padding: 1px !default; $popover-bg: #fff !default; $popover-max-width: 276px !default; $popover-border-width: $border-width !default; diff --git a/scss/bootstrap.scss b/scss/bootstrap.scss index f99a722ca..7697abb18 100644 --- a/scss/bootstrap.scss +++ b/scss/bootstrap.scss @@ -1,5 +1,6 @@ /*! * Bootstrap v4.0.0-alpha.2 (http://getbootstrap.com) + * Copyright 2011-2016 The Bootstrap Authors * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ diff --git a/scss/mixins/_grid-framework.scss b/scss/mixins/_grid-framework.scss index cb25be92a..be2ee50db 100644 --- a/scss/mixins/_grid-framework.scss +++ b/scss/mixins/_grid-framework.scss @@ -4,22 +4,32 @@ // any value of `$grid-columns`. @mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) { + + // Common properties for all breakpoints + %grid-column { + position: relative; + // Prevent columns from collapsing when empty + min-height: 1px; + // Inner gutter via padding + padding-right: ($gutter / 2); + padding-left: ($gutter / 2); + + @if $enable-flex { + width: 100%; + } + } + $breakpoint-counter: 0; @each $breakpoint in map-keys($breakpoints) { $breakpoint-counter: ($breakpoint-counter + 1); - @include media-breakpoint-up($breakpoint, $breakpoints) { - @if $enable-flex { - .col-#{$breakpoint} { - position: relative; - flex-basis: 0; - flex-grow: 1; - max-width: 100%; - min-height: 1px; - padding-right: ($gutter / 2); - padding-left: ($gutter / 2); - } + + @for $i from 1 through $columns { + .col-#{$breakpoint}-#{$i} { + @extend %grid-column; } + } + @include media-breakpoint-up($breakpoint, $breakpoints) { @for $i from 1 through $columns { .col-#{$breakpoint}-#{$i} { @include make-col($i, $columns, $gutter); diff --git a/scss/mixins/_grid.scss b/scss/mixins/_grid.scss index 3ba4f43bc..87f112278 100644 --- a/scss/mixins/_grid.scss +++ b/scss/mixins/_grid.scss @@ -33,12 +33,21 @@ margin-right: ($gutter / -2); } -@mixin make-col($size, $columns: $grid-columns, $gutter: $grid-gutter-width) { +@mixin make-col-ready($size, $columns: $grid-columns, $gutter: $grid-gutter-width) { position: relative; - min-height: 1px; + min-height: 1px; // Prevent collapsing padding-right: ($gutter / 2); padding-left: ($gutter / 2); + // 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. + @if $enable-flex { + width: 100%; + } +} + +@mixin make-col($size, $columns: $grid-columns, $gutter: $grid-gutter-width) { @if $enable-flex { flex: 0 0 percentage($size / $columns); // Add a `max-width` to ensure content within each column does not blow out diff --git a/scss/mixins/_hover.scss b/scss/mixins/_hover.scss index 3a11254e8..4a648a54d 100644 --- a/scss/mixins/_hover.scss +++ b/scss/mixins/_hover.scss @@ -1,14 +1,15 @@ @mixin hover { - @if $enable-hover-media-query { - // See Media Queries Level 4: http://drafts.csswg.org/mediaqueries/#hover - // Currently shimmed by https://github.com/twbs/mq4-hover-shim - @media (hover: hover) { - &:hover { @content } - } - } - @else { + // TODO: re-enable along with mq4-hover-shim +// @if $enable-hover-media-query { +// // See Media Queries Level 4: http://drafts.csswg.org/mediaqueries/#hover +// // Currently shimmed by https://github.com/twbs/mq4-hover-shim +// @media (hover: hover) { +// &:hover { @content } +// } +// } +// @else { &:hover { @content } - } +// } } @mixin hover-focus { diff --git a/scss/mixins/_tab-focus.scss b/scss/mixins/_tab-focus.scss index 7df0ae7ca..f16ed6428 100644 --- a/scss/mixins/_tab-focus.scss +++ b/scss/mixins/_tab-focus.scss @@ -1,9 +1,9 @@ // WebKit-style focus @mixin tab-focus() { - // Default - outline: thin dotted; - // WebKit + // WebKit-specific. Other browsers will keep their default outline style. + // (Initially tried to also force default via `outline: initial`, + // but that seems to erroneously remove the outline in Firefox altogether.) outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } diff --git a/scss/utilities/_flex.scss b/scss/utilities/_flex.scss index a61135ce2..502885a81 100644 --- a/scss/utilities/_flex.scss +++ b/scss/utilities/_flex.scss @@ -8,6 +8,7 @@ @include media-breakpoint-up($breakpoint) { .flex-#{$breakpoint}-first { order: -1; } .flex-#{$breakpoint}-last { order: 1; } + .flex-#{$breakpoint}-unordered { order: 0; } } // Alignment for every item |
