include_media_rails 1.4.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +3 -0
- data/Appraisals +7 -0
- data/Gemfile +2 -0
- data/README.md +9 -0
- data/Rakefile +2 -0
- data/gemfiles/rails_4.gemfile +8 -0
- data/gemfiles/rails_5.gemfile +8 -0
- data/include_media_rails.gemspec +3 -4
- data/lib/include_media_rails/version.rb +1 -1
- data/package-lock.json +3120 -0
- data/package.json +2 -2
- data/tasks/update.js +3 -3
- data/vendor/assets/stylesheets/include_media.scss +20 -24
- metadata +11 -40
data/package.json
CHANGED
data/tasks/update.js
CHANGED
@@ -2,11 +2,11 @@ var gulp = require('gulp');
|
|
2
2
|
var rename = require('gulp-rename');
|
3
3
|
var paths = require('./configs/paths');
|
4
4
|
|
5
|
-
gulp.task('update',
|
6
|
-
gulp.src(paths.source + '/*.scss')
|
5
|
+
gulp.task('update', gulp.series('download', 'clean', () => {
|
6
|
+
return gulp.src(paths.source + '/*.scss')
|
7
7
|
.pipe(rename({
|
8
8
|
basename: 'include_media',
|
9
9
|
extname: '.scss',
|
10
10
|
}))
|
11
11
|
.pipe(gulp.dest(paths.dist));
|
12
|
-
});
|
12
|
+
}));
|
@@ -1,4 +1,4 @@
|
|
1
|
-
@charset
|
1
|
+
@charset "UTF-8";
|
2
2
|
|
3
3
|
// _ _ _ _ _
|
4
4
|
// (_) | | | | | (_)
|
@@ -8,16 +8,14 @@
|
|
8
8
|
// |_|_| |_|\___|_|\__,_|\__,_|\___| |_| |_| |_|\___|\__,_|_|\__,_|
|
9
9
|
//
|
10
10
|
// Simple, elegant and maintainable media queries in Sass
|
11
|
-
// v1.4.
|
11
|
+
// v1.4.9
|
12
12
|
//
|
13
|
-
//
|
13
|
+
// https://eduardoboucas.github.io/include-media
|
14
14
|
//
|
15
15
|
// Authors: Eduardo Boucas (@eduardoboucas)
|
16
|
-
//
|
16
|
+
// Kitty Giraudel (@kittygiraudel)
|
17
17
|
//
|
18
18
|
// This project is licensed under the terms of the MIT license
|
19
|
-
|
20
|
-
|
21
19
|
////
|
22
20
|
/// include-media library public configuration
|
23
21
|
/// @author Eduardo Boucas
|
@@ -173,7 +171,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
173
171
|
|
174
172
|
////
|
175
173
|
/// Cross-engine logging engine
|
176
|
-
/// @author
|
174
|
+
/// @author Kitty Giraudel
|
177
175
|
/// @access private
|
178
176
|
////
|
179
177
|
|
@@ -185,7 +183,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
185
183
|
///
|
186
184
|
/// @param {String} $message - Message to log
|
187
185
|
///
|
188
|
-
@function log($message) {
|
186
|
+
@function im-log($message) {
|
189
187
|
@if feature-exists('at-error') {
|
190
188
|
@error $message;
|
191
189
|
} @else {
|
@@ -199,14 +197,14 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
199
197
|
|
200
198
|
///
|
201
199
|
/// Wrapper mixin for the log function so it can be used with a more friendly
|
202
|
-
/// API than `@if log('..') {}` or `$_: log('..')`. Basically, use the function
|
200
|
+
/// API than `@if im-log('..') {}` or `$_: im-log('..')`. Basically, use the function
|
203
201
|
/// within functions because it is not possible to include a mixin in a function
|
204
202
|
/// and use the mixin everywhere else because it's much more elegant.
|
205
203
|
///
|
206
204
|
/// @param {String} $message - Message to log
|
207
205
|
///
|
208
206
|
@mixin log($message) {
|
209
|
-
@if log($message) {}
|
207
|
+
@if im-log($message) {}
|
210
208
|
}
|
211
209
|
|
212
210
|
|
@@ -227,7 +225,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
227
225
|
$no-media-breakpoint-value: map-get($breakpoints, $im-no-media-breakpoint);
|
228
226
|
|
229
227
|
@if not $no-media-breakpoint-value {
|
230
|
-
@if log('`#{$im-no-media-breakpoint}` is not a valid breakpoint.') {}
|
228
|
+
@if im-log('`#{$im-no-media-breakpoint}` is not a valid breakpoint.') {}
|
231
229
|
}
|
232
230
|
|
233
231
|
@each $condition in $conditions {
|
@@ -236,7 +234,6 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
236
234
|
$prefix: get-expression-prefix($operator);
|
237
235
|
$value: get-expression-value($condition, $operator);
|
238
236
|
|
239
|
-
// scss-lint:disable SpaceAroundOperator
|
240
237
|
@if ($prefix == 'max' and $value <= $no-media-breakpoint-value) or
|
241
238
|
($prefix == 'min' and $value > $no-media-breakpoint-value) {
|
242
239
|
@return false;
|
@@ -251,7 +248,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
251
248
|
|
252
249
|
////
|
253
250
|
/// Parsing engine
|
254
|
-
/// @author
|
251
|
+
/// @author Kitty Giraudel
|
255
252
|
/// @access private
|
256
253
|
////
|
257
254
|
|
@@ -271,11 +268,11 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
271
268
|
}
|
272
269
|
|
273
270
|
// It is not possible to include a mixin inside a function, so we have to
|
274
|
-
// rely on the `log(..)` function rather than the `log(..)` mixin. Because
|
271
|
+
// rely on the `im-log(..)` function rather than the `log(..)` mixin. Because
|
275
272
|
// functions cannot be called anywhere in Sass, we need to hack the call in
|
276
273
|
// a dummy variable, such as `$_`. If anybody ever raise a scoping issue with
|
277
|
-
// Sass 3.3, change this line in `@if log(..) {}` instead.
|
278
|
-
$_: log('No operator found in `#{$expression}`.');
|
274
|
+
// Sass 3.3, change this line in `@if im-log(..) {}` instead.
|
275
|
+
$_: im-log('No operator found in `#{$expression}`.');
|
279
276
|
}
|
280
277
|
|
281
278
|
|
@@ -334,11 +331,11 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
334
331
|
|
335
332
|
@if not $interval {
|
336
333
|
// It is not possible to include a mixin inside a function, so we have to
|
337
|
-
// rely on the `log(..)` function rather than the `log(..)` mixin. Because
|
334
|
+
// rely on the `im-log(..)` function rather than the `log(..)` mixin. Because
|
338
335
|
// functions cannot be called anywhere in Sass, we need to hack the call in
|
339
336
|
// a dummy variable, such as `$_`. If anybody ever raise a scoping issue with
|
340
|
-
// Sass 3.3, change this line in `@if log(..) {}` instead.
|
341
|
-
$_: log('Unknown unit `#{unit($value)}`.');
|
337
|
+
// Sass 3.3, change this line in `@if im-log(..) {}` instead.
|
338
|
+
$_: im-log('Unknown unit `#{unit($value)}`.');
|
342
339
|
}
|
343
340
|
|
344
341
|
@if $operator == '>' {
|
@@ -400,7 +397,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
400
397
|
|
401
398
|
////
|
402
399
|
/// String to number converter
|
403
|
-
/// @author
|
400
|
+
/// @author Kitty Giraudel
|
404
401
|
/// @access private
|
405
402
|
////
|
406
403
|
|
@@ -416,7 +413,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
416
413
|
@if type-of($value) == 'number' {
|
417
414
|
@return $value;
|
418
415
|
} @else if type-of($value) != 'string' {
|
419
|
-
$_: log('Value for `to-number` should be a number or a string.');
|
416
|
+
$_: im-log('Value for `to-number` should be a number or a string.');
|
420
417
|
}
|
421
418
|
|
422
419
|
$first-character: str-slice($value, 1, 1);
|
@@ -463,7 +460,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
463
460
|
$units: ('px': 1px, 'cm': 1cm, 'mm': 1mm, '%': 1%, 'ch': 1ch, 'pc': 1pc, 'in': 1in, 'em': 1em, 'rem': 1rem, 'pt': 1pt, 'ex': 1ex, 'vw': 1vw, 'vh': 1vh, 'vmin': 1vmin, 'vmax': 1vmax);
|
464
461
|
|
465
462
|
@if not index(map-keys($units), $unit) {
|
466
|
-
$_: log('Invalid unit `#{$unit}`.');
|
463
|
+
$_: im-log('Invalid unit `#{$unit}`.');
|
467
464
|
}
|
468
465
|
|
469
466
|
@return $value * map-get($units, $unit);
|
@@ -475,7 +472,7 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
475
472
|
/// configuration such as custom breakpoints (referred to as tweakpoints)
|
476
473
|
/// for instance.
|
477
474
|
///
|
478
|
-
/// @author
|
475
|
+
/// @author Kitty Giraudel
|
479
476
|
///
|
480
477
|
/// @param {Map} $tweakpoints [()] - Map of tweakpoints to be merged with `$breakpoints`
|
481
478
|
/// @param {Map} $tweak-media-expressions [()] - Map of tweaked media expressions to be merged with `$media-expression`
|
@@ -554,7 +551,6 @@ $im-no-media-expressions: ('screen', 'portrait', 'landscape') !default;
|
|
554
551
|
/// @include media('>=350px', '<tablet', 'retina3x') { }
|
555
552
|
///
|
556
553
|
@mixin media($conditions...) {
|
557
|
-
// scss-lint:disable SpaceAroundOperator
|
558
554
|
@if ($im-media-support and length($conditions) == 0) or
|
559
555
|
(not $im-media-support and im-intercepts-static-breakpoint($conditions...)) {
|
560
556
|
@content;
|
metadata
CHANGED
@@ -1,69 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: include_media_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kaoru Kohashigawa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: railties
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '3.1'
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '5'
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.1'
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '5'
|
33
13
|
- !ruby/object:Gem::Dependency
|
34
14
|
name: sass
|
35
15
|
requirement: !ruby/object:Gem::Requirement
|
36
16
|
requirements:
|
37
17
|
- - ">="
|
38
18
|
- !ruby/object:Gem::Version
|
39
|
-
version: '3.
|
40
|
-
- - "<"
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '4'
|
19
|
+
version: '3.2'
|
43
20
|
type: :runtime
|
44
21
|
prerelease: false
|
45
22
|
version_requirements: !ruby/object:Gem::Requirement
|
46
23
|
requirements:
|
47
24
|
- - ">="
|
48
25
|
- !ruby/object:Gem::Version
|
49
|
-
version: '3.
|
50
|
-
- - "<"
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: '4'
|
26
|
+
version: '3.2'
|
53
27
|
- !ruby/object:Gem::Dependency
|
54
28
|
name: bundler
|
55
29
|
requirement: !ruby/object:Gem::Requirement
|
56
30
|
requirements:
|
57
31
|
- - "~>"
|
58
32
|
- !ruby/object:Gem::Version
|
59
|
-
version: '
|
33
|
+
version: '2.2'
|
60
34
|
type: :development
|
61
35
|
prerelease: false
|
62
36
|
version_requirements: !ruby/object:Gem::Requirement
|
63
37
|
requirements:
|
64
38
|
- - "~>"
|
65
39
|
- !ruby/object:Gem::Version
|
66
|
-
version: '
|
40
|
+
version: '2.2'
|
67
41
|
- !ruby/object:Gem::Dependency
|
68
42
|
name: rake
|
69
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -97,9 +71,6 @@ dependencies:
|
|
97
71
|
requirement: !ruby/object:Gem::Requirement
|
98
72
|
requirements:
|
99
73
|
- - ">="
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '3.1'
|
102
|
-
- - "<"
|
103
74
|
- !ruby/object:Gem::Version
|
104
75
|
version: '5'
|
105
76
|
type: :development
|
@@ -107,9 +78,6 @@ dependencies:
|
|
107
78
|
version_requirements: !ruby/object:Gem::Requirement
|
108
79
|
requirements:
|
109
80
|
- - ">="
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
version: '3.1'
|
112
|
-
- - "<"
|
113
81
|
- !ruby/object:Gem::Version
|
114
82
|
version: '5'
|
115
83
|
description: This gem allows you to easily import include media to your project to
|
@@ -123,6 +91,7 @@ files:
|
|
123
91
|
- ".gitignore"
|
124
92
|
- ".rspec"
|
125
93
|
- ".travis.yml"
|
94
|
+
- Appraisals
|
126
95
|
- CODE_OF_CONDUCT.md
|
127
96
|
- Gemfile
|
128
97
|
- LICENSE.txt
|
@@ -130,10 +99,13 @@ files:
|
|
130
99
|
- Rakefile
|
131
100
|
- bin/console
|
132
101
|
- bin/setup
|
102
|
+
- gemfiles/rails_4.gemfile
|
103
|
+
- gemfiles/rails_5.gemfile
|
133
104
|
- gulpfile.js
|
134
105
|
- include_media_rails.gemspec
|
135
106
|
- lib/include_media_rails.rb
|
136
107
|
- lib/include_media_rails/version.rb
|
108
|
+
- package-lock.json
|
137
109
|
- package.json
|
138
110
|
- tasks/clean.js
|
139
111
|
- tasks/configs/paths.js
|
@@ -160,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
132
|
- !ruby/object:Gem::Version
|
161
133
|
version: '0'
|
162
134
|
requirements: []
|
163
|
-
|
164
|
-
rubygems_version: 2.5.1
|
135
|
+
rubygems_version: 3.1.4
|
165
136
|
signing_key:
|
166
137
|
specification_version: 4
|
167
138
|
summary: Use Include Media by Eduardo Bouças (@eduardoboucas) in any Rails > 3.1 project
|