spuit 0.0.11 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/package.json CHANGED
@@ -1,13 +1,8 @@
1
1
  {
2
2
  "name": "spuit",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "JS + Sass Mixin Library",
5
5
  "main": "spuit.scss",
6
- "scripts": {
7
- "start": "webpack-dev-server",
8
- "build": "webpack --config webpack.config.js",
9
- "deploy": "rake release && npm publish"
10
- },
11
6
  "repository": {
12
7
  "type": "git",
13
8
  "url": "git+ssh://git@github.com/is8r/spuit.git"
@@ -20,15 +15,32 @@
20
15
  },
21
16
  "homepage": "https://github.com/is8r/spuit#readme",
22
17
  "devDependencies": {
23
- "autoprefixer": "^7.1.4",
18
+ "autoprefixer": "^8.2.0",
19
+ "bootstrap": "^4.0.0",
24
20
  "css-loader": "^0.28.7",
25
- "extract-text-webpack-plugin": "^3.0.0",
26
- "node-sass": "^4.5.3",
27
- "postcss-loader": "^2.0.6",
21
+ "extract-text-webpack-plugin": "^4.0.0-beta.0",
22
+ "html-loader": "^0.5.5",
23
+ "html-webpack-plugin": "^3.2.0",
24
+ "jquery": "^3.3.1",
25
+ "node-sass": "^4.7.2",
26
+ "popper.js": "^1.14.3",
27
+ "postcss-loader": "^2.0.10",
28
28
  "sass-loader": "^6.0.6",
29
- "style-loader": "^0.20.1",
30
- "webpack": "^3.5.6",
31
- "webpack-dev-server": "^2.7.1"
29
+ "spuit": "0.0.12",
30
+ "style-loader": "^0.20.3",
31
+ "uglifyjs-webpack-plugin": "^1.2.4",
32
+ "webpack": "^4.4.1",
33
+ "webpack-cli": "^2.0.13",
34
+ "webpack-dev-server": "^3.1.1",
35
+ "webpack-manifest-plugin": "^2.0.0-rc.2"
32
36
  },
33
- "dependencies": {}
37
+ "dependencies": {
38
+ "npm": "^6.0.1"
39
+ },
40
+ "scripts": {
41
+ "dev": "open http://localhost:8080/ && webpack-dev-server --progress --mode development --config webpack/webpack.config.js",
42
+ "watch": "webpack --watch --progress --mode development --config webpack/webpack.config.js",
43
+ "build": "webpack --progress --mode production --config webpack/webpack.config.js",
44
+ "deploy": "rake release && npm publish"
45
+ }
34
46
  }
@@ -0,0 +1,344 @@
1
+ /*
2
+ from: https://github.com/twbs/bootstrap/blob/v4-dev/
3
+ */
4
+
5
+ // @include include-grid
6
+ $enable-grid-classes: true !default;
7
+ $grid-columns: 12 !default;
8
+ $grid-gutter-width-base: 30px !default;
9
+ $grid-gutter-widths: (
10
+ xs: $grid-gutter-width-base,
11
+ sm: $grid-gutter-width-base,
12
+ md: $grid-gutter-width-base,
13
+ lg: $grid-gutter-width-base,
14
+ xl: $grid-gutter-width-base
15
+ ) !default;
16
+ $grid-breakpoints: (
17
+ xs: 0,
18
+ sm: 576px,
19
+ md: 768px,
20
+ lg: 992px,
21
+ xl: 1200px
22
+ ) !default;
23
+ $container-max-widths: (
24
+ sm: 540px,
25
+ md: 720px,
26
+ lg: 960px,
27
+ xl: 1140px
28
+ ) !default;
29
+
30
+ @mixin include-grid {
31
+
32
+ @at-root {
33
+ // Container widths
34
+ //
35
+ // Set the container width, and override it for fixed navbars in media queries.
36
+
37
+ @if $enable-grid-classes {
38
+ .container {
39
+ @include make-container();
40
+ @include make-container-max-widths();
41
+ }
42
+ }
43
+
44
+ // Fluid container
45
+ //
46
+ // Utilizes the mixin meant for fixed width containers, but without any defined
47
+ // width for fluid, full width layouts.
48
+
49
+ @if $enable-grid-classes {
50
+ .container-fluid {
51
+ @include make-container();
52
+ }
53
+ }
54
+
55
+ // Row
56
+ //
57
+ // Rows contain and clear the floats of your columns.
58
+
59
+ @if $enable-grid-classes {
60
+ .row {
61
+ @include make-row();
62
+ }
63
+
64
+ // Remove the negative margin from default .row, then the horizontal padding
65
+ // from all immediate children columns (to prevent runaway style inheritance).
66
+ .no-gutters {
67
+ margin-right: 0;
68
+ margin-left: 0;
69
+
70
+ > .col,
71
+ > [class*="col-"] {
72
+ padding-right: 0;
73
+ padding-left: 0;
74
+ }
75
+ }
76
+ }
77
+
78
+ // Columns
79
+ //
80
+ // Common styles for small and large grid columns
81
+
82
+ @if $enable-grid-classes {
83
+ @include make-grid-columns();
84
+ }
85
+ }
86
+ }
87
+
88
+ // Breakpoint viewport sizes and media queries.
89
+ //
90
+ // Breakpoints are defined as a map of (name: minimum width), order from small to large:
91
+ //
92
+ // (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)
93
+ //
94
+ // The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.
95
+
96
+ // Name of the next breakpoint, or null for the last breakpoint.
97
+ //
98
+ // >> breakpoint-next(sm)
99
+ // md
100
+ // >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
101
+ // md
102
+ // >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))
103
+ // md
104
+ @function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
105
+ $n: index($breakpoint-names, $name);
106
+ @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
107
+ }
108
+
109
+ // Minimum breakpoint width. Null for the smallest (first) breakpoint.
110
+ //
111
+ // >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
112
+ // 576px
113
+ @function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
114
+ $min: map-get($breakpoints, $name);
115
+ @return if($min != 0, $min, null);
116
+ }
117
+
118
+ // Maximum breakpoint width. Null for the largest (last) breakpoint.
119
+ // The maximum value is calculated as the minimum of the next one less 0.1.
120
+ //
121
+ // >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
122
+ // 767px
123
+ @function breakpoint-max($name, $breakpoints: $grid-breakpoints) {
124
+ $next: breakpoint-next($name, $breakpoints);
125
+ @return if($next, breakpoint-min($next, $breakpoints) - 1px, null);
126
+ }
127
+
128
+ // Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront.
129
+ // Useful for making responsive utilities.
130
+ //
131
+ // >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
132
+ // "" (Returns a blank string)
133
+ // >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))
134
+ // "-sm"
135
+ @function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {
136
+ @return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}");
137
+ }
138
+
139
+
140
+ // Framework grid generation
141
+ //
142
+ // Used only by Bootstrap to generate the correct number of grid classes given
143
+ // any value of `$grid-columns`.
144
+
145
+ @mixin make-grid-columns($columns: $grid-columns, $gutters: $grid-gutter-widths, $breakpoints: $grid-breakpoints) {
146
+ // Common properties for all breakpoints
147
+ %grid-column {
148
+ position: relative;
149
+ width: 100%;
150
+ min-height: 1px; // Prevent columns from collapsing when empty
151
+
152
+ @include make-gutters($gutters);
153
+ }
154
+
155
+ @each $breakpoint in map-keys($breakpoints) {
156
+ $infix: breakpoint-infix($breakpoint, $breakpoints);
157
+
158
+ // Allow columns to stretch full width below their breakpoints
159
+ @for $i from 1 through $columns {
160
+ .col#{$infix}-#{$i} {
161
+ @extend %grid-column;
162
+ }
163
+ }
164
+ .col#{$infix} {
165
+ @extend %grid-column;
166
+ }
167
+
168
+ @include media-breakpoint-up($breakpoint, $breakpoints) {
169
+ // Provide basic `.col-{bp}` classes for equal-width flexbox columns
170
+ .col#{$infix} {
171
+ flex-basis: 0;
172
+ flex-grow: 1;
173
+ max-width: 100%;
174
+ }
175
+ .col#{$infix}-auto {
176
+ flex: 0 0 auto;
177
+ width: auto;
178
+ }
179
+
180
+ @for $i from 1 through $columns {
181
+ .col#{$infix}-#{$i} {
182
+ @include make-col($i, $columns);
183
+ }
184
+ }
185
+
186
+ @each $modifier in (pull, push) {
187
+ @for $i from 0 through $columns {
188
+ .#{$modifier}#{$infix}-#{$i} {
189
+ @include make-col-modifier($modifier, $i, $columns)
190
+ }
191
+ }
192
+ }
193
+
194
+ // `$columns - 1` because offsetting by the width of an entire row isn't possible
195
+ @for $i from 0 through ($columns - 1) {
196
+ @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-xs-0
197
+ .offset#{$infix}-#{$i} {
198
+ @include make-col-modifier(offset, $i, $columns)
199
+ }
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+
206
+ // Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
207
+ // Makes the @content apply to the given breakpoint and wider.
208
+ @mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
209
+ $min: breakpoint-min($name, $breakpoints);
210
+ @if $min {
211
+ @media (min-width: $min) {
212
+ @content;
213
+ }
214
+ } @else {
215
+ @content;
216
+ }
217
+ }
218
+
219
+ // Media of at most the maximum breakpoint width. No query for the largest breakpoint.
220
+ // Makes the @content apply to the given breakpoint and narrower.
221
+ @mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {
222
+ $max: breakpoint-max($name, $breakpoints);
223
+ @if $max {
224
+ @media (max-width: $max) {
225
+ @content;
226
+ }
227
+ } @else {
228
+ @content;
229
+ }
230
+ }
231
+
232
+ // Media that spans multiple breakpoint widths.
233
+ // Makes the @content apply between the min and max breakpoints
234
+ @mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {
235
+ @include media-breakpoint-up($lower, $breakpoints) {
236
+ @include media-breakpoint-down($upper, $breakpoints) {
237
+ @content;
238
+ }
239
+ }
240
+ }
241
+
242
+ /// Grid system
243
+ //
244
+ // Generate semantic grid columns with these mixins.
245
+
246
+ @mixin make-container($gutters: $grid-gutter-widths) {
247
+ position: relative;
248
+ margin-right: auto;
249
+ margin-left: auto;
250
+ box-sizing: border-box;
251
+
252
+ @each $breakpoint in map-keys($gutters) {
253
+ @include media-breakpoint-up($breakpoint) {
254
+ $gutter: map-get($gutters, $breakpoint);
255
+ padding-right: ($gutter / 2);
256
+ padding-left: ($gutter / 2);
257
+ }
258
+ }
259
+ }
260
+
261
+ // For each breakpoint, define the maximum width of the container in a media query
262
+ @mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {
263
+ @each $breakpoint, $container-max-width in $max-widths {
264
+ @include media-breakpoint-up($breakpoint, $breakpoints) {
265
+ width: $container-max-width;
266
+ max-width: 100%;
267
+ box-sizing: border-box;
268
+ }
269
+ }
270
+ }
271
+
272
+ @mixin make-gutters($gutters: $grid-gutter-widths) {
273
+ @each $breakpoint in map-keys($gutters) {
274
+ @include media-breakpoint-up($breakpoint) {
275
+ $gutter: map-get($gutters, $breakpoint);
276
+ padding-right: ($gutter / 2);
277
+ padding-left: ($gutter / 2);
278
+ box-sizing: border-box;
279
+ }
280
+ }
281
+ }
282
+
283
+ @mixin make-row($gutters: $grid-gutter-widths) {
284
+ display: flex;
285
+ flex-wrap: wrap;
286
+ box-sizing: border-box;
287
+
288
+ @each $breakpoint in map-keys($gutters) {
289
+ @include media-breakpoint-up($breakpoint) {
290
+ $gutter: map-get($gutters, $breakpoint);
291
+ margin-right: ($gutter / -2);
292
+ margin-left: ($gutter / -2);
293
+ }
294
+ }
295
+ }
296
+
297
+ @mixin make-col-ready($gutters: $grid-gutter-widths) {
298
+ position: relative;
299
+ // Prevent columns from becoming too narrow when at smaller grid tiers by
300
+ // always setting `width: 100%;`. This works because we use `flex` values
301
+ // later on to override this initial width.
302
+ width: 100%;
303
+ min-height: 1px; // Prevent collapsing
304
+
305
+ @each $breakpoint in map-keys($gutters) {
306
+ @include media-breakpoint-up($breakpoint) {
307
+ $gutter: map-get($gutters, $breakpoint);
308
+ padding-right: ($gutter / 2);
309
+ padding-left: ($gutter / 2);
310
+ }
311
+ }
312
+ }
313
+
314
+ @mixin make-col($size, $columns: $grid-columns) {
315
+ flex: 0 0 percentage($size / $columns);
316
+ // width: percentage($size / $columns);
317
+ // Add a `max-width` to ensure content within each column does not blow out
318
+ // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
319
+ // do not appear to require this.
320
+ max-width: percentage($size / $columns);
321
+ }
322
+
323
+ @mixin make-col-offset($size, $columns: $grid-columns) {
324
+ margin-left: percentage($size / $columns);
325
+ }
326
+
327
+ @mixin make-col-push($size, $columns: $grid-columns) {
328
+ left: if($size > 0, percentage($size / $columns), auto);
329
+ }
330
+
331
+ @mixin make-col-pull($size, $columns: $grid-columns) {
332
+ right: if($size > 0, percentage($size / $columns), auto);
333
+ }
334
+
335
+ @mixin make-col-modifier($type, $size, $columns) {
336
+ // Work around the lack of dynamic mixin @include support (https://github.com/sass/sass/issues/626)
337
+ @if $type == push {
338
+ @include make-col-push($size, $columns);
339
+ } @else if $type == pull {
340
+ @include make-col-pull($size, $columns);
341
+ } @else if $type == offset {
342
+ @include make-col-offset($size, $columns);
343
+ }
344
+ }
@@ -0,0 +1,42 @@
1
+ const path = require('path')
2
+ const webpack = require('webpack')
3
+ const ExtractTextPlugin = require("extract-text-webpack-plugin")
4
+
5
+ let app = './assets';
6
+ let dist = '../dist';
7
+
8
+ module.exports = {
9
+ entry: {
10
+ styles: app+'/stylesheets/styles.scss'
11
+ },
12
+ output: {
13
+ filename: 'stylesheets/[name].css',
14
+ path: __dirname + '/' + dist
15
+ },
16
+ module: {
17
+ rules: [
18
+ {
19
+ test: /\.css$/,
20
+ loader: ExtractTextPlugin.extract({
21
+ fallback: 'style-loader',
22
+ use: ['css-loader', 'postcss-loader']
23
+ })
24
+ },
25
+ {
26
+ test: /\.scss$/,
27
+ loader: ExtractTextPlugin.extract({
28
+ fallback: 'style-loader',
29
+ use: ['css-loader?minimize', 'sass-loader']
30
+ })
31
+ },
32
+ {
33
+ test: /\.(png|jpg|gif|svg|woff|woff2|eot|ttf)$/,
34
+ loader: 'url-loader'
35
+ }
36
+ ]
37
+ },
38
+ plugins: [
39
+ require('autoprefixer'),
40
+ new ExtractTextPlugin('stylesheets/[name].css')
41
+ ]
42
+ }
@@ -0,0 +1,29 @@
1
+ const path = require('path')
2
+ const webpack = require('webpack')
3
+ const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
4
+ // const HtmlWebpackPlugin = require('html-webpack-plugin')
5
+
6
+ let app = './assets';
7
+ let dist = '../dist';
8
+
9
+ module.exports = {
10
+ entry: {
11
+ scripts: app+'/javascripts/scripts.js'
12
+ },
13
+ output: {
14
+ filename: 'javascripts/[name].js',
15
+ path: __dirname + '/' + dist
16
+ },
17
+ devServer: {
18
+ contentBase: './dist',
19
+ port: 8080
20
+ },
21
+ plugins: [
22
+ new UglifyJsPlugin()
23
+ // new HtmlWebpackPlugin({
24
+ // template: path.join(__dirname, '../app/html/index.ejs'),
25
+ // minify: false
26
+ // })
27
+ ],
28
+ cache: true
29
+ };
@@ -0,0 +1,10 @@
1
+ const path = require('path')
2
+ const webpack = require('webpack')
3
+
4
+ let js = require('./js.webpack.config')
5
+ let css = require('./css.webpack.config')
6
+
7
+ module.exports = [
8
+ js,
9
+ css
10
+ ]