The best way to achieve this would be to not use classes at all, and instead use individual data-* attributes for each property.
If you cannot change the HTML then you could achieve what you required by creating an array of objects which contains the key/value pairs. You can then use the index of the element to relate it to the key/value pairs object:
var arr = $('div').map(function() {
var obj = {};
for (var i = 0; i < this.classList.length; i++) {
var className = this.classList[i];
var matches = /^cc-(.+)-(.+)$/.exec(className);
obj[matches[1]] = matches[2];
}
return obj;
}).get();
Example output:
[{
"colour": "red",
"size": "big",
"width": "narrow"
}]
Working example
This approach has the benefit of being completely extensible; if you add any other classes then the code will automatically work without changes.
data-*attributes for each property instead. Are you able to change the HTML format?color,font-sizeandwidth?