@coreui/coreui 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +183 -0
  3. package/dist/css/coreui-grid.css +5004 -0
  4. package/dist/css/coreui-grid.css.map +1 -0
  5. package/dist/css/coreui-grid.min.css +8 -0
  6. package/dist/css/coreui-grid.min.css.map +1 -0
  7. package/dist/css/coreui-grid.rtl.css +5011 -0
  8. package/dist/css/coreui-grid.rtl.css.map +1 -0
  9. package/dist/css/coreui-grid.rtl.min.css +14 -0
  10. package/dist/css/coreui-grid.rtl.min.css.map +1 -0
  11. package/dist/css/coreui-reboot.css +440 -0
  12. package/dist/css/coreui-reboot.css.map +1 -0
  13. package/dist/css/coreui-reboot.min.css +8 -0
  14. package/dist/css/coreui-reboot.min.css.map +1 -0
  15. package/dist/css/coreui-reboot.rtl.css +441 -0
  16. package/dist/css/coreui-reboot.rtl.css.map +1 -0
  17. package/dist/css/coreui-reboot.rtl.min.css +14 -0
  18. package/dist/css/coreui-reboot.rtl.min.css.map +1 -0
  19. package/dist/css/coreui-utilities.css +5030 -0
  20. package/dist/css/coreui-utilities.css.map +1 -0
  21. package/dist/css/coreui-utilities.min.css +8 -0
  22. package/dist/css/coreui-utilities.min.css.map +1 -0
  23. package/dist/css/coreui-utilities.rtl.css +5024 -0
  24. package/dist/css/coreui-utilities.rtl.css.map +1 -0
  25. package/dist/css/coreui-utilities.rtl.min.css +14 -0
  26. package/dist/css/coreui-utilities.rtl.min.css.map +1 -0
  27. package/dist/css/coreui.css +12152 -0
  28. package/dist/css/coreui.css.map +1 -0
  29. package/dist/css/coreui.min.css +8 -0
  30. package/dist/css/coreui.min.css.map +1 -0
  31. package/dist/css/coreui.rtl.css +12041 -0
  32. package/dist/css/coreui.rtl.css.map +1 -0
  33. package/dist/css/coreui.rtl.min.css +14 -0
  34. package/dist/css/coreui.rtl.min.css.map +1 -0
  35. package/dist/js/coreui.bundle.js +7437 -0
  36. package/dist/js/coreui.bundle.js.map +1 -0
  37. package/dist/js/coreui.bundle.min.js +7 -0
  38. package/dist/js/coreui.bundle.min.js.map +1 -0
  39. package/dist/js/coreui.esm.js +5622 -0
  40. package/dist/js/coreui.esm.js.map +1 -0
  41. package/dist/js/coreui.esm.min.js +7 -0
  42. package/dist/js/coreui.esm.min.js.map +1 -0
  43. package/dist/js/coreui.js +5673 -0
  44. package/dist/js/coreui.js.map +1 -0
  45. package/dist/js/coreui.min.js +7 -0
  46. package/dist/js/coreui.min.js.map +1 -0
  47. package/js/dist/alert.js +208 -0
  48. package/js/dist/alert.js.map +1 -0
  49. package/js/dist/base-component.js +181 -0
  50. package/js/dist/base-component.js.map +1 -0
  51. package/js/dist/button.js +142 -0
  52. package/js/dist/button.js.map +1 -0
  53. package/js/dist/carousel.js +724 -0
  54. package/js/dist/carousel.js.map +1 -0
  55. package/js/dist/collapse.js +515 -0
  56. package/js/dist/collapse.js.map +1 -0
  57. package/js/dist/dom/data.js +72 -0
  58. package/js/dist/dom/data.js.map +1 -0
  59. package/js/dist/dom/event-handler.js +319 -0
  60. package/js/dist/dom/event-handler.js.map +1 -0
  61. package/js/dist/dom/manipulator.js +92 -0
  62. package/js/dist/dom/manipulator.js.map +1 -0
  63. package/js/dist/dom/selector-engine.js +89 -0
  64. package/js/dist/dom/selector-engine.js.map +1 -0
  65. package/js/dist/dropdown.js +700 -0
  66. package/js/dist/dropdown.js.map +1 -0
  67. package/js/dist/modal.js +891 -0
  68. package/js/dist/modal.js.map +1 -0
  69. package/js/dist/offcanvas.js +724 -0
  70. package/js/dist/offcanvas.js.map +1 -0
  71. package/js/dist/popover.js +220 -0
  72. package/js/dist/popover.js.map +1 -0
  73. package/js/dist/scrollspy.js +387 -0
  74. package/js/dist/scrollspy.js.map +1 -0
  75. package/js/dist/tab.js +317 -0
  76. package/js/dist/tab.js.map +1 -0
  77. package/js/dist/toast.js +331 -0
  78. package/js/dist/toast.js.map +1 -0
  79. package/js/dist/tooltip.js +997 -0
  80. package/js/dist/tooltip.js.map +1 -0
  81. package/js/src/alert.js +128 -0
  82. package/js/src/base-component.js +78 -0
  83. package/js/src/button.js +89 -0
  84. package/js/src/carousel.js +589 -0
  85. package/js/src/collapse.js +391 -0
  86. package/js/src/dom/data.js +60 -0
  87. package/js/src/dom/event-handler.js +352 -0
  88. package/js/src/dom/manipulator.js +83 -0
  89. package/js/src/dom/selector-engine.js +78 -0
  90. package/js/src/dropdown.js +517 -0
  91. package/js/src/modal.js +451 -0
  92. package/js/src/navigation.js +298 -0
  93. package/js/src/offcanvas.js +277 -0
  94. package/js/src/popover.js +173 -0
  95. package/js/src/scrollspy.js +298 -0
  96. package/js/src/sidebar.js +347 -0
  97. package/js/src/tab.js +227 -0
  98. package/js/src/toast.js +245 -0
  99. package/js/src/tooltip.js +750 -0
  100. package/js/src/util/backdrop.js +129 -0
  101. package/js/src/util/index.js +327 -0
  102. package/js/src/util/sanitizer.js +130 -0
  103. package/js/src/util/scrollbar.js +97 -0
  104. package/package.json +166 -0
  105. package/scss/_accordion.scss +118 -0
  106. package/scss/_alert.scss +52 -0
  107. package/scss/_avatar.scss +49 -0
  108. package/scss/_badge.scss +38 -0
  109. package/scss/_breadcrumb.scss +33 -0
  110. package/scss/_button-group.scss +139 -0
  111. package/scss/_buttons.scss +143 -0
  112. package/scss/_callout.scss +16 -0
  113. package/scss/_card.scss +215 -0
  114. package/scss/_carousel.scss +231 -0
  115. package/scss/_close.scss +40 -0
  116. package/scss/_containers.scss +41 -0
  117. package/scss/_dropdown.scss +227 -0
  118. package/scss/_footer.scss +25 -0
  119. package/scss/_forms.scss +9 -0
  120. package/scss/_functions.scss +356 -0
  121. package/scss/_grid.scss +56 -0
  122. package/scss/_header.scss +170 -0
  123. package/scss/_helpers.scss +7 -0
  124. package/scss/_icon.scss +32 -0
  125. package/scss/_images.scss +42 -0
  126. package/scss/_list-group.scss +169 -0
  127. package/scss/_mixins.scss +50 -0
  128. package/scss/_modal.scss +219 -0
  129. package/scss/_nav.scss +140 -0
  130. package/scss/_navbar.scss +254 -0
  131. package/scss/_offcanvas.scss +79 -0
  132. package/scss/_pagination.scss +64 -0
  133. package/scss/_popover.scss +158 -0
  134. package/scss/_progress.scss +91 -0
  135. package/scss/_reboot.scss +632 -0
  136. package/scss/_root.scss +25 -0
  137. package/scss/_sidebar.scss +3 -0
  138. package/scss/_spinners.scss +69 -0
  139. package/scss/_subheader.scss +72 -0
  140. package/scss/_tables.scss +166 -0
  141. package/scss/_toasts.scss +52 -0
  142. package/scss/_tooltip.scss +115 -0
  143. package/scss/_transitions.scss +21 -0
  144. package/scss/_type.scss +104 -0
  145. package/scss/_utilities.scss +678 -0
  146. package/scss/_variables.scss +1801 -0
  147. package/scss/coreui-grid.rtl.scss +12 -0
  148. package/scss/coreui-grid.scss +67 -0
  149. package/scss/coreui-reboot.rtl.scss +12 -0
  150. package/scss/coreui-reboot.scss +15 -0
  151. package/scss/coreui-utilities.rtl.scss +12 -0
  152. package/scss/coreui-utilities.scss +19 -0
  153. package/scss/coreui.rtl.scss +12 -0
  154. package/scss/coreui.scss +61 -0
  155. package/scss/forms/_floating-labels.scss +63 -0
  156. package/scss/forms/_form-check.scss +188 -0
  157. package/scss/forms/_form-control.scss +219 -0
  158. package/scss/forms/_form-range.scss +91 -0
  159. package/scss/forms/_form-select.scss +70 -0
  160. package/scss/forms/_form-text.scss +11 -0
  161. package/scss/forms/_input-group.scss +121 -0
  162. package/scss/forms/_labels.scss +36 -0
  163. package/scss/forms/_validation.scss +12 -0
  164. package/scss/helpers/_clearfix.scss +3 -0
  165. package/scss/helpers/_colored-links.scss +12 -0
  166. package/scss/helpers/_position.scss +30 -0
  167. package/scss/helpers/_ratio.scss +26 -0
  168. package/scss/helpers/_stretched-link.scss +15 -0
  169. package/scss/helpers/_text-truncation.scss +7 -0
  170. package/scss/helpers/_visually-hidden.scss +8 -0
  171. package/scss/mixins/_alert.scss +15 -0
  172. package/scss/mixins/_avatar.scss +10 -0
  173. package/scss/mixins/_border-radius.scss +78 -0
  174. package/scss/mixins/_box-shadow.scss +18 -0
  175. package/scss/mixins/_breakpoints.scss +140 -0
  176. package/scss/mixins/_buttons.scss +101 -0
  177. package/scss/mixins/_caret.scss +64 -0
  178. package/scss/mixins/_clearfix.scss +9 -0
  179. package/scss/mixins/_color-scheme.scss +7 -0
  180. package/scss/mixins/_container.scss +9 -0
  181. package/scss/mixins/_css-vars.scss +87 -0
  182. package/scss/mixins/_deprecate.scss +10 -0
  183. package/scss/mixins/_forms.scss +144 -0
  184. package/scss/mixins/_gradients.scss +47 -0
  185. package/scss/mixins/_grid.scss +132 -0
  186. package/scss/mixins/_icon.scss +6 -0
  187. package/scss/mixins/_image.scss +16 -0
  188. package/scss/mixins/_list-group.scss +18 -0
  189. package/scss/mixins/_lists.scss +7 -0
  190. package/scss/mixins/_ltr-rtl.scss +60 -0
  191. package/scss/mixins/_pagination.scss +31 -0
  192. package/scss/mixins/_reset-text.scss +17 -0
  193. package/scss/mixins/_resize.scss +6 -0
  194. package/scss/mixins/_table-variants.scss +16 -0
  195. package/scss/mixins/_text-truncate.scss +8 -0
  196. package/scss/mixins/_transition.scss +26 -0
  197. package/scss/mixins/_utilities.scss +104 -0
  198. package/scss/mixins/_visually-hidden.scss +29 -0
  199. package/scss/sidebar/_sidebar-narrow.scss +106 -0
  200. package/scss/sidebar/_sidebar-nav.scss +165 -0
  201. package/scss/sidebar/_sidebar.scss +261 -0
  202. package/scss/utilities/_api.scss +47 -0
  203. package/scss/vendor/_rfs.scss +354 -0
@@ -0,0 +1,36 @@
1
+ //
2
+ // Labels
3
+ //
4
+
5
+ .form-label {
6
+ margin-bottom: $form-label-margin-bottom;
7
+ @include font-size($form-label-font-size);
8
+ font-style: $form-label-font-style;
9
+ font-weight: $form-label-font-weight;
10
+ color: var(--#{$variable-prefix}form-label-color, $form-label-color);
11
+ }
12
+
13
+ // For use with horizontal and inline forms, when you need the label (or legend)
14
+ // text to align with the form controls.
15
+ .col-form-label {
16
+ padding-top: add($input-padding-y, $input-border-width);
17
+ padding-bottom: add($input-padding-y, $input-border-width);
18
+ margin-bottom: 0; // Override the `<legend>` default
19
+ @include font-size(inherit); // Override the `<legend>` default
20
+ font-style: $form-label-font-style;
21
+ font-weight: $form-label-font-weight;
22
+ line-height: $input-line-height;
23
+ color: var(--#{$variable-prefix}form-label-color, $form-label-color);
24
+ }
25
+
26
+ .col-form-label-lg {
27
+ padding-top: add($input-padding-y-lg, $input-border-width);
28
+ padding-bottom: add($input-padding-y-lg, $input-border-width);
29
+ @include font-size($input-font-size-lg);
30
+ }
31
+
32
+ .col-form-label-sm {
33
+ padding-top: add($input-padding-y-sm, $input-border-width);
34
+ padding-bottom: add($input-padding-y-sm, $input-border-width);
35
+ @include font-size($input-font-size-sm);
36
+ }
@@ -0,0 +1,12 @@
1
+ // Form validation
2
+ //
3
+ // Provide feedback to users when form field values are valid or invalid. Works
4
+ // primarily for client-side validation via scoped `:invalid` and `:valid`
5
+ // pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for
6
+ // server-side validation.
7
+
8
+ // scss-docs-start form-validation-states-loop
9
+ @each $state, $data in $form-validation-states {
10
+ @include form-validation-state($state, $data...);
11
+ }
12
+ // scss-docs-end form-validation-states-loop
@@ -0,0 +1,3 @@
1
+ .clearfix {
2
+ @include clearfix();
3
+ }
@@ -0,0 +1,12 @@
1
+ @each $color, $value in $theme-colors {
2
+ .link-#{$color} {
3
+ color: $value;
4
+
5
+ @if $link-shade-percentage != 0 {
6
+ &:hover,
7
+ &:focus {
8
+ color: if(color-contrast($value) == $color-contrast-light, shade-color($value, $link-shade-percentage), tint-color($value, $link-shade-percentage));
9
+ }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,30 @@
1
+ // Shorthand
2
+
3
+ .fixed-top {
4
+ position: fixed;
5
+ top: 0;
6
+ right: 0;
7
+ left: 0;
8
+ z-index: $zindex-fixed;
9
+ }
10
+
11
+ .fixed-bottom {
12
+ position: fixed;
13
+ right: 0;
14
+ bottom: 0;
15
+ left: 0;
16
+ z-index: $zindex-fixed;
17
+ }
18
+
19
+ // Responsive sticky top
20
+ @each $breakpoint in map-keys($grid-breakpoints) {
21
+ @include media-breakpoint-up($breakpoint) {
22
+ $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
23
+
24
+ .sticky#{$infix}-top {
25
+ position: sticky;
26
+ top: 0;
27
+ z-index: $zindex-sticky;
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,26 @@
1
+ // Credit: Nicolas Gallagher and SUIT CSS.
2
+
3
+ .ratio {
4
+ position: relative;
5
+ width: 100%;
6
+
7
+ &::before {
8
+ display: block;
9
+ padding-top: var(--#{$variable-prefix}aspect-ratio);
10
+ content: "";
11
+ }
12
+
13
+ > * {
14
+ position: absolute;
15
+ top: 0;
16
+ @include ltr-rtl("left", 0);
17
+ width: 100%;
18
+ height: 100%;
19
+ }
20
+ }
21
+
22
+ @each $key, $ratio in $aspect-ratios {
23
+ .ratio-#{$key} {
24
+ --#{$variable-prefix}aspect-ratio: #{$ratio};
25
+ }
26
+ }
@@ -0,0 +1,15 @@
1
+ //
2
+ // Stretched link
3
+ //
4
+
5
+ .stretched-link {
6
+ &::#{$stretched-link-pseudo-element} {
7
+ position: absolute;
8
+ top: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ left: 0;
12
+ z-index: $stretched-link-z-index;
13
+ content: "";
14
+ }
15
+ }
@@ -0,0 +1,7 @@
1
+ //
2
+ // Text truncation
3
+ //
4
+
5
+ .text-truncate {
6
+ @include text-truncate();
7
+ }
@@ -0,0 +1,8 @@
1
+ //
2
+ // Visually hidden
3
+ //
4
+
5
+ .visually-hidden,
6
+ .visually-hidden-focusable:not(:focus):not(:focus-within) {
7
+ @include visually-hidden();
8
+ }
@@ -0,0 +1,15 @@
1
+ // scss-docs-start alert-variant-mixin
2
+ @mixin alert-variant($state, $variant) {
3
+ $background: map-get($variant, "bg");
4
+ $border-color: map-get($variant, "border-color");
5
+ $color: contrast-ratio-correction(map-get($variant, "color"), map-get($variant, "bg"), abs($alert-color-scale), $state);
6
+ $link-color: map-get($variant, "link-color");
7
+
8
+ .alert-#{$state} {
9
+ --#{$variable-prefix}alert-color: #{$color};
10
+ --#{$variable-prefix}alert-bg: #{$background};
11
+ --#{$variable-prefix}alert-border-color: #{$border-color};
12
+ --#{$variable-prefix}alert-link-color: #{$link-color};
13
+ }
14
+ }
15
+ // scss-docs-end alert-variant-mixin
@@ -0,0 +1,10 @@
1
+ @mixin avatar($width) {
2
+ width: $width;
3
+ height: $width;
4
+ font-size: $width * .4;
5
+
6
+ .avatar-status {
7
+ width: divide($width, 3.75);
8
+ height: divide($width, 3.75);
9
+ }
10
+ }
@@ -0,0 +1,78 @@
1
+ // stylelint-disable property-disallowed-list
2
+ // Single side border-radius
3
+
4
+ // Helper function to replace negative values with 0
5
+ @function valid-radius($radius) {
6
+ $return: ();
7
+ @each $value in $radius {
8
+ @if type-of($value) == number {
9
+ $return: append($return, max($value, 0));
10
+ } @else {
11
+ $return: append($return, $value);
12
+ }
13
+ }
14
+ @return $return;
15
+ }
16
+
17
+ // scss-docs-start border-radius-mixins
18
+ @mixin border-radius($radius: $border-radius, $fallback-border-radius: false) {
19
+ @if $enable-rounded {
20
+ border-radius: valid-radius($radius);
21
+ }
22
+ @else if $fallback-border-radius != false {
23
+ border-radius: $fallback-border-radius;
24
+ }
25
+ }
26
+
27
+ @mixin border-top-radius($radius: $border-radius) {
28
+ @if $enable-rounded {
29
+ border-top-left-radius: valid-radius($radius);
30
+ border-top-right-radius: valid-radius($radius);
31
+ }
32
+ }
33
+
34
+ @mixin border-end-radius($radius: $border-radius) {
35
+ @if $enable-rounded {
36
+ @include ltr-rtl("border-top-right-radius", valid-radius($radius));
37
+ @include ltr-rtl("border-bottom-right-radius", valid-radius($radius));
38
+ }
39
+ }
40
+
41
+ @mixin border-bottom-radius($radius: $border-radius) {
42
+ @if $enable-rounded {
43
+ border-bottom-right-radius: valid-radius($radius);
44
+ border-bottom-left-radius: valid-radius($radius);
45
+ }
46
+ }
47
+
48
+ @mixin border-start-radius($radius: $border-radius) {
49
+ @if $enable-rounded {
50
+ @include ltr-rtl("border-top-left-radius", valid-radius($radius));
51
+ @include ltr-rtl("border-bottom-left-radius", valid-radius($radius));
52
+ }
53
+ }
54
+
55
+ @mixin border-top-start-radius($radius: $border-radius) {
56
+ @if $enable-rounded {
57
+ border-top-left-radius: valid-radius($radius);
58
+ }
59
+ }
60
+
61
+ @mixin border-top-end-radius($radius: $border-radius) {
62
+ @if $enable-rounded {
63
+ @include ltr-rtl("border-top-right-radius", valid-radius($radius));
64
+ }
65
+ }
66
+
67
+ @mixin border-bottom-end-radius($radius: $border-radius) {
68
+ @if $enable-rounded {
69
+ @include ltr-rtl("border-bottom-right-radius", valid-radius($radius));
70
+ }
71
+ }
72
+
73
+ @mixin border-bottom-start-radius($radius: $border-radius) {
74
+ @if $enable-rounded {
75
+ @include ltr-rtl("border-bottom-left-radius", valid-radius($radius));
76
+ }
77
+ }
78
+ // scss-docs-end border-radius-mixins
@@ -0,0 +1,18 @@
1
+ @mixin box-shadow($shadow...) {
2
+ @if $enable-shadows {
3
+ $result: ();
4
+
5
+ @each $value in $shadow {
6
+ @if $value != null {
7
+ $result: append($result, $value, "comma");
8
+ }
9
+ @if $value == none and length($shadow) > 1 {
10
+ @warn "The keyword 'none' must be used as a single argument.";
11
+ }
12
+ }
13
+
14
+ @if (length($result) > 0) {
15
+ box-shadow: $result;
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,140 @@
1
+ // Breakpoint viewport sizes and media queries.
2
+ //
3
+ // Breakpoints are defined as a map of (name: minimum width), order from small to large:
4
+ //
5
+ // (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)
6
+ //
7
+ // The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.
8
+
9
+ // Name of the next breakpoint, or null for the last breakpoint.
10
+ //
11
+ // >> breakpoint-next(sm)
12
+ // md
13
+ // >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
14
+ // md
15
+ // >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))
16
+ // md
17
+ @function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
18
+ $n: index($breakpoint-names, $name);
19
+ @if not $n {
20
+ @error "breakpoint `#{$name}` not found in `#{$breakpoints}`";
21
+ }
22
+ @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
23
+ }
24
+
25
+ // Name of the previous breakpoint, or null for the first breakpoint.
26
+ //
27
+ // >> breakpoint-before(lg)
28
+ // md
29
+ // >> breakpoint-next(lg, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
30
+ // md
31
+ // >> breakpoint-next(lg, $breakpoint-names: (xs sm md lg xl))
32
+ // md
33
+ @function breakpoint-before($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
34
+ $n: index($breakpoint-names, $name);
35
+ @return if($n != null and $n < length($breakpoint-names), nth($breakpoint-names, $n - 1), null);
36
+ }
37
+
38
+ // Minimum breakpoint width. Null for the smallest (first) breakpoint.
39
+ //
40
+ // >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
41
+ // 576px
42
+ @function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
43
+ $min: map-get($breakpoints, $name);
44
+ @return if($min != 0, $min, null);
45
+ }
46
+
47
+ // Maximum breakpoint width.
48
+ // The maximum value is reduced by 0.02px to work around the limitations of
49
+ // `min-` and `max-` prefixes and viewports with fractional widths.
50
+ // See https://www.w3.org/TR/mediaqueries-4/#mq-min-max
51
+ // Uses 0.02px rather than 0.01px to work around a current rounding bug in Safari.
52
+ // See https://bugs.webkit.org/show_bug.cgi?id=178261
53
+ //
54
+ // >> breakpoint-max(md, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
55
+ // 767.98px
56
+ @function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
57
+ $max: map-get($breakpoints, $name);
58
+ @return if($max and $max > 0, $max - .02, null);
59
+ }
60
+
61
+ // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash in front.
62
+ // Useful for making responsive utilities.
63
+ //
64
+ // >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
65
+ // "" (Returns a blank string)
66
+ // >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
67
+ // "-sm"
68
+ @function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {
69
+ @return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}");
70
+ }
71
+
72
+ // Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
73
+ // Makes the @content apply to the given breakpoint and wider.
74
+ @mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
75
+ $min: breakpoint-min($name, $breakpoints);
76
+ @if $min {
77
+ @media (min-width: $min) {
78
+ @content;
79
+ }
80
+ } @else {
81
+ @content;
82
+ }
83
+ }
84
+
85
+ // Media of at most the maximum breakpoint width. No query for the largest breakpoint.
86
+ // Makes the @content apply to the given breakpoint and narrower.
87
+ @mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {
88
+ $max: breakpoint-max($name, $breakpoints);
89
+ @if $max {
90
+ @media (max-width: $max) {
91
+ @content;
92
+ }
93
+ } @else {
94
+ @content;
95
+ }
96
+ }
97
+
98
+ // Media that spans multiple breakpoint widths.
99
+ // Makes the @content apply between the min and max breakpoints
100
+ @mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {
101
+ $min: breakpoint-min($lower, $breakpoints);
102
+ $max: breakpoint-max($upper, $breakpoints);
103
+
104
+ @if $min != null and $max != null {
105
+ @media (min-width: $min) and (max-width: $max) {
106
+ @content;
107
+ }
108
+ } @else if $max == null {
109
+ @include media-breakpoint-up($lower, $breakpoints) {
110
+ @content;
111
+ }
112
+ } @else if $min == null {
113
+ @include media-breakpoint-down($upper, $breakpoints) {
114
+ @content;
115
+ }
116
+ }
117
+ }
118
+
119
+ // Media between the breakpoint's minimum and maximum widths.
120
+ // No minimum for the smallest breakpoint, and no maximum for the largest one.
121
+ // Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
122
+ @mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {
123
+ $min: breakpoint-min($name, $breakpoints);
124
+ $next: breakpoint-next($name, $breakpoints);
125
+ $max: breakpoint-max($next);
126
+
127
+ @if $min != null and $max != null {
128
+ @media (min-width: $min) and (max-width: $max) {
129
+ @content;
130
+ }
131
+ } @else if $max == null {
132
+ @include media-breakpoint-up($name, $breakpoints) {
133
+ @content;
134
+ }
135
+ } @else if $min == null {
136
+ @include media-breakpoint-down($next, $breakpoints) {
137
+ @content;
138
+ }
139
+ }
140
+ }
@@ -0,0 +1,101 @@
1
+ // Button variants
2
+ //
3
+ // Easily pump out default styles, as well as :hover, :focus, :active,
4
+ // and disabled options for all buttons
5
+
6
+ // scss-docs-start btn-variant-mixin
7
+ @mixin button-variant($state, $variant) {
8
+ $background: map-get($variant, "bg");
9
+ $border-color: map-get($variant, "border-color");
10
+ $color: map-get($variant, "color");
11
+ $hover-background: map-get($variant, "hover-bg");
12
+ $hover-border-color: map-get($variant, "hover-border-color");
13
+ $hover-color: map-get($variant, "hover-color");
14
+ $active-background: map-get($variant, "active-bg");
15
+ $active-border-color: map-get($variant, "active-border-color");
16
+ $active-color: map-get($variant, "active-color");
17
+ $disabled-background: map-get($variant, "disabled-bg");
18
+ $disabled-border-color: map-get($variant, "disabled-border-color");
19
+ $disabled-color: map-get($variant, "disabled-color");
20
+ $shadow: map-get($variant, "shadow");
21
+
22
+ .btn-#{$state} {
23
+ --#{$variable-prefix}btn-bg: #{$background};
24
+ --#{$variable-prefix}btn-border-color: #{$border-color};
25
+ --#{$variable-prefix}btn-color: #{$color};
26
+ --#{$variable-prefix}btn-hover-bg: #{$hover-background};
27
+ --#{$variable-prefix}btn-hover-border-color: #{$hover-border-color};
28
+ --#{$variable-prefix}btn-hover-color: #{$hover-color};
29
+ --#{$variable-prefix}btn-active-bg: #{$active-background};
30
+ --#{$variable-prefix}btn-active-border-color: #{$active-border-color};
31
+ --#{$variable-prefix}btn-active-color: #{$active-color};
32
+ --#{$variable-prefix}btn-disabled-bg: #{$disabled-background};
33
+ --#{$variable-prefix}btn-disabled-border-color: #{$disabled-border-color};
34
+ --#{$variable-prefix}btn-disabled-color: #{$disabled-color};
35
+ --#{$variable-prefix}btn-shadow: #{$shadow};
36
+ }
37
+ }
38
+ // scss-docs-end btn-variant-mixin
39
+
40
+ // scss-docs-start btn-outline-variant-mixin
41
+ @mixin button-outline-variant($state, $variant) {
42
+ $color: map-get($variant, "color");
43
+ $hover-background: map-get($variant, "hover-bg");
44
+ $hover-border-color: map-get($variant, "hover-border-color");
45
+ $hover-color: map-get($variant, "hover-color");
46
+ $active-background: map-get($variant, "active-bg");
47
+ $active-border-color: map-get($variant, "active-border-color");
48
+ $active-color: map-get($variant, "active-color");
49
+ $disabled-color: map-get($variant, "disabled-color");
50
+ $shadow: map-get($variant, "shadow");
51
+
52
+ .btn-outline-#{$state} {
53
+ --#{$variable-prefix}btn-border-color: #{$color};
54
+ --#{$variable-prefix}btn-color: #{$color};
55
+ --#{$variable-prefix}btn-hover-bg: #{$hover-background};
56
+ --#{$variable-prefix}btn-hover-border-color: #{$hover-border-color};
57
+ --#{$variable-prefix}btn-hover-color: #{$hover-color};
58
+ --#{$variable-prefix}btn-active-bg: #{$active-background};
59
+ --#{$variable-prefix}btn-active-border-color: #{$active-border-color};
60
+ --#{$variable-prefix}btn-active-color: #{$active-color};
61
+ --#{$variable-prefix}btn-disabled-color: #{$disabled-color};
62
+ --#{$variable-prefix}btn-shadow: #{$shadow};
63
+ }
64
+ }
65
+ // scss-docs-end btn-outline-variant-mixin
66
+
67
+ // Button Ghost
68
+
69
+ @mixin button-ghost-variant($state, $variant) {
70
+ $color: map-get($variant, "color");
71
+ $hover-background: map-get($variant, "hover-bg");
72
+ $hover-border-color: map-get($variant, "hover-border-color");
73
+ $hover-color: map-get($variant, "hover-color");
74
+ $active-background: map-get($variant, "active-bg");
75
+ $active-border-color: map-get($variant, "active-border-color");
76
+ $active-color: map-get($variant, "active-color");
77
+ $disabled-color: map-get($variant, "disabled-color");
78
+ $shadow: map-get($variant, "shadow");
79
+
80
+ .btn-ghost-#{$state} {
81
+ --#{$variable-prefix}btn-color: #{$color};
82
+ --#{$variable-prefix}btn-hover-bg: #{$hover-background};
83
+ --#{$variable-prefix}btn-hover-border-color: #{$hover-border-color};
84
+ --#{$variable-prefix}btn-hover-color: #{$hover-color};
85
+ --#{$variable-prefix}btn-active-bg: #{$active-background};
86
+ --#{$variable-prefix}btn-active-border-color: #{$active-border-color};
87
+ --#{$variable-prefix}btn-active-color: #{$active-color};
88
+ --#{$variable-prefix}btn-disabled-color: #{$disabled-color};
89
+ --#{$variable-prefix}btn-shadow: #{$shadow};
90
+ }
91
+ }
92
+
93
+ // Button sizes
94
+ // scss-docs-start btn-size-mixin
95
+ @mixin button-size($padding-y, $padding-x, $font-size, $border-radius) {
96
+ padding: $padding-y $padding-x;
97
+ @include font-size($font-size);
98
+ // Manually declare to provide an override to the browser default
99
+ @include border-radius($border-radius, 0);
100
+ }
101
+ // scss-docs-end btn-size-mixin