Skip to content

Commit 707ce10

Browse files
authored
Reverts Breaking Changes for a Patch Release (#33)
* Reverts changes made in #19 * Updates history with notes on breaking change releases
1 parent 35b1c30 commit 707ce10

File tree

5 files changed

+20
-115
lines changed

5 files changed

+20
-115
lines changed

History.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
1.3.3 - October 7, 2017
2+
-----------------------
3+
* REVERT RELEASE: This removes the changes made in `#19` only for this release. Those changes will be added back and released in a 2.0 because they are breaking changes.
4+
15
1.3.2 - October 4, 2017
26
-----------------------
7+
* WARNING: This contains a breaking change in #19. If you need the 1.x series, use 1.3.3. Otherwise, use the 2.x series.
38
* Fixes Vulnerability - Regular Expression Denial of Service caused by debug package. `#31`
49

510
1.3.1 - July 14, 2017
611
-----------------------
12+
* WARNING: This contains a breaking change in #19. If you need the 1.x series, use 1.3.3. Otherwise, use the 2.x series.
713
* Fixes Tint, Shade, and Contrast Alpha Interference Issue. `#26`
814

915
1.3.0 - January 5, 2016

lib/parse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function parse (string) {
6161
*/
6262

6363
function modifier () {
64-
var m = match(/^([\+\-](?= )|\*)/);
64+
var m = match(/^([\+\-\*])/);
6565
if (!m) return;
6666
var ret = {};
6767
ret.type = 'modifier';

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "css-color-function",
33
"repository": "git://github.com/ianstormtaylor/css-color-function.git",
4-
"version": "1.3.2",
4+
"version": "1.3.3",
55
"license": "MIT",
66
"description": "A parser and converter for Tab Atkins's proposed color function in CSS.",
77
"keywords": [

test/convert.js

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,12 @@ describe('#convert', function () {
150150
convert('hsl(34, 50%, 50%) hue(25)', 'rgb(191, 117, 64)');
151151
});
152152

153-
it('should set hue with explicit positive', function () {
154-
convert('hsl(34, 50%, 50%) hue(+25)', 'rgb(191, 117, 64)');
155-
});
156-
157153
it('should set hue greater than 360', function () {
158154
convert('hsl(34, 50%, 50%) hue(385)', 'rgb(191, 117, 64)');
159155
});
160156

161157
it('should set hue less than 360', function () {
162-
convert('hsl(34, 50%, 50%) hue(- 369)', 'rgb(191, 117, 64)');
158+
convert('hsl(34, 50%, 50%) hue(-369)', 'rgb(191, 117, 64)');
163159
});
164160

165161
it('should add hue', function () {
@@ -192,7 +188,7 @@ describe('#convert', function () {
192188
convert('hsl(25, 25%, 50%) saturation(+ 25%)', 'rgb(191, 117, 64)');
193189
});
194190

195-
it('should subtract saturation', function () {
191+
it('should substract saturation', function () {
196192
convert('hsl(25, 60%, 50%) saturation(- 10%)', 'rgb(191, 117, 64)');
197193
});
198194

@@ -210,7 +206,7 @@ describe('#convert', function () {
210206
convert('hsl(25, 50%, 25%) lightness(+ 25%)', 'rgb(191, 117, 64)');
211207
});
212208

213-
it('should subtract lightness', function () {
209+
it('should substract lightness', function () {
214210
convert('hsl(25, 50%, 60%) lightness(- 10%)', 'rgb(191, 117, 64)');
215211
});
216212

@@ -224,16 +220,12 @@ describe('#convert', function () {
224220
convert('hwb(0, 0%, 0%) whiteness(20%)', 'rgb(255, 51, 51)'); // hwb(0, 20%, 0%)
225221
});
226222

227-
it('should set whiteness with explicit positive', function () {
228-
convert('hwb(0, 0%, 0%) whiteness(+20%)', 'rgb(255, 51, 51)'); // hwb(0, 20%, 0%)
229-
});
230-
231223
it('should add whiteness', function () {
232-
convert('hwb(0, 75%, 0%) whiteness(+ 25%)', 'rgb(255, 255, 255)'); // hwb(0, 100%, 0%)
224+
convert('hwb(0, 75%, 0%) whiteness(+25%)', 'rgb(255, 255, 255)'); // hwb(0, 100%, 0%)
233225
});
234226

235-
it('should subtract whiteness', function () {
236-
convert('hwb(0, 30%, 0%) whiteness(- 10%)', 'rgb(255, 51, 51)'); // hwb(0, 20%, 0%)
227+
it('should substract whiteness', function () {
228+
convert('hwb(0, 30%, 0%) whiteness(-10%)', 'rgb(255, 51, 51)'); // hwb(0, 20%, 0%)
237229
});
238230

239231
it('should multiply whiteness', function () {
@@ -246,16 +238,12 @@ describe('#convert', function () {
246238
convert('hwb(0, 0%, 0%) blackness(20%)', 'rgb(204, 0, 0)'); // hwb(0, 0%, 20%)
247239
});
248240

249-
it('should set blackness with explicit positive', function () {
250-
convert('hwb(0, 0%, 0%) blackness(+20%)', 'rgb(204, 0, 0)'); // hwb(0, 0%, 20%)
251-
});
252-
253241
it('should add blackness', function () {
254-
convert('hwb(0, 0%, 75%) blackness(+ 25%)', 'rgb(0, 0, 0)'); // hwb(0, 0%, 100%)
242+
convert('hwb(0, 0%, 75%) blackness(+25%)', 'rgb(0, 0, 0)'); // hwb(0, 0%, 100%)
255243
});
256244

257-
it('should subtract blackness', function () {
258-
convert('hwb(0, 0%, 30%) blackness(- 10%)', 'rgb(204, 0, 0)'); // hwb(0, 0%, 20%)
245+
it('should substract blackness', function () {
246+
convert('hwb(0, 0%, 30%) blackness(-10%)', 'rgb(204, 0, 0)'); // hwb(0, 0%, 20%)
259247
});
260248

261249
it('should multiply blackness', function () {
@@ -331,7 +319,7 @@ describe('#convert', function () {
331319

332320
describe('nested color functions', function () {
333321
it('should convert nested color functions', function () {
334-
convert('color(rebeccapurple a(- 10%)) a(- 10%)', 'rgba(102, 51, 153, 0.81)');
322+
convert('color(rebeccapurple a(-10%)) a(-10%)', 'rgba(102, 51, 153, 0.81)');
335323
convert('color(#4C5859 shade(25%)) blend(color(#4C5859 shade(40%)) 20%)', 'rgb(55, 63, 64)');
336324
});
337325
});

test/parse.js

Lines changed: 2 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ describe('#parse', function () {
191191
});
192192

193193
it('should parse nested color functions', function () {
194-
parse('color(hsl(0, 0%, 93%) l(- 5%)) l(+ 10%)', {
194+
parse('color(hsl(0, 0%, 93%) l(-5%)) l(+10%)', {
195195
type: 'function',
196196
name: 'color',
197197
arguments: [
@@ -237,95 +237,6 @@ describe('#parse', function () {
237237
});
238238
});
239239

240-
it('should properly parse modifiers', function () {
241-
parse('red a(+ 5%) a(+5%) a(- 5%) a(-5%) a(* 50%) a(*50%)', {
242-
type: 'function',
243-
name: 'color',
244-
arguments: [
245-
{
246-
type: 'color',
247-
value: 'red',
248-
},
249-
{
250-
type: 'function',
251-
name: 'a',
252-
arguments: [
253-
{
254-
type: 'modifier',
255-
value: '+'
256-
},
257-
{
258-
type: 'number',
259-
value: '5%'
260-
}
261-
]
262-
},
263-
{
264-
type: 'function',
265-
name: 'a',
266-
arguments: [
267-
{
268-
type: 'number',
269-
value: '+5%'
270-
}
271-
]
272-
},
273-
{
274-
type: 'function',
275-
name: 'a',
276-
arguments: [
277-
{
278-
type: 'modifier',
279-
value: '-'
280-
},
281-
{
282-
type: 'number',
283-
value: '5%'
284-
}
285-
]
286-
},
287-
{
288-
type: 'function',
289-
name: 'a',
290-
arguments: [
291-
{
292-
type: 'number',
293-
value: '-5%'
294-
}
295-
]
296-
},
297-
{
298-
type: 'function',
299-
name: 'a',
300-
arguments: [
301-
{
302-
type: 'modifier',
303-
value: '*'
304-
},
305-
{
306-
type: 'number',
307-
value: '50%'
308-
}
309-
]
310-
},
311-
{
312-
type: 'function',
313-
name: 'a',
314-
arguments: [
315-
{
316-
type: 'modifier',
317-
value: '*'
318-
},
319-
{
320-
type: 'number',
321-
value: '50%'
322-
}
323-
]
324-
}
325-
]
326-
});
327-
})
328-
329240

330241
it('should throw on syntax error', function () {
331242
assert.throws(function () {
@@ -335,7 +246,7 @@ describe('#parse', function () {
335246

336247
it('should throw on syntax error for adjuster', function () {
337248
assert.throws(function () {
338-
color.parse('color(red l(+ 5%)');
249+
color.parse('color(red l(+5%)');
339250
}, /Missing closing parenthese for/);
340251
});
341252

0 commit comments

Comments
 (0)