| 218 | }; |
| 219 | |
| 220 | const cssifyTheme = (grandparent, parent, parentKey) => { |
| 221 | _.forEach(parent, (style, styleName) => { |
| 222 | if ( |
| 223 | styleName.indexOf('.') === 0 && |
| 224 | parentKey && |
| 225 | parentKey.indexOf('.') === 0 |
| 226 | ) { |
| 227 | if (grandparent) { |
| 228 | if (!grandparent[styleName]) { |
| 229 | grandparent[styleName] = {}; |
| 230 | } else { |
| 231 | grandparent[styleName][parentKey] = style; |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | if ( |
| 236 | style && |
| 237 | typeof style === 'object' && |
| 238 | styleName !== 'fontVariant' && |
| 239 | styleName !== 'transform' |
| 240 | ) { |
| 241 | cssifyTheme(parent, style, styleName); |
| 242 | } |
| 243 | }); |
| 244 | }; |
| 245 | |
| 246 | cssifyTheme(null, theme, null); |
| 247 | |