Skip to content

Commit

Permalink
[Icons] Remove more icon fill attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer authored and oliviertassinari committed Jul 18, 2018
1 parent a5abdb8 commit 009971e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions packages/material-ui-icons/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ async function worker({ svgPath, options, renameFilter, template }) {
}

const data = await fse.readFile(svgPath, { encoding: 'utf8' });
const result = await svgo.optimize(data);

// Remove hardcoded color fill before optimizing so that empty groups are removed
const input = data.replace(/ fill="#010101"/g, '');

const result = await svgo.optimize(input);
// Extract the paths from the svg string
// Clean xml paths
const paths = result.data
Expand All @@ -122,7 +125,6 @@ async function worker({ svgPath, options, renameFilter, template }) {
.replace(/xlink:href="#a"/g, '')
.replace(/xlink:href="#c"/g, '')
.replace(/xlink:href="#SVGID_[\d]*_"/g, '')
.replace(/fill="#010101" /g, '')
.replace(/fill-opacity=/g, 'fillOpacity=')
.replace(/<path[^>]*0h24[^>]*>/g, '')
.replace(/<path[^>]*0H24[^>]*>/g, '')
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-icons/src/AllOut.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import React from 'react';
import createSvgIcon from './utils/createSvgIcon';

export default createSvgIcon(
<React.Fragment><path fill="#010101" d="M16.21 4.16l4 4v-4zm4 12l-4 4h4zm-12 4l-4-4v4zm-4-12l4-4h-4zm12.95-.95c-2.73-2.73-7.17-2.73-9.9 0s-2.73 7.17 0 9.9 7.17 2.73 9.9 0 2.73-7.16 0-9.9zm-1.1 8.8c-2.13 2.13-5.57 2.13-7.7 0s-2.13-5.57 0-7.7 5.57-2.13 7.7 0 2.13 5.57 0 7.7z" /><path fill="none" d="M.21.16h24v24h-24z" /></React.Fragment>
<React.Fragment><path d="M16.21 4.16l4 4v-4zm4 12l-4 4h4zm-12 4l-4-4v4zm-4-12l4-4h-4zm12.95-.95c-2.73-2.73-7.17-2.73-9.9 0s-2.73 7.17 0 9.9 7.17 2.73 9.9 0 2.73-7.16 0-9.9zm-1.1 8.8c-2.13 2.13-5.57 2.13-7.7 0s-2.13-5.57 0-7.7 5.57-2.13 7.7 0 2.13 5.57 0 7.7z" /><path fill="none" d="M.21.16h24v24h-24z" /></React.Fragment>
, 'AllOut');
2 changes: 1 addition & 1 deletion packages/material-ui-icons/src/FiberManualRecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import React from 'react';
import createSvgIcon from './utils/createSvgIcon';

export default createSvgIcon(
<React.Fragment><circle cx="12" cy="12" r="8" fill="#010101" /></React.Fragment>
<React.Fragment><circle cx="12" cy="12" r="8" /></React.Fragment>
, 'FiberManualRecord');
2 changes: 1 addition & 1 deletion packages/material-ui-icons/src/FiberSmartRecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import React from 'react';
import createSvgIcon from './utils/createSvgIcon';

export default createSvgIcon(
<React.Fragment><g fill="#010101"><circle cx="9" cy="12" r="8" /><path d="M17 4.26v2.09a5.99 5.99 0 0 1 0 11.3v2.09c3.45-.89 6-4.01 6-7.74s-2.55-6.85-6-7.74z" /></g></React.Fragment>
<React.Fragment><circle cx="9" cy="12" r="8" /><path d="M17 4.26v2.09a5.99 5.99 0 0 1 0 11.3v2.09c3.45-.89 6-4.01 6-7.74s-2.55-6.85-6-7.74z" /></React.Fragment>
, 'FiberSmartRecord');
2 changes: 1 addition & 1 deletion packages/material-ui-icons/src/ScatterPlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import React from 'react';
import createSvgIcon from './utils/createSvgIcon';

export default createSvgIcon(
<React.Fragment><g fill="#010101"><circle cx="7" cy="14" r="3" /><circle cx="11" cy="6" r="3" /><circle cx="16.6" cy="17.6" r="3" /></g></React.Fragment>
<React.Fragment><circle cx="7" cy="14" r="3" /><circle cx="11" cy="6" r="3" /><circle cx="16.6" cy="17.6" r="3" /></React.Fragment>
, 'ScatterPlot');
2 changes: 1 addition & 1 deletion packages/material-ui-icons/src/StrikethroughS.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 009971e

Please sign in to comment.