summaryrefslogtreecommitdiff
path: root/src/sass/bootstrap4/mixins
diff options
context:
space:
mode:
Diffstat (limited to 'src/sass/bootstrap4/mixins')
-rw-r--r--src/sass/bootstrap4/mixins/_alert.scss14
-rw-r--r--src/sass/bootstrap4/mixins/_background-variant.scss13
-rw-r--r--src/sass/bootstrap4/mixins/_border-radius.scss35
-rw-r--r--src/sass/bootstrap4/mixins/_breakpoints.scss86
-rw-r--r--src/sass/bootstrap4/mixins/_buttons.scss100
-rw-r--r--src/sass/bootstrap4/mixins/_cards.scss38
-rw-r--r--src/sass/bootstrap4/mixins/_center-block.scss7
-rw-r--r--src/sass/bootstrap4/mixins/_clearfix.scss7
-rw-r--r--src/sass/bootstrap4/mixins/_forms.scss89
-rw-r--r--src/sass/bootstrap4/mixins/_gradients.scss43
-rw-r--r--src/sass/bootstrap4/mixins/_grid-framework.scss44
-rw-r--r--src/sass/bootstrap4/mixins/_grid.scss75
-rw-r--r--src/sass/bootstrap4/mixins/_hover.scss59
-rw-r--r--src/sass/bootstrap4/mixins/_image.scss34
-rw-r--r--src/sass/bootstrap4/mixins/_label.scss11
-rw-r--r--src/sass/bootstrap4/mixins/_list-group.scss30
-rw-r--r--src/sass/bootstrap4/mixins/_lists.scss7
-rw-r--r--src/sass/bootstrap4/mixins/_nav-divider.scss10
-rw-r--r--src/sass/bootstrap4/mixins/_navbar-align.scss9
-rw-r--r--src/sass/bootstrap4/mixins/_pagination.scss22
-rw-r--r--src/sass/bootstrap4/mixins/_progress.scss18
-rw-r--r--src/sass/bootstrap4/mixins/_pulls.scss6
-rw-r--r--src/sass/bootstrap4/mixins/_reset-filter.scss8
-rw-r--r--src/sass/bootstrap4/mixins/_reset-text.scss18
-rw-r--r--src/sass/bootstrap4/mixins/_resize.scss6
-rw-r--r--src/sass/bootstrap4/mixins/_screen-reader.scss32
-rw-r--r--src/sass/bootstrap4/mixins/_size.scss6
-rw-r--r--src/sass/bootstrap4/mixins/_tab-focus.scss9
-rw-r--r--src/sass/bootstrap4/mixins/_table-row.scss30
-rw-r--r--src/sass/bootstrap4/mixins/_text-emphasis.scss12
-rw-r--r--src/sass/bootstrap4/mixins/_text-hide.scss8
-rw-r--r--src/sass/bootstrap4/mixins/_text-truncate.scss8
32 files changed, 894 insertions, 0 deletions
diff --git a/src/sass/bootstrap4/mixins/_alert.scss b/src/sass/bootstrap4/mixins/_alert.scss
new file mode 100644
index 0000000..6ed3a81
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_alert.scss
@@ -0,0 +1,14 @@
+// Alerts
+
+@mixin alert-variant($background, $border, $body-color) {
+ background-color: $background;
+ border-color: $border;
+ color: $body-color;
+
+ hr {
+ border-top-color: darken($border, 5%);
+ }
+ .alert-link {
+ color: darken($body-color, 10%);
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_background-variant.scss b/src/sass/bootstrap4/mixins/_background-variant.scss
new file mode 100644
index 0000000..0c9f2f0
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_background-variant.scss
@@ -0,0 +1,13 @@
+// Contextual backgrounds
+
+@mixin bg-variant($parent, $color) {
+ #{$parent} {
+ color: #fff !important;
+ background-color: $color !important;
+ }
+ a#{$parent} {
+ @include hover-focus {
+ background-color: darken($color, 10%);
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_border-radius.scss b/src/sass/bootstrap4/mixins/_border-radius.scss
new file mode 100644
index 0000000..54f29f4
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_border-radius.scss
@@ -0,0 +1,35 @@
+// Single side border-radius
+
+@mixin border-radius($radius: $border-radius) {
+ @if $enable-rounded {
+ border-radius: $radius;
+ }
+}
+
+@mixin border-top-radius($radius) {
+ @if $enable-rounded {
+ border-top-right-radius: $radius;
+ border-top-left-radius: $radius;
+ }
+}
+
+@mixin border-right-radius($radius) {
+ @if $enable-rounded {
+ border-bottom-right-radius: $radius;
+ border-top-right-radius: $radius;
+ }
+}
+
+@mixin border-bottom-radius($radius) {
+ @if $enable-rounded {
+ border-bottom-right-radius: $radius;
+ border-bottom-left-radius: $radius;
+ }
+}
+
+@mixin border-left-radius($radius) {
+ @if $enable-rounded {
+ border-bottom-left-radius: $radius;
+ border-top-left-radius: $radius;
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_breakpoints.scss b/src/sass/bootstrap4/mixins/_breakpoints.scss
new file mode 100644
index 0000000..a868833
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_breakpoints.scss
@@ -0,0 +1,86 @@
+// Breakpoint viewport sizes and media queries.
+//
+// Breakpoints are defined as a map of (name: minimum width), order from small to large:
+//
+// (xs: 0, sm: 544px, md: 768px)
+//
+// The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.
+
+// Name of the next breakpoint, or null for the last breakpoint.
+//
+// >> breakpoint-next(sm)
+// md
+// >> breakpoint-next(sm, (xs: 0, sm: 544px, md: 768px))
+// md
+// >> breakpoint-next(sm, $breakpoint-names: (xs sm md))
+// md
+@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
+ $n: index($breakpoint-names, $name);
+ @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
+}
+
+// Minimum breakpoint width. Null for the smallest (first) breakpoint.
+//
+// >> breakpoint-min(sm, (xs: 0, sm: 544px, md: 768px))
+// 544px
+@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
+ $min: map-get($breakpoints, $name);
+ @return if($min != 0, $min, null);
+}
+
+// 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: 544px, md: 768px))
+// 767px
+@function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
+ $next: breakpoint-next($name, $breakpoints);
+ @return if($next, breakpoint-min($next, $breakpoints) - 1px, null);
+}
+
+// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
+// Makes the @content apply to the given breakpoint and wider.
+@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
+ $min: breakpoint-min($name, $breakpoints);
+ @if $min {
+ @media (min-width: $min) {
+ @content;
+ }
+ } @else {
+ @content;
+ }
+}
+
+// Media of at most the maximum breakpoint width. No query for the largest breakpoint.
+// Makes the @content apply to the given breakpoint and narrower.
+@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {
+ $max: breakpoint-max($name, $breakpoints);
+ @if $max {
+ @media (max-width: $max) {
+ @content;
+ }
+ } @else {
+ @content;
+ }
+}
+
+// Media between the breakpoint's minimum and maximum widths.
+// 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-up($name, $breakpoints) {
+ @include media-breakpoint-down($name, $breakpoints) {
+ @content;
+ }
+ }
+}
+
+// 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;
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_buttons.scss b/src/sass/bootstrap4/mixins/_buttons.scss
new file mode 100644
index 0000000..61b9f9c
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_buttons.scss
@@ -0,0 +1,100 @@
+// Button variants
+//
+// 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;
+ background-color: $background;
+ border-color: $border;
+ @include box-shadow(inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075));
+
+ @include hover {
+ color: $color;
+ background-color: $active-background;
+ border-color: $active-border;
+ }
+
+ &:focus,
+ &.focus {
+ color: $color;
+ background-color: $active-background;
+ border-color: $active-border;
+ }
+
+ &:active,
+ &.active,
+ .open > &.dropdown-toggle {
+ color: $color;
+ background-color: $active-background;
+ border-color: $active-border;
+ // Remove the gradient for the pressed/active state
+ background-image: none;
+ @include box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
+
+ &:hover,
+ &:focus,
+ &.focus {
+ color: $color;
+ background-color: darken($background, 17%);
+ border-color: darken($border, 25%);
+ }
+ }
+
+ &.disabled,
+ &:disabled {
+ &:focus,
+ &.focus {
+ background-color: $background;
+ border-color: $border;
+ }
+ @include hover {
+ background-color: $background;
+ border-color: $border;
+ }
+ }
+}
+
+@mixin button-outline-variant($color) {
+ color: $color;
+ background-image: none;
+ background-color: transparent;
+ border-color: $color;
+
+ &:focus,
+ &.focus,
+ &:active,
+ &.active,
+ .open > &.dropdown-toggle {
+ color: #fff;
+ background-color: $color;
+ border-color: $color;
+ }
+ @include hover {
+ color: #fff;
+ background-color: $color;
+ border-color: $color;
+ }
+
+ &.disabled,
+ &:disabled {
+ &:focus,
+ &.focus {
+ border-color: lighten($color, 20%);
+ }
+ @include hover {
+ border-color: lighten($color, 20%);
+ }
+ }
+}
+
+// Button sizes
+@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/src/sass/bootstrap4/mixins/_cards.scss b/src/sass/bootstrap4/mixins/_cards.scss
new file mode 100644
index 0000000..1ce28f1
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_cards.scss
@@ -0,0 +1,38 @@
+// Card variants
+
+@mixin card-variant($background, $border) {
+ background-color: $background;
+ border-color: $border;
+}
+
+@mixin card-outline-variant($color) {
+ background-color: transparent;
+ border-color: $color;
+}
+
+//
+// Inverse text within a card for use with dark backgrounds
+//
+
+@mixin card-inverse {
+ .card-header,
+ .card-footer {
+ border-bottom: $card-border-width solid rgba(255,255,255,.2);
+ }
+ .card-header,
+ .card-footer,
+ .card-title,
+ .card-blockquote {
+ color: #fff;
+ }
+ .card-link,
+ .card-text,
+ .card-blockquote > footer {
+ color: rgba(255,255,255,.65);
+ }
+ .card-link {
+ @include hover-focus {
+ color: $card-link-hover-color;
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_center-block.scss b/src/sass/bootstrap4/mixins/_center-block.scss
new file mode 100644
index 0000000..e06fb5e
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_center-block.scss
@@ -0,0 +1,7 @@
+// Center-align a block level element
+
+@mixin center-block() {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
diff --git a/src/sass/bootstrap4/mixins/_clearfix.scss b/src/sass/bootstrap4/mixins/_clearfix.scss
new file mode 100644
index 0000000..d0ae125
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_clearfix.scss
@@ -0,0 +1,7 @@
+@mixin clearfix() {
+ &::after {
+ content: "";
+ display: table;
+ clear: both;
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_forms.scss b/src/sass/bootstrap4/mixins/_forms.scss
new file mode 100644
index 0000000..eab8063
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_forms.scss
@@ -0,0 +1,89 @@
+// 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
+ .text-help,
+ .form-control-label,
+ .radio,
+ .checkbox,
+ .radio-inline,
+ .checkbox-inline,
+ &.radio label,
+ &.checkbox label,
+ &.radio-inline label,
+ &.checkbox-inline label {
+ color: $color;
+ }
+ // Set the border and box shadow on specific inputs to match
+ .form-control {
+ border-color: $color;
+ // @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
+
+ &:focus {
+ // border-color: darken($border-color, 10%);
+ // $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%);
+ // @include box-shadow($shadow);
+ }
+ }
+
+ // Set validation states also for addons
+ .input-group-addon {
+ color: $color;
+ border-color: $color;
+ background-color: lighten($color, 40%);
+ }
+ // Optional feedback icon
+ .form-control-feedback {
+ color: $color;
+ }
+}
+
+// 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.
+//
+// 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
+// WebKit's default styles, but applicable to a wider range of browsers. Its
+// usability and accessibility should be taken into account with any change.
+//
+// Example usage: change the default blue border and shadow to white for better
+// contrast against a dark gray background.
+@mixin form-control-focus() {
+ &:focus {
+ border-color: $input-border-focus;
+ outline: none;
+ $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $input-box-shadow-focus;
+ @include box-shadow($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. `<select>`
+// element gets special love because it's special, and that's a fact!
+
+@mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
+ #{$parent} {
+ height: $input-height;
+ padding: $padding-vertical $padding-horizontal;
+ font-size: $font-size;
+ line-height: $line-height;
+ @include border-radius($border-radius);
+ }
+
+ select#{$parent} {
+ height: $input-height;
+ line-height: $input-height;
+ }
+
+ textarea#{$parent},
+ select[multiple]#{$parent} {
+ height: auto;
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_gradients.scss b/src/sass/bootstrap4/mixins/_gradients.scss
new file mode 100644
index 0000000..c57eddc
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_gradients.scss
@@ -0,0 +1,43 @@
+// Gradients
+
+// Horizontal gradient, from left to right
+//
+// Creates two color stops, start and end, by specifying a color and position for each color stop.
+// Color stops are not available in IE9.
+@mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
+ background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9
+}
+
+// Vertical gradient, from top to bottom
+//
+// Creates two color stops, start and end, by specifying a color and position for each color stop.
+// Color stops are not available in IE9.
+@mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
+ background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9
+}
+
+@mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) {
+ background-repeat: repeat-x;
+ background-image: linear-gradient($deg, $start-color, $end-color);
+}
+@mixin gradient-horizontal-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);
+ background-repeat: no-repeat;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 gets no color-stop at all for proper fallback
+}
+@mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
+ background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
+ background-repeat: no-repeat;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 gets no color-stop at all for proper fallback
+}
+@mixin gradient-radial($inner-color: #555, $outer-color: #333) {
+ background-image: radial-gradient(circle, $inner-color, $outer-color);
+ background-repeat: no-repeat;
+}
+@mixin gradient-striped($color: rgba(255,255,255,.15), $angle: 45deg) {
+ background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
+} \ No newline at end of file
diff --git a/src/sass/bootstrap4/mixins/_grid-framework.scss b/src/sass/bootstrap4/mixins/_grid-framework.scss
new file mode 100644
index 0000000..aa5f492
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_grid-framework.scss
@@ -0,0 +1,44 @@
+// Framework grid generation
+//
+// 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, $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-left: ($gutter / 2);
+ padding-right: ($gutter / 2);
+ }
+ @each $breakpoint in map-keys($breakpoints) {
+ @for $i from 1 through $columns {
+ .col-#{$breakpoint}-#{$i} {
+ @extend %grid-column;
+ }
+ }
+ @include media-breakpoint-up($breakpoint) {
+ // Work around cross-media @extend (https://github.com/sass/sass/issues/1050)
+ %grid-column-float-#{$breakpoint} {
+ float: left;
+ }
+ @for $i from 1 through $columns {
+ .col-#{$breakpoint}-#{$i} {
+ @if not $enable-flex {
+ @extend %grid-column-float-#{$breakpoint};
+ }
+ @include make-col-span($i, $columns);
+ }
+ }
+ @each $modifier in (pull, push, offset) {
+ @for $i from 0 through $columns {
+ .col-#{$breakpoint}-#{$modifier}-#{$i} {
+ @include make-col-modifier($modifier, $i, $columns)
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_grid.scss b/src/sass/bootstrap4/mixins/_grid.scss
new file mode 100644
index 0000000..94b8295
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_grid.scss
@@ -0,0 +1,75 @@
+/// Grid system
+//
+// Generate semantic grid columns with these mixins.
+
+@mixin make-container($gutter: $grid-gutter-width) {
+ margin-left: auto;
+ margin-right: auto;
+ padding-left: ($gutter / 2);
+ padding-right: ($gutter / 2);
+ @if not $enable-flex {
+ @include clearfix();
+ }
+}
+
+
+// For each breakpoint, define the maximum width of the container in a media query
+@mixin make-container-max-widths($max-widths: $container-max-widths) {
+ @each $breakpoint, $container-max-width in $max-widths {
+ @include media-breakpoint-up($breakpoint) {
+ max-width: $container-max-width;
+ }
+ }
+}
+
+@mixin make-row($gutter: $grid-gutter-width) {
+ @if $enable-flex {
+ display: flex;
+ flex-wrap: wrap;
+ } @else {
+ @include clearfix();
+ }
+ margin-left: ($gutter / -2);
+ margin-right: ($gutter / -2);
+}
+
+@mixin make-col($gutter: $grid-gutter-width) {
+ position: relative;
+ @if not $enable-flex {
+ float: left;
+ }
+ min-height: 1px;
+ padding-left: ($gutter / 2);
+ padding-right: ($gutter / 2);
+}
+
+@mixin make-col-span($size, $columns: $grid-columns) {
+ @if $enable-flex {
+ flex: 0 0 percentage($size / $columns);
+ } @else {
+ 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/src/sass/bootstrap4/mixins/_hover.scss b/src/sass/bootstrap4/mixins/_hover.scss
new file mode 100644
index 0000000..3a11254
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_hover.scss
@@ -0,0 +1,59 @@
+@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 {
+ &:hover { @content }
+ }
+}
+
+@mixin hover-focus {
+ @if $enable-hover-media-query {
+ &:focus { @content }
+ @include hover { @content }
+ }
+ @else {
+ &:focus,
+ &:hover {
+ @content
+ }
+ }
+}
+
+@mixin plain-hover-focus {
+ @if $enable-hover-media-query {
+ &,
+ &:focus {
+ @content
+ }
+ @include hover { @content }
+ }
+ @else {
+ &,
+ &:focus,
+ &:hover {
+ @content
+ }
+ }
+}
+
+@mixin hover-focus-active {
+ @if $enable-hover-media-query {
+ &:focus,
+ &:active {
+ @content
+ }
+ @include hover { @content }
+ }
+ @else {
+ &:focus,
+ &:active,
+ &:hover {
+ @content
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_image.scss b/src/sass/bootstrap4/mixins/_image.scss
new file mode 100644
index 0000000..91d2f59
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_image.scss
@@ -0,0 +1,34 @@
+// Image Mixins
+// - Responsive image
+// - Retina image
+
+
+// Responsive image
+//
+// Keep images from scaling beyond the width of their parents.
+
+@mixin img-fluid($display: block) {
+ display: $display;
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
+}
+
+
+// Retina image
+//
+// Short retina mixin for setting background-image and -size.
+
+@mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
+ background-image: url($file-1x);
+
+ // Autoprefixer takes care of adding -webkit-min-device-pixel-ratio and -o-min-device-pixel-ratio,
+ // but doesn't convert dppx=>dpi.
+ // There's no such thing as unprefixed min-device-pixel-ratio since it's nonstandard.
+ // Compatibility info: http://caniuse.com/#feat=css-media-resolution
+ @media
+ only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx
+ only screen and (min-resolution: 2dppx) { // Standardized
+ background-image: url($file-2x);
+ background-size: $width-1x $height-1x;
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_label.scss b/src/sass/bootstrap4/mixins/_label.scss
new file mode 100644
index 0000000..4bc48c6
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_label.scss
@@ -0,0 +1,11 @@
+// Labels
+
+@mixin label-variant($color) {
+ background-color: $color;
+
+ &[href] {
+ @include hover-focus {
+ background-color: darken($color, 10%);
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_list-group.scss b/src/sass/bootstrap4/mixins/_list-group.scss
new file mode 100644
index 0000000..81b0f16
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_list-group.scss
@@ -0,0 +1,30 @@
+// List Groups
+
+@mixin list-group-item-variant($state, $background, $color) {
+ .list-group-item-#{$state} {
+ color: $color;
+ background-color: $background;
+ }
+
+ 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%);
+ }
+
+ &.active {
+ @include plain-hover-focus {
+ color: #fff;
+ background-color: $color;
+ border-color: $color;
+ }
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_lists.scss b/src/sass/bootstrap4/mixins/_lists.scss
new file mode 100644
index 0000000..2518562
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_lists.scss
@@ -0,0 +1,7 @@
+// Lists
+
+// Unstyled keeps list items block level, just removes default browser padding and list-style
+@mixin list-unstyled {
+ padding-left: 0;
+ list-style: none;
+}
diff --git a/src/sass/bootstrap4/mixins/_nav-divider.scss b/src/sass/bootstrap4/mixins/_nav-divider.scss
new file mode 100644
index 0000000..fb3d12e
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_nav-divider.scss
@@ -0,0 +1,10 @@
+// Horizontal dividers
+//
+// Dividers (basically an hr) within dropdowns and nav lists
+
+@mixin nav-divider($color: #e5e5e5) {
+ height: 1px;
+ margin: ($spacer-y / 2) 0;
+ overflow: hidden;
+ background-color: $color;
+}
diff --git a/src/sass/bootstrap4/mixins/_navbar-align.scss b/src/sass/bootstrap4/mixins/_navbar-align.scss
new file mode 100644
index 0000000..c454a4f
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_navbar-align.scss
@@ -0,0 +1,9 @@
+// Navbar vertical align
+//
+// Vertically center elements in the navbar.
+// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
+
+// @mixin navbar-vertical-align($element-height) {
+// margin-top: (($navbar-height - $element-height) / 2);
+// margin-bottom: (($navbar-height - $element-height) / 2);
+// }
diff --git a/src/sass/bootstrap4/mixins/_pagination.scss b/src/sass/bootstrap4/mixins/_pagination.scss
new file mode 100644
index 0000000..eaebe89
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_pagination.scss
@@ -0,0 +1,22 @@
+// Pagination
+
+@mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
+ .page-link {
+ padding: $padding-vertical $padding-horizontal;
+ font-size: $font-size;
+ line-height: $line-height;
+ }
+
+ .page-item {
+ &:first-child {
+ .page-link {
+ @include border-left-radius($border-radius);
+ }
+ }
+ &:last-child {
+ .page-link {
+ @include border-right-radius($border-radius);
+ }
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_progress.scss b/src/sass/bootstrap4/mixins/_progress.scss
new file mode 100644
index 0000000..e174141
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_progress.scss
@@ -0,0 +1,18 @@
+// Progress bars
+
+@mixin progress-variant($color) {
+ &[value]::-webkit-progress-value {
+ background-color: $color;
+ }
+
+ &[value]::-moz-progress-bar {
+ background-color: $color;
+ }
+
+ // IE9
+ @media screen and (min-width:0\0) {
+ .progress-bar {
+ background-color: $color;
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_pulls.scss b/src/sass/bootstrap4/mixins/_pulls.scss
new file mode 100644
index 0000000..6bdff02
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_pulls.scss
@@ -0,0 +1,6 @@
+@mixin pull-left {
+ float: left !important;
+}
+@mixin pull-right {
+ float: right !important;
+}
diff --git a/src/sass/bootstrap4/mixins/_reset-filter.scss b/src/sass/bootstrap4/mixins/_reset-filter.scss
new file mode 100644
index 0000000..044b349
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_reset-filter.scss
@@ -0,0 +1,8 @@
+// Reset filters for IE
+//
+// When you need to remove a gradient background, do not forget to use this to reset
+// the IE filter for IE9.
+
+@mixin reset-filter() {
+ filter: "progid:DXImageTransform.Microsoft.gradient(enabled = false)";
+}
diff --git a/src/sass/bootstrap4/mixins/_reset-text.scss b/src/sass/bootstrap4/mixins/_reset-text.scss
new file mode 100644
index 0000000..014dff5
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_reset-text.scss
@@ -0,0 +1,18 @@
+@mixin reset-text {
+ font-family: $font-family-base;
+ // We deliberately do NOT reset font-size.
+ font-style: normal;
+ font-weight: normal;
+ letter-spacing: normal;
+ line-break: auto;
+ line-height: $line-height;
+ 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;
+ word-break: normal;
+ word-spacing: normal;
+ word-wrap: normal;
+}
diff --git a/src/sass/bootstrap4/mixins/_resize.scss b/src/sass/bootstrap4/mixins/_resize.scss
new file mode 100644
index 0000000..83fa637
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_resize.scss
@@ -0,0 +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`
+}
diff --git a/src/sass/bootstrap4/mixins/_screen-reader.scss b/src/sass/bootstrap4/mixins/_screen-reader.scss
new file mode 100644
index 0000000..e52b282
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_screen-reader.scss
@@ -0,0 +1,32 @@
+// Only display content to screen readers
+//
+// See: http://a11yproject.com/posts/how-to-hide-content/
+
+@mixin sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0,0,0,0);
+ border: 0;
+}
+
+// Use in conjunction with .sr-only to only display content when it's focused.
+//
+// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
+//
+// Credit: HTML5 Boilerplate
+
+@mixin sr-only-focusable {
+ &:active,
+ &:focus {
+ position: static;
+ width: auto;
+ height: auto;
+ margin: 0;
+ overflow: visible;
+ clip: auto;
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_size.scss b/src/sass/bootstrap4/mixins/_size.scss
new file mode 100644
index 0000000..b9dd48e
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_size.scss
@@ -0,0 +1,6 @@
+// Sizing shortcuts
+
+@mixin size($width, $height: $width) {
+ width: $width;
+ height: $height;
+}
diff --git a/src/sass/bootstrap4/mixins/_tab-focus.scss b/src/sass/bootstrap4/mixins/_tab-focus.scss
new file mode 100644
index 0000000..7df0ae7
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_tab-focus.scss
@@ -0,0 +1,9 @@
+// WebKit-style focus
+
+@mixin tab-focus() {
+ // Default
+ outline: thin dotted;
+ // WebKit
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px;
+}
diff --git a/src/sass/bootstrap4/mixins/_table-row.scss b/src/sass/bootstrap4/mixins/_table-row.scss
new file mode 100644
index 0000000..84f1d30
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_table-row.scss
@@ -0,0 +1,30 @@
+// Tables
+
+@mixin table-row-variant($state, $background) {
+ // Exact selectors below required to override `.table-striped` and prevent
+ // inheritance to nested tables.
+ .table-#{$state} {
+ &,
+ > th,
+ > td {
+ background-color: $background;
+ }
+ }
+
+ // Hover states for `.table-hover`
+ // Note: this is not available for cells or rows within `thead` or `tfoot`.
+ .table-hover {
+ $hover-background: darken($background, 5%);
+
+ .table-#{$state} {
+ @include hover {
+ background-color: $hover-background;
+
+ > td,
+ > th {
+ background-color: $hover-background;
+ }
+ }
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_text-emphasis.scss b/src/sass/bootstrap4/mixins/_text-emphasis.scss
new file mode 100644
index 0000000..27a4f45
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_text-emphasis.scss
@@ -0,0 +1,12 @@
+// Typography
+
+@mixin text-emphasis-variant($parent, $color) {
+ #{$parent} {
+ color: $color !important;
+ }
+ a#{$parent} {
+ @include hover-focus {
+ color: darken($color, 10%);
+ }
+ }
+}
diff --git a/src/sass/bootstrap4/mixins/_text-hide.scss b/src/sass/bootstrap4/mixins/_text-hide.scss
new file mode 100644
index 0000000..daed5fb
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_text-hide.scss
@@ -0,0 +1,8 @@
+// CSS image replacement
+@mixin text-hide() {
+ font: "0/0" a;
+ color: transparent;
+ text-shadow: none;
+ background-color: transparent;
+ border: 0;
+}
diff --git a/src/sass/bootstrap4/mixins/_text-truncate.scss b/src/sass/bootstrap4/mixins/_text-truncate.scss
new file mode 100644
index 0000000..5a40bf5
--- /dev/null
+++ b/src/sass/bootstrap4/mixins/_text-truncate.scss
@@ -0,0 +1,8 @@
+// Text truncate
+// Requires inline-block or block for proper styling
+
+@mixin text-truncate() {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+} \ No newline at end of file