spuit 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +11 -0
  3. data/.gitignore +70 -0
  4. data/.npmignore +9 -0
  5. data/Gemfile +4 -0
  6. data/README.md +16 -0
  7. data/Rakefile +1 -0
  8. data/assets/javascripts/index.js +2 -0
  9. data/assets/javascripts/spuit/Common.js +316 -0
  10. data/assets/javascripts/spuit/extend.js +46 -0
  11. data/assets/stylesheets/spuit/components/_body.sass +175 -0
  12. data/assets/stylesheets/spuit/components/_button.sass +116 -0
  13. data/assets/stylesheets/spuit/components/_form.sass +44 -0
  14. data/assets/stylesheets/spuit/components/_gist.sass +57 -0
  15. data/assets/stylesheets/spuit/components/_grids.sass +44 -0
  16. data/assets/stylesheets/spuit/components/_icon.scss +68 -0
  17. data/assets/stylesheets/spuit/components/_markdown.sass +182 -0
  18. data/assets/stylesheets/spuit/components/_messages.sass +18 -0
  19. data/assets/stylesheets/spuit/components/_shoulder.sass +13 -0
  20. data/assets/stylesheets/spuit/components/_split.sass +32 -0
  21. data/assets/stylesheets/spuit/components/_triangle.sass +40 -0
  22. data/assets/stylesheets/spuit/components/_wordwrap-fadeout.sass +19 -0
  23. data/assets/stylesheets/spuit/components/_wrap.sass +22 -0
  24. data/assets/stylesheets/spuit/elements/_checkbox.sass +46 -0
  25. data/assets/stylesheets/spuit/elements/_dl.sass +30 -0
  26. data/assets/stylesheets/spuit/elements/_fieldset.sass +46 -0
  27. data/assets/stylesheets/spuit/elements/_hr.sass +36 -0
  28. data/assets/stylesheets/spuit/elements/_input.sass +27 -0
  29. data/assets/stylesheets/spuit/elements/_radio.sass +47 -0
  30. data/assets/stylesheets/spuit/elements/_select.sass +54 -0
  31. data/assets/stylesheets/spuit/elements/_table.sass +58 -0
  32. data/assets/stylesheets/spuit/includes/_animations.scss +55 -0
  33. data/assets/stylesheets/spuit/includes/_grid.scss +345 -0
  34. data/assets/stylesheets/spuit/includes/_hiddens.scss +17 -0
  35. data/assets/stylesheets/spuit/includes/_normalize.scss +467 -0
  36. data/assets/stylesheets/spuit/includes/_spacers.scss +79 -0
  37. data/assets/stylesheets/spuit/includes/_spuit-utils.scss +11 -0
  38. data/assets/stylesheets/spuit/includes/_stickey-footer.scss +18 -0
  39. data/assets/stylesheets/spuit/includes/_webfonts.scss +30 -0
  40. data/assets/stylesheets/spuit/modules/_background-image.scss +63 -0
  41. data/assets/stylesheets/spuit/modules/_breakpoints.scss +19 -0
  42. data/assets/stylesheets/spuit/modules/_clearfix.scss +7 -0
  43. data/assets/stylesheets/spuit/modules/_fa.scss +28 -0
  44. data/assets/stylesheets/spuit/modules/_font-face.scss +31 -0
  45. data/assets/stylesheets/spuit/modules/_hide-text.scss +9 -0
  46. data/assets/stylesheets/spuit/modules/_inherit.scss +6 -0
  47. data/assets/stylesheets/spuit/modules/_reset.scss +55 -0
  48. data/assets/stylesheets/spuit/modules/_text-overflow.scss +15 -0
  49. data/assets/stylesheets/spuit/modules/_word-break.scss +11 -0
  50. data/assets/stylesheets/spuit/shortcuts/_absolute.scss +17 -0
  51. data/assets/stylesheets/spuit/shortcuts/_centering.scss +6 -0
  52. data/assets/stylesheets/spuit/shortcuts/_disc.scss +6 -0
  53. data/assets/stylesheets/spuit/variables/_colors.scss +3 -0
  54. data/assets/stylesheets/spuit/variables/_defaults.scss +3 -0
  55. data/assets/stylesheets/spuit/variables/_fonts.scss +6 -0
  56. data/assets/stylesheets/spuit/variables/_media-queries.scss +31 -0
  57. data/assets/stylesheets/spuit/variables/_svgs.scss +7 -0
  58. data/assets/stylesheets/spuit/variables/_timing-functions.sass +37 -0
  59. data/assets/stylesheets/styles.scss +164 -0
  60. data/assets/stylesheets/styles/config/_mixins.scss +23 -0
  61. data/assets/stylesheets/styles/config/_variables.scss +4 -0
  62. data/dist/favicon.png +0 -0
  63. data/dist/index.html +307 -0
  64. data/dist/javascripts/scripts.min.js +2 -0
  65. data/dist/javascripts/scripts.min.js.map +1 -0
  66. data/dist/stylesheets/styles.css +1 -0
  67. data/gulp/README.md +7 -0
  68. data/gulp/tasks/watch.js +79 -0
  69. data/gulpfile.js +2 -0
  70. data/lib/spuit.rb +41 -0
  71. data/lib/spuit/engine.rb +5 -0
  72. data/lib/spuit/generator.rb +80 -0
  73. data/lib/spuit/version.rb +3 -0
  74. data/package.json +38 -0
  75. data/spuit.gemspec +23 -0
  76. data/spuit.scss +47 -0
  77. metadata +147 -0
@@ -0,0 +1,30 @@
1
+ =dl-base
2
+ margin: 0
3
+ padding: 0
4
+ > *
5
+ +break-word
6
+ margin: 0
7
+ padding: 0
8
+ display: border-box
9
+
10
+ =dl-flex($left: 30%, $p: 0.5rem 1rem)
11
+ +dl-base
12
+ display: flex
13
+ flex-flow: row wrap
14
+ justify-content: space-between
15
+ align-items: flex-start
16
+ align-content: flex-start
17
+ > dt
18
+ width: $left
19
+ padding: $p
20
+ padding-left: 0
21
+ > dd
22
+ width: 100% - $left
23
+ padding: $p
24
+ padding-right: 0
25
+
26
+ =dl-border($border: 1px solid #ddd, $left: 30%, $p: 0.5rem 1rem)
27
+ +dl-flex($left, $p)
28
+ border-bottom: $border
29
+ > *
30
+ border-top: $border
@@ -0,0 +1,46 @@
1
+ =fieldset-base($legend-width: 100px, $gutter: 20px)
2
+ +clearfix
3
+ position: relative
4
+ padding-left: $legend-width + $gutter
5
+ padding-bottom: 0.5rem
6
+ +breakpoint-down(sm)
7
+ padding-left: 0
8
+ padding-bottom: 1rem
9
+
10
+ > legend
11
+ width: $legend-width
12
+ margin-left: -($legend-width + $gutter)
13
+ display: inline-block
14
+ vertical-align: middle
15
+ float: left
16
+
17
+ +breakpoint-down(sm)
18
+ display: block
19
+ float: none
20
+ width: auto
21
+ margin-left: 0
22
+
23
+ &.has-padding
24
+ > legend
25
+ padding-top: 0.5rem
26
+ +breakpoint-down(sm)
27
+ padding-top: 0
28
+
29
+ //not <fieldset/>
30
+ =fieldset-flex($legend-width: 30%, $gutter: 20px)
31
+ display: flex
32
+ justify-content: space-between
33
+ align-items: center
34
+ min-width: 0
35
+ padding: 0
36
+ margin: 0 0 10px
37
+ border: 0
38
+ &:last-child
39
+ margin-bottom: 0
40
+ label, legend
41
+ margin-bottom: 0
42
+ > legend
43
+ width: $legend-width
44
+ padding-right: $gutter
45
+ > *:not(legend)
46
+ flex: 1
@@ -0,0 +1,36 @@
1
+ =hr-center-border($w: 100px, $c: #000)
2
+ border: none
3
+ border-top: 1px solid $c
4
+ width: $w
5
+ margin-top: 50px
6
+ margin-bottom: 50px
7
+
8
+ // Example:
9
+ // .dotted
10
+ // +hr-dotted
11
+ // .dotted--alt
12
+ // +hr-dotted(#000, 4, 1)
13
+
14
+ =hr-dotted($color:rgba(#000, 1.0), $stripe: 1, $spacing: 4, $height:1)
15
+ +background-image(linear-gradient(left, $color 0%, $color ($stripe/($stripe+$spacing))*100%, transparent ($stripe/($stripe+$spacing))*100%, transparent 100%))
16
+ background-size: ($stripe+$spacing)*1px ($stripe+$spacing)*1px
17
+ height: $height*1px
18
+ border: none
19
+
20
+ // Example:
21
+ // .shaded
22
+ // +hr-shaded
23
+
24
+ =hr-shaded($deg:135deg, $color:rgba(#000, 1.0), $stripe: 1, $spacing: 1, $height:10px)
25
+ $_stripe: $stripe
26
+ $_spacing: $spacing
27
+ $_diagonal: ceil(($_stripe+$_spacing)*1.414)
28
+ $_pattern: $deg, $color, $color ($_stripe)*1px, transparent ($_stripe)*1px, transparent ($_diagonal)*1px, $color ($_diagonal)*1px
29
+ background-image: -webkit-repeating-linear-gradient($_pattern)
30
+ background-image: -moz-repeating-linear-gradient($_pattern)
31
+ background-image: -o-repeating-linear-gradient($_pattern)
32
+ background-image: -ms-repeating-linear-grad§ient($_pattern)
33
+ background-image: repeating-linear-gradient($_pattern)
34
+ background-size: (($_stripe+$_spacing)*2)*1px (($_stripe+$_spacing)*2)*1px
35
+ height: $height
36
+ border: none
@@ -0,0 +1,27 @@
1
+ =input-base($w: auto, $p: 10px 10px)
2
+ +reset-form
3
+ font-size: inherit
4
+ display: inline-block
5
+ width: $w
6
+ padding: $p
7
+ box-sizing: border-box
8
+ line-height: 1
9
+ &::placeholder
10
+ font-size: inherit
11
+ &:focus
12
+ outline: 0
13
+
14
+ =input-normal($w: auto, $p: 10px 10px)
15
+ +reset-form
16
+ +input-base($w, $p)
17
+
18
+ $color-border: #ddd
19
+ $color-border-key: rgba(#529ef6, 0.5)
20
+ $color-bg-select: #fffff2
21
+
22
+ border: 1px solid $color-border
23
+ &::placeholder
24
+ color: #ddd
25
+ &:focus
26
+ border: 1px solid $color-border-key
27
+ background: $color-bg-select
@@ -0,0 +1,47 @@
1
+ =radio-default
2
+ margin: 0
3
+ display: inline-block
4
+ vertical-align: top
5
+
6
+ input[type=radio]
7
+ display: inline-block
8
+ margin: 0 4px 0 0
9
+ label
10
+ cursor: pointer
11
+ margin: 0
12
+
13
+ =radio-base($tag: label, $w: 18px, $color-key: #529ef6)
14
+ +radio-default
15
+ $icon: 'DQo8c3ZnIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4IiB2aWV3Qm94PSIxMTEgMjMwIDYgNiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4NCiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDQyICgzNjc4MSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+DQogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+DQogICAgPGRlZnM+PC9kZWZzPg0KICAgIDxyZWN0IGlkPSJjaXJjbGUiIHN0cm9rZT0ibm9uZSIgZmlsbD0iI0ZGRkZGRiIgZmlsbC1ydWxlPSJldmVub2RkIiB4PSIxMTEiIHk9IjIzMCIgd2lkdGg9IjYiIGhlaWdodD0iNiIgcng9IjMiPjwvcmVjdD4NCjwvc3ZnPg=='
16
+
17
+ #{$tag}
18
+ margin: 0
19
+ padding: 0
20
+ line-height: 1
21
+ cursor: pointer
22
+ display: inline-block
23
+
24
+ &:before
25
+ content: url('data:image/svg+xml;base64,#{$icon}')
26
+ vertical-align: middle
27
+ box-sizing: border-box
28
+ text-align: center
29
+ background: #fff
30
+ width: $w
31
+ height: $w
32
+ line-height: $w - 8px
33
+ padding: 0
34
+ border: 1px solid #ddd
35
+ display: inline-block
36
+ border-radius: $w
37
+
38
+ &:hover
39
+ &:before
40
+ border-color: $color-key
41
+
42
+ input[type=radio]
43
+ display: none
44
+
45
+ &:checked + #{$tag}
46
+ &:before
47
+ background-color: $color-key
@@ -0,0 +1,54 @@
1
+ =select-base($w: auto, $bg: #fff)
2
+ // $bg-image: linear-gradient(to top, #f2f2f2 0%, lighten(#f2f2f2, 10%) 100%)
3
+ $border: 1px solid #ddd
4
+ $r: 2px
5
+ $icon: 'DQo8c3ZnIHdpZHRoPSI2cHgiIGhlaWdodD0iMTBweCIgdmlld0JveD0iMTQ3IDIyNSA2IDEwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPg0KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNDIgKDM2NzgxKSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4NCiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4NCiAgICA8ZGVmcz48L2RlZnM+DQogICAgPHBhdGggZD0iTTE1MCwyMjUgTDE1MywyMjkgTDE0NywyMjkgTDE1MCwyMjUgWiBNMTUwLDIzNSBMMTQ3LDIzMSBMMTUzLDIzMSBMMTUwLDIzNSBaIiBpZD0iQ29tYmluZWQtU2hhcGUiIHN0cm9rZT0ibm9uZSIgZmlsbD0iIzAwMDAwMCIgZmlsbC1ydWxlPSJldmVub2RkIj48L3BhdGg+DQo8L3N2Zz4='
6
+
7
+ box-sizing: border-box
8
+ border-radius: $r
9
+ position: relative
10
+ overflow: hidden
11
+ border: $border
12
+ width: $w
13
+ display: inline-block
14
+ padding-right: 20px
15
+
16
+ select
17
+ +reset-form
18
+ display: inline-block
19
+ box-sizing: content-box
20
+ width: 100%
21
+ padding: 10px 10px
22
+ // padding: 5px 10px
23
+ line-height: 1 !important
24
+ background: $bg
25
+ // background-image: $bg-image
26
+ color: $color-black
27
+ &:focus
28
+ outline: none
29
+ border: none
30
+
31
+ background-image: url('data:image/svg+xml;base64,#{$icon}')
32
+ background-repeat: no-repeat
33
+ background-position: right 34px top 13px
34
+ background-size: 6px 10px
35
+
36
+ select
37
+ width: 110% // IE9
38
+ &::-ms-expand
39
+ display: none // IE10
40
+
41
+ +select-firefox-hack
42
+
43
+ =select-firefox-hack
44
+ @at-root
45
+ @-moz-document url-prefix()
46
+ #{&}
47
+ select
48
+ text-indent: 0.01px
49
+ text-overflow: ''
50
+ color: #000
51
+ padding: 5px 10px
52
+ &:-moz-focusring
53
+ // color: transparent
54
+ text-shadow: none
@@ -0,0 +1,58 @@
1
+ =table-base($p: 5px 10px)
2
+ width: 100%
3
+ border-collapse: collapse
4
+ margin-bottom: 0
5
+ th
6
+ font-weight: bold
7
+ th, td
8
+ padding: $p
9
+
10
+ // .table--normal
11
+ // +table-normal
12
+ =table-normal($p: 5px 10px, $border-top: 2px solid #eee, $border: 1px solid #eee)
13
+ +table-base($p)
14
+ border-top: $border
15
+ thead
16
+ tr
17
+ th, td
18
+ font-size: 0.8rem
19
+ border: $border
20
+ border-bottom: $border-top
21
+ tbody
22
+ tr
23
+ &:first-child
24
+ th, td
25
+ border-top: none
26
+ th
27
+ border: $border
28
+ border-bottom: $border-top
29
+ td
30
+ border: $border
31
+
32
+ // .table--line
33
+ // +table-line
34
+ =table-line($border-top: 2px solid #eee, $border: 1px solid #eee)
35
+ +table-base
36
+ thead
37
+ tr
38
+ th, td
39
+ border-bottom: $border-top
40
+ tr
41
+ &:first-child
42
+ th, td
43
+ border-top: none
44
+ th, td
45
+ border-top: $border
46
+
47
+ // .table--stripe
48
+ // +table-stripe
49
+ =table-stripe($color-thead: #fff, $color-even: #eee, $color-odd: #f8f8f8)
50
+ +table-base
51
+ thead
52
+ tr
53
+ background-color: $color-thead
54
+ tbody
55
+ tr:nth-child(even)
56
+ background-color: $color-even
57
+ tr:nth-child(odd)
58
+ background-color: $color-odd
@@ -0,0 +1,55 @@
1
+ // @include include-animations
2
+ @mixin include-animations {
3
+ @at-root {
4
+
5
+ // animation: anim-spin 1.6s infinite linear
6
+ @keyframes anim-spin {
7
+ from {
8
+ transform: rotate(0deg);
9
+ }
10
+ to {
11
+ transform: rotate(359deg);
12
+ }
13
+ }
14
+
15
+ // animation: anim-float 0.8s ease-out infinite
16
+ @keyframes anim-float {
17
+ 0% {
18
+ transform: translateY(0%);
19
+ }
20
+ 50% {
21
+ transform: translateY(20%);
22
+ }
23
+ 100% {
24
+ transform: translateY(0%);
25
+ }
26
+ }
27
+
28
+ // animation: anim-arrow 0.8s ease-out infinite
29
+ @keyframes anim-arrow {
30
+ 0% {
31
+ transform: translateX(0%);
32
+ }
33
+ 50% {
34
+ transform: translateX(20%);
35
+ }
36
+ 100% {
37
+ transform: translateX(0%);
38
+ }
39
+ }
40
+
41
+ // animation: anim-scale 0.8s ease-out
42
+ @keyframes anim-scale {
43
+ 0% {
44
+ transform: scale(1);;
45
+ }
46
+ 50% {
47
+ transform: scale(1.2);
48
+ }
49
+ 100% {
50
+ transform: scale(1);
51
+ }
52
+ }
53
+
54
+ }
55
+ }
@@ -0,0 +1,345 @@
1
+ /*
2
+ from: https://github.com/twbs/bootstrap/blob/v4-dev/
3
+ */
4
+
5
+ // @include include-grid
6
+ @mixin include-grid {
7
+ @at-root {
8
+ $enable-grid-classes: true !default;
9
+ $grid-columns: 12 !default;
10
+ $grid-gutter-width-base: 30px !default;
11
+ $grid-gutter-widths: (
12
+ xs: $grid-gutter-width-base,
13
+ sm: $grid-gutter-width-base,
14
+ md: $grid-gutter-width-base,
15
+ lg: $grid-gutter-width-base,
16
+ xl: $grid-gutter-width-base
17
+ ) !default;
18
+ $grid-breakpoints: (
19
+ xs: 0,
20
+ sm: 576px,
21
+ md: 768px,
22
+ lg: 992px,
23
+ xl: 1200px
24
+ ) !default;
25
+ $container-max-widths: (
26
+ sm: 540px,
27
+ md: 720px,
28
+ lg: 960px,
29
+ xl: 1140px
30
+ ) !default;
31
+
32
+ // Breakpoint viewport sizes and media queries.
33
+ //
34
+ // Breakpoints are defined as a map of (name: minimum width), order from small to large:
35
+ //
36
+ // (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)
37
+ //
38
+ // The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.
39
+
40
+ // Name of the next breakpoint, or null for the last breakpoint.
41
+ //
42
+ // >> breakpoint-next(sm)
43
+ // md
44
+ // >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
45
+ // md
46
+ // >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))
47
+ // md
48
+ @function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
49
+ $n: index($breakpoint-names, $name);
50
+ @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
51
+ }
52
+
53
+ // Minimum breakpoint width. Null for the smallest (first) breakpoint.
54
+ //
55
+ // >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
56
+ // 576px
57
+ @function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
58
+ $min: map-get($breakpoints, $name);
59
+ @return if($min != 0, $min, null);
60
+ }
61
+
62
+ // Maximum breakpoint width. Null for the largest (last) breakpoint.
63
+ // The maximum value is calculated as the minimum of the next one less 0.1.
64
+ //
65
+ // >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
66
+ // 767px
67
+ @function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
68
+ $next: breakpoint-next($name, $breakpoints);
69
+ @return if($next, breakpoint-min($next, $breakpoints) - 1px, null);
70
+ }
71
+
72
+ // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront.
73
+ // Useful for making responsive utilities.
74
+ //
75
+ // >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
76
+ // "" (Returns a blank string)
77
+ // >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
78
+ // "-sm"
79
+ @function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {
80
+ @return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}");
81
+ }
82
+
83
+
84
+ // Framework grid generation
85
+ //
86
+ // Used only by Bootstrap to generate the correct number of grid classes given
87
+ // any value of `$grid-columns`.
88
+
89
+ @mixin make-grid-columns($columns: $grid-columns, $gutters: $grid-gutter-widths, $breakpoints: $grid-breakpoints) {
90
+ // Common properties for all breakpoints
91
+ %grid-column {
92
+ position: relative;
93
+ width: 100%;
94
+ min-height: 1px; // Prevent columns from collapsing when empty
95
+
96
+ @include make-gutters($gutters);
97
+ }
98
+
99
+ @each $breakpoint in map-keys($breakpoints) {
100
+ $infix: breakpoint-infix($breakpoint, $breakpoints);
101
+
102
+ // Allow columns to stretch full width below their breakpoints
103
+ @for $i from 1 through $columns {
104
+ .col#{$infix}-#{$i} {
105
+ @extend %grid-column;
106
+ }
107
+ }
108
+ .col#{$infix} {
109
+ @extend %grid-column;
110
+ }
111
+
112
+ @include media-breakpoint-up($breakpoint, $breakpoints) {
113
+ // Provide basic `.col-{bp}` classes for equal-width flexbox columns
114
+ .col#{$infix} {
115
+ flex-basis: 0;
116
+ flex-grow: 1;
117
+ max-width: 100%;
118
+ }
119
+ .col#{$infix}-auto {
120
+ flex: 0 0 auto;
121
+ width: auto;
122
+ }
123
+
124
+ @for $i from 1 through $columns {
125
+ .col#{$infix}-#{$i} {
126
+ @include make-col($i, $columns);
127
+ }
128
+ }
129
+
130
+ @each $modifier in (pull, push) {
131
+ @for $i from 0 through $columns {
132
+ .#{$modifier}#{$infix}-#{$i} {
133
+ @include make-col-modifier($modifier, $i, $columns)
134
+ }
135
+ }
136
+ }
137
+
138
+ // `$columns - 1` because offsetting by the width of an entire row isn't possible
139
+ @for $i from 0 through ($columns - 1) {
140
+ @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-xs-0
141
+ .offset#{$infix}-#{$i} {
142
+ @include make-col-modifier(offset, $i, $columns)
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ // Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
151
+ // Makes the @content apply to the given breakpoint and wider.
152
+ @mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
153
+ $min: breakpoint-min($name, $breakpoints);
154
+ @if $min {
155
+ @media (min-width: $min) {
156
+ @content;
157
+ }
158
+ } @else {
159
+ @content;
160
+ }
161
+ }
162
+
163
+ // Media of at most the maximum breakpoint width. No query for the largest breakpoint.
164
+ // Makes the @content apply to the given breakpoint and narrower.
165
+ @mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {
166
+ $max: breakpoint-max($name, $breakpoints);
167
+ @if $max {
168
+ @media (max-width: $max) {
169
+ @content;
170
+ }
171
+ } @else {
172
+ @content;
173
+ }
174
+ }
175
+
176
+ // Media that spans multiple breakpoint widths.
177
+ // Makes the @content apply between the min and max breakpoints
178
+ @mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {
179
+ @include media-breakpoint-up($lower, $breakpoints) {
180
+ @include media-breakpoint-down($upper, $breakpoints) {
181
+ @content;
182
+ }
183
+ }
184
+ }
185
+
186
+ /// Grid system
187
+ //
188
+ // Generate semantic grid columns with these mixins.
189
+
190
+ @mixin make-container($gutters: $grid-gutter-widths) {
191
+ position: relative;
192
+ margin-right: auto;
193
+ margin-left: auto;
194
+ box-sizing: border-box;
195
+
196
+ @each $breakpoint in map-keys($gutters) {
197
+ @include media-breakpoint-up($breakpoint) {
198
+ $gutter: map-get($gutters, $breakpoint);
199
+ padding-right: ($gutter / 2);
200
+ padding-left: ($gutter / 2);
201
+ }
202
+ }
203
+ }
204
+
205
+
206
+ // For each breakpoint, define the maximum width of the container in a media query
207
+ @mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {
208
+ @each $breakpoint, $container-max-width in $max-widths {
209
+ @include media-breakpoint-up($breakpoint, $breakpoints) {
210
+ width: $container-max-width;
211
+ max-width: 100%;
212
+ box-sizing: border-box;
213
+ }
214
+ }
215
+ }
216
+
217
+ @mixin make-gutters($gutters: $grid-gutter-widths) {
218
+ @each $breakpoint in map-keys($gutters) {
219
+ @include media-breakpoint-up($breakpoint) {
220
+ $gutter: map-get($gutters, $breakpoint);
221
+ padding-right: ($gutter / 2);
222
+ padding-left: ($gutter / 2);
223
+ box-sizing: border-box;
224
+ }
225
+ }
226
+ }
227
+
228
+ @mixin make-row($gutters: $grid-gutter-widths) {
229
+ display: flex;
230
+ flex-wrap: wrap;
231
+ box-sizing: border-box;
232
+
233
+ @each $breakpoint in map-keys($gutters) {
234
+ @include media-breakpoint-up($breakpoint) {
235
+ $gutter: map-get($gutters, $breakpoint);
236
+ margin-right: ($gutter / -2);
237
+ margin-left: ($gutter / -2);
238
+ }
239
+ }
240
+ }
241
+
242
+ @mixin make-col-ready($gutters: $grid-gutter-widths) {
243
+ position: relative;
244
+ // Prevent columns from becoming too narrow when at smaller grid tiers by
245
+ // always setting `width: 100%;`. This works because we use `flex` values
246
+ // later on to override this initial width.
247
+ width: 100%;
248
+ min-height: 1px; // Prevent collapsing
249
+
250
+ @each $breakpoint in map-keys($gutters) {
251
+ @include media-breakpoint-up($breakpoint) {
252
+ $gutter: map-get($gutters, $breakpoint);
253
+ padding-right: ($gutter / 2);
254
+ padding-left: ($gutter / 2);
255
+ }
256
+ }
257
+ }
258
+
259
+ @mixin make-col($size, $columns: $grid-columns) {
260
+ flex: 0 0 percentage($size / $columns);
261
+ // width: percentage($size / $columns);
262
+ // Add a `max-width` to ensure content within each column does not blow out
263
+ // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
264
+ // do not appear to require this.
265
+ max-width: percentage($size / $columns);
266
+ }
267
+
268
+ @mixin make-col-offset($size, $columns: $grid-columns) {
269
+ margin-left: percentage($size / $columns);
270
+ }
271
+
272
+ @mixin make-col-push($size, $columns: $grid-columns) {
273
+ left: if($size > 0, percentage($size / $columns), auto);
274
+ }
275
+
276
+ @mixin make-col-pull($size, $columns: $grid-columns) {
277
+ right: if($size > 0, percentage($size / $columns), auto);
278
+ }
279
+
280
+ @mixin make-col-modifier($type, $size, $columns) {
281
+ // Work around the lack of dynamic mixin @include support (https://github.com/sass/sass/issues/626)
282
+ @if $type == push {
283
+ @include make-col-push($size, $columns);
284
+ } @else if $type == pull {
285
+ @include make-col-pull($size, $columns);
286
+ } @else if $type == offset {
287
+ @include make-col-offset($size, $columns);
288
+ }
289
+ }
290
+
291
+
292
+ // Container widths
293
+ //
294
+ // Set the container width, and override it for fixed navbars in media queries.
295
+
296
+ @if $enable-grid-classes {
297
+ .container {
298
+ @include make-container();
299
+ @include make-container-max-widths();
300
+ }
301
+ }
302
+
303
+ // Fluid container
304
+ //
305
+ // Utilizes the mixin meant for fixed width containers, but without any defined
306
+ // width for fluid, full width layouts.
307
+
308
+ @if $enable-grid-classes {
309
+ .container-fluid {
310
+ @include make-container();
311
+ }
312
+ }
313
+
314
+ // Row
315
+ //
316
+ // Rows contain and clear the floats of your columns.
317
+
318
+ @if $enable-grid-classes {
319
+ .row {
320
+ @include make-row();
321
+ }
322
+
323
+ // Remove the negative margin from default .row, then the horizontal padding
324
+ // from all immediate children columns (to prevent runaway style inheritance).
325
+ .no-gutters {
326
+ margin-right: 0;
327
+ margin-left: 0;
328
+
329
+ > .col,
330
+ > [class*="col-"] {
331
+ padding-right: 0;
332
+ padding-left: 0;
333
+ }
334
+ }
335
+ }
336
+
337
+ // Columns
338
+ //
339
+ // Common styles for small and large grid columns
340
+
341
+ @if $enable-grid-classes {
342
+ @include make-grid-columns();
343
+ }
344
+ }
345
+ }