Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try: G2-inspired iconography #20464

Merged
merged 19 commits into from
Mar 5, 2020
Merged

Try: G2-inspired iconography #20464

merged 19 commits into from
Mar 5, 2020

Conversation

jasmussen
Copy link
Contributor

@jasmussen jasmussen commented Feb 26, 2020

closes #20284

This PR explores adding the new icons that are discussed in #20284.

Note that many of these icons are still receiving feedback in the Figma file, and this PR will be updated to address any corrections made.

Screenshots:

Screenshot 2020-02-26 at 13 34 49

Screenshot 2020-02-26 at 13 35 01

Screenshot 2020-02-26 at 13 35 18

Screenshot 2020-02-26 at 13 35 43

Screenshot 2020-02-26 at 13 35 56

This branch is still in progress, as these new icons require a bit more work than just replacing SVG files. For instance, the dropdown indicator for more inline tools is currently drawn with CSS, and should be a chevron instead, and some icons are currently scaled down, so the CSS needs to be tuned.

However as a work in progress, I invite you to try out the current state of the branch. The immediate feeling is that the coherence feels very much elevated, as the icons are balanced towards the same G2 visual, causing a nice relationship between the dark stroke outlines and the reduced icons.

@github-actions
Copy link

github-actions bot commented Feb 26, 2020

Size Change: -1.74 kB (0%)

Total Size: 863 kB

Filename Size Change
build/api-fetch/index.js 3.39 kB -1 B
build/block-editor/index.js 104 kB -237 B (0%)
build/block-editor/style-rtl.css 10.5 kB +66 B (0%)
build/block-editor/style.css 10.5 kB +61 B (0%)
build/block-library/editor-rtl.css 7.26 kB -100 B (1%)
build/block-library/editor.css 7.26 kB -100 B (1%)
build/block-library/index.js 115 kB -670 B (0%)
build/blocks/index.js 57.7 kB +41 B (0%)
build/components/index.js 191 kB -122 B (0%)
build/components/style-rtl.css 15.5 kB -18 B (0%)
build/components/style.css 15.5 kB -12 B (0%)
build/compose/index.js 5.75 kB -2 B (0%)
build/date/index.js 5.36 kB -4 B (0%)
build/dom-ready/index.js 569 B +1 B
build/edit-post/index.js 90.8 kB -93 B (0%)
build/edit-post/style-rtl.css 8.58 kB +50 B (0%)
build/edit-post/style.css 8.58 kB +50 B (0%)
build/edit-site/style-rtl.css 2.48 kB -28 B (1%)
build/edit-site/style.css 2.48 kB -27 B (1%)
build/edit-widgets/style-rtl.css 2.59 kB -2 B (0%)
build/edit-widgets/style.css 2.58 kB -2 B (0%)
build/editor/index.js 44.5 kB -100 B (0%)
build/escape-html/index.js 734 B +1 B
build/format-library/index.js 7.11 kB -492 B (6%)
build/hooks/index.js 1.92 kB +1 B
build/keyboard-shortcuts/index.js 2.3 kB +1 B
build/list-reusable-blocks/index.js 2.99 kB +1 B
build/nux/index.js 3.01 kB -16 B (0%)
build/plugins/index.js 2.54 kB -1 B
build/redux-routine/index.js 2.84 kB +1 B
build/rich-text/index.js 14.3 kB +5 B (0%)
build/server-side-render/index.js 2.55 kB +6 B (0%)
build/url/index.js 4 kB -1 B
build/warning/index.js 1.14 kB -1 B
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.01 kB 0 B
build/annotations/index.js 3.43 kB 0 B
build/autop/index.js 2.58 kB 0 B
build/blob/index.js 620 B 0 B
build/block-directory/index.js 6.02 kB 0 B
build/block-directory/style-rtl.css 760 B 0 B
build/block-directory/style.css 760 B 0 B
build/block-library/style-rtl.css 7.5 kB 0 B
build/block-library/style.css 7.51 kB 0 B
build/block-library/theme-rtl.css 669 B 0 B
build/block-library/theme.css 671 B 0 B
build/block-serialization-default-parser/index.js 1.65 kB 0 B
build/block-serialization-spec-parser/index.js 3.1 kB 0 B
build/core-data/index.js 10.5 kB 0 B
build/data-controls/index.js 1.03 kB 0 B
build/data/index.js 8.22 kB 0 B
build/deprecated/index.js 772 B 0 B
build/dom/index.js 3.06 kB 0 B
build/edit-site/index.js 4.63 kB 0 B
build/edit-widgets/index.js 4.42 kB 0 B
build/editor/editor-styles-rtl.css 325 B 0 B
build/editor/editor-styles.css 327 B 0 B
build/editor/style-rtl.css 3.98 kB 0 B
build/editor/style.css 3.98 kB 0 B
build/element/index.js 4.45 kB 0 B
build/format-library/style-rtl.css 502 B 0 B
build/format-library/style.css 502 B 0 B
build/html-entities/index.js 622 B 0 B
build/i18n/index.js 3.48 kB 0 B
build/is-shallow-equal/index.js 710 B 0 B
build/keycodes/index.js 1.68 kB 0 B
build/list-reusable-blocks/style-rtl.css 226 B 0 B
build/list-reusable-blocks/style.css 226 B 0 B
build/media-utils/index.js 4.85 kB 0 B
build/notices/index.js 1.57 kB 0 B
build/nux/style-rtl.css 616 B 0 B
build/nux/style.css 613 B 0 B
build/primitives/index.js 1.49 kB 0 B
build/priority-queue/index.js 780 B 0 B
build/shortcode/index.js 1.7 kB 0 B
build/token-list/index.js 1.27 kB 0 B
build/viewport/index.js 1.61 kB 0 B
build/wordcount/index.js 1.18 kB 0 B

compressed-size-action

@jasmussen
Copy link
Contributor Author

I'm slightly pausing adding additional icons, both to let feedback be addressed in the Figma file, but also to look at improving the pipeline slightly.

Currently the icons are sourced in Figma, and Figma has a good SVG exporter that makes batch exporting easy. But many of the icons are drawn using strokes instead of fills, and these strokes need to become fills in order to work properly as icons in the editor.

https://github.com/elrumordelaluz/outline-stroke looks like it can help automate the conversion of strokes to fills. Combined with svgmin, the pipeline can be automated entirely.

@youknowriad
Copy link
Contributor

The inserter icon doesn't work well if the button is not bordered or with a background. Maybe it's time to add back to the isPrimary or isSecondary variation for the appender and inbetween-inserter.

Also the ButtonAppender is still using the old icon.

@youknowriad
Copy link
Contributor

I don't know if it's just a visual impression but the main inserter feels off-centered for me.

@jasmussen
Copy link
Contributor Author

The inserter icon doesn't work well if the button is not bordered or with a background. Maybe it's time to add back to the isPrimary or isSecondary variation for the appender and inbetween-inserter.

Oh that's right, I meant to mention that. This is something we'll have to solve, and I have a few ideas.

@jasmussen
Copy link
Contributor Author

I don't know if it's just a visual impression but the main inserter feels off-centered for me.

Good catch, I believe that should be fixed now.

@jasmussen
Copy link
Contributor Author

I'm sad to note that the outline-stroke package is not useful for us:

Screenshot 2020-03-02 at 09 32 38

So instead I'll be looking at other ways to streamline in the near future.

@jasmussen
Copy link
Contributor Author

Fixed this one, which has annoyed me for a while:

this one

@jasmussen
Copy link
Contributor Author

Chevron icon for more inline tools:

Screenshot 2020-03-03 at 11 31 10

@jasmussen
Copy link
Contributor Author

Retired the dropdown mixin, which also meant removing it from here:

Screenshot 2020-03-03 at 11 32 29

Better, even though it can become better still:

Screenshot 2020-03-03 at 11 35 58

@jasmussen
Copy link
Contributor Author

Polished the sibling inserter. Before:

Screenshot 2020-03-03 at 11 37 58

It was inspired by this:

Screenshot 2020-03-03 at 11 41 50

After:

Screenshot 2020-03-03 at 12 24 45

I also added an animation-only delay:

delayed

@jasmussen jasmussen requested a review from mkaz as a code owner March 3, 2020 11:55
@jasmussen
Copy link
Contributor Author

Polished the appenders used in Buttons, Social Links, Navigation:

Screenshot 2020-03-03 at 12 55 23

@jasmussen jasmussen requested a review from ntwb as a code owner March 4, 2020 12:08
<Path fill="none" d="M0 0h24v24H0V0z" />
<Path d="M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z" />
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M9 20h6V9H9v11zM4 4v1.5h16V4H4z" />
</SVG>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move these to the icons package?

viewBox="0 0 24 24"
>
<Path d="M6.5 1v21.5l6-6.5H21L6.5 1zm5.1 13l-3.1 3.4V5.9l7.8 8.1h-4.7z" />
<Path d="M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z" />
</SVG>
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to move these into the icons package?

</SVG>
);
export const embedVideoIcon = (
<SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<Path d="M0,0h24v24H0V0z" fill="none" />
<Path d="m10 8v8l5-4-5-4zm9-5h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2zm0 16h-14v-14h14v14z" />
<Path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about moving these to the icons package?

<Rect x="7" y="11" width="2" height="2" />
<Rect x="7" y="15" width="2" height="2" />
<Path d="M20.1,3H3.9C3.4,3,3,3.4,3,3.9v16.2C3,20.5,3.4,21,3.9,21h16.2c0.4,0,0.9-0.5,0.9-0.9V3.9C21,3.4,20.5,3,20.1,3z M19,19H5V5h14V19z" />
<Path d="M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, I thought I already moved this to the icons package? I believe this file is not used at all and should be removed.

@@ -5,8 +5,7 @@ import { Path, SVG } from '@wordpress/components';

export const ToolbarSubmenuIcon = () => (
<SVG xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<Path d="M14 5h8v2h-8zm0 5.5h8v2h-8zm0 5.5h8v2h-8zM2 11.5C2 15.08 4.92 18 8.5 18H9v2l3-3-3-3v2h-.5C6.02 16 4 13.98 4 11.5S6.02 7 8.5 7H12V5H8.5C4.92 5 2 7.92 2 11.5z" />
<Path fill="none" d="M0 0h24v24H0z" />
<Path d="M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move this to the icons package.

>
<Path d="M5 5H3v2h2V5zm3 8h11v-2H8v2zm9-8H6v2h11V5zM7 11H5v2h2v-2zm0 8h2v-2H7v2zm3-2v2h11v-2H10z" />
<Path d="M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icons package?

SVG,
} from '@wordpress/components';
import { useSelect, useDispatch } from '@wordpress/data';
import { PostPreviewButton } from '@wordpress/editor';
import { __, _x } from '@wordpress/i18n';
import { external } from '@wordpress/icons';
import { external, check } from '@wordpress/icons';

const downArrow = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this already on the icons package?

@jasmussen
Copy link
Contributor Author

You're a treasure, Riad. I don't know how you manage to review so thoroughly, and create new PRs at the same time. Thank you.

@shaunandrews
Copy link
Contributor

Looking real good. Very nice work.

@youknowriad youknowriad added the [Type] Enhancement A suggestion for improvement. label Mar 5, 2020
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great for me 👍
I think now it's best to ship and polish any details in dedicated PRs like moving the specific icons to the icons package.

@jasmussen
Copy link
Contributor Author

jasmussen commented Mar 5, 2020

Riad you speedy speedy man! Did you go ahead and address all the "icon package" items you reported? Because I was going to! I see, dedicated PRs. I'll help.

One note before you merge, though — I noticed that the checkbox form control is now looking a bit strained, I'd like to see what I can do with it before merge.

Screenshot 2020-03-05 at 09 28 16

@jasmussen
Copy link
Contributor Author

Polished checkboxes. Small screens:

Screenshot 2020-03-05 at 09 48 28

Big screens:

Screenshot 2020-03-05 at 09 49 10

@youknowriad youknowriad merged commit ad97916 into master Mar 5, 2020
@youknowriad youknowriad deleted the try/g2-iconography branch March 5, 2020 15:17
@github-actions github-actions bot added this to the Gutenberg 7.7 milestone Mar 5, 2020
@mapk
Copy link
Contributor

mapk commented Mar 6, 2020

🎉 Really well done! Thanks for tying together all the things!

@JohnRDOrazio
Copy link
Contributor

Would it be possible to add the color-picker dashicon to gutenberg? I started porting from https://github.com/WordPress/dashicons/blob/master/svg-min/color-picker.svg like this:
https://github.com/JohnRDOrazio/gutenberg/blob/add-color-picker-icon/packages/icons/src/library/color-picker.js
But I'm not sure that's enough? Can this be looked into?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidating WordPress Icons
7 participants