Skip to content

Commit 5a6600f

Browse files
committed
fix(utilities): allow numbers in custom style names
1 parent a6cd723 commit 5a6600f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/utilities.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var React = require('react');
22
var hyphenPatternRegex = /-([a-z])/g;
3-
var CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX = /^--[a-zA-Z-]+$|^[^-]+$/;
3+
var CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX = /^--[a-zA-Z0-9-]+$|^[^-]+$/;
44

55
/**
66
* Converts a string to camelCase.

test/utilities.js

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ describe('utilties.camelCase', () => {
2222
assert.equal(camelCase('fooBar'), 'fooBar');
2323
assert.equal(camelCase('--fooBar'), '--fooBar');
2424
assert.equal(camelCase('--foo-bar'), '--foo-bar');
25+
assert.equal(camelCase('--foo100'), '--foo100');
26+
assert.equal(camelCase('--foo-100'), '--foo-100');
2527
});
2628

2729
it('camelCases a string', () => {

0 commit comments

Comments
 (0)