diff --git a/tasks/shared-config.js b/tasks/shared-config.js
index <HASH>..<HASH> 100644
--- a/tasks/shared-config.js
+++ b/tasks/shared-config.js
@@ -97,20 +97,21 @@ module.exports = function( grunt ) {
 		function generateStyle( data, type ) {
 			var content = "";
 			var pattern = outputPattern[ type ];
-			var name, key;
 
-			function generateContent( data, type, parent ) {
-				for (var key in data ) {
-					if ( typeof(data[key]) === "object" ) {
-						generateContent( data[key], type, key );
+			function generateContent( data, parentKey ) {
+				var name, key;
+				for ( key in data ) {
+					name = parentKey ? format( parentKey + "-" + key, options.cssFormat ) : format( key, options.cssFormat );
+
+					if ( typeof( data[ key ] ) === "object" ) {
+						generateContent( data[ key ], name );
 					}else{
-						name = format( key, options.cssFormat );
-						content += pattern.replace( '{{key}}', parent ? parent + "-" + name : name ).replace( '{{value}}', data[ key ] );
+						content += pattern.replace( '{{key}}', name ).replace( '{{value}}', data[ key ] );
 					}
 				}
 			}
 
-			generateContent( data, type );
+			generateContent( data );
 
 			return content;
 		}
fixed issue with more then 2 dimensions.