less 2.7.1 → 2.7.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.
- package/.travis.yml +3 -7
- package/appveyor.yml +1 -0
- package/bin/lessc +42 -20
- package/dist/less.js +20 -27
- package/dist/less.min.js +7 -7
- package/lib/less/functions/color.js +16 -24
- package/lib/less/index.js +1 -1
- package/lib/less/tree/comment.js +1 -0
- package/lib/less-node/lessc-helper.js +2 -2
- package/package.json +5 -3
- package/test/browser/less.js +9 -9
- package/test/css/functions.css +3 -3
- package/test/sourcemaps/maps/import-map.map +1 -0
|
@@ -266,41 +266,33 @@ colorFunctions = {
|
|
|
266
266
|
greyscale: function (color) {
|
|
267
267
|
return colorFunctions.desaturate(color, new Dimension(100));
|
|
268
268
|
},
|
|
269
|
-
contrast: function (color,
|
|
270
|
-
// Return which of `color1` and `color2` has the greatest contrast with `color`
|
|
271
|
-
// according to the standard WCAG contrast ratio calculation.
|
|
272
|
-
// http://www.w3.org/TR/WCAG20/#contrast-ratiodef
|
|
273
|
-
// The threshold param is no longer used, in line with SASS.
|
|
269
|
+
contrast: function (color, dark, light, threshold) {
|
|
274
270
|
// filter: contrast(3.2);
|
|
275
271
|
// should be kept as is, so check for color
|
|
276
272
|
if (!color.rgb) {
|
|
277
273
|
return null;
|
|
278
274
|
}
|
|
279
|
-
if (typeof
|
|
280
|
-
|
|
275
|
+
if (typeof light === 'undefined') {
|
|
276
|
+
light = colorFunctions.rgba(255, 255, 255, 1.0);
|
|
281
277
|
}
|
|
282
|
-
if (typeof
|
|
283
|
-
|
|
278
|
+
if (typeof dark === 'undefined') {
|
|
279
|
+
dark = colorFunctions.rgba(0, 0, 0, 1.0);
|
|
284
280
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
if (luma > luma1) {
|
|
291
|
-
contrast1 = (luma + 0.05) / (luma1 + 0.05);
|
|
292
|
-
} else {
|
|
293
|
-
contrast1 = (luma1 + 0.05) / (luma + 0.05);
|
|
281
|
+
//Figure out which is actually light and dark!
|
|
282
|
+
if (dark.luma() > light.luma()) {
|
|
283
|
+
var t = light;
|
|
284
|
+
light = dark;
|
|
285
|
+
dark = t;
|
|
294
286
|
}
|
|
295
|
-
if (
|
|
296
|
-
|
|
287
|
+
if (typeof threshold === 'undefined') {
|
|
288
|
+
threshold = 0.43;
|
|
297
289
|
} else {
|
|
298
|
-
|
|
290
|
+
threshold = number(threshold);
|
|
299
291
|
}
|
|
300
|
-
if (
|
|
301
|
-
return
|
|
292
|
+
if (color.luma() < threshold) {
|
|
293
|
+
return light;
|
|
302
294
|
} else {
|
|
303
|
-
return
|
|
295
|
+
return dark;
|
|
304
296
|
}
|
|
305
297
|
},
|
|
306
298
|
argb: function (color) {
|
package/lib/less/index.js
CHANGED
|
@@ -2,7 +2,7 @@ module.exports = function(environment, fileManagers) {
|
|
|
2
2
|
var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment;
|
|
3
3
|
|
|
4
4
|
var less = {
|
|
5
|
-
version: [2, 7,
|
|
5
|
+
version: [2, 7, 2],
|
|
6
6
|
data: require('./data'),
|
|
7
7
|
tree: require('./tree'),
|
|
8
8
|
Environment: (Environment = require("./environment/environment")),
|
package/lib/less/tree/comment.js
CHANGED
|
@@ -15,8 +15,8 @@ var lessc_helper = {
|
|
|
15
15
|
'red' : [31, 39],
|
|
16
16
|
'grey' : [90, 39]
|
|
17
17
|
};
|
|
18
|
-
return '\
|
|
19
|
-
'\
|
|
18
|
+
return '\x1b[' + styles[style][0] + 'm' + str +
|
|
19
|
+
'\x1b[' + styles[style][1] + 'm';
|
|
20
20
|
},
|
|
21
21
|
|
|
22
22
|
//Print command line options
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "less",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "Leaner CSS",
|
|
5
5
|
"homepage": "http://lesscss.org",
|
|
6
6
|
"author": {
|
|
@@ -46,11 +46,12 @@
|
|
|
46
46
|
"mime": "^1.2.11",
|
|
47
47
|
"mkdirp": "^0.5.0",
|
|
48
48
|
"promise": "^7.1.1",
|
|
49
|
-
"source-map": "^0.5.3"
|
|
49
|
+
"source-map": "^0.5.3",
|
|
50
|
+
"request": "^2.72.0"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"diff": "^2.2.2",
|
|
53
|
-
"grunt": "
|
|
54
|
+
"grunt": "~0.4.5",
|
|
54
55
|
"grunt-browserify": "^5.0.0",
|
|
55
56
|
"grunt-contrib-clean": "^1.0.0",
|
|
56
57
|
"grunt-contrib-concat": "^1.0.1",
|
|
@@ -62,6 +63,7 @@
|
|
|
62
63
|
"grunt-saucelabs": "^8.6.2",
|
|
63
64
|
"grunt-shell": "^1.3.0",
|
|
64
65
|
"jit-grunt": "^0.10.0",
|
|
66
|
+
"phantomjs-prebuilt": "^2.1.7",
|
|
65
67
|
"time-grunt": "^1.3.0"
|
|
66
68
|
},
|
|
67
69
|
"keywords": [
|