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

Update Navigation Menu Item icon #20763

Merged
merged 3 commits into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions packages/block-editor/src/components/block-switcher/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
}

// Show an indicator triangle.
.block-editor-block-switcher__no-switcher-icon,
.block-editor-block-switcher__toggle {
position: relative;

&::after {
display: none;
display: block;
content: "";
position: absolute;
bottom: 1px;
Expand Down Expand Up @@ -41,14 +42,12 @@
}
}

// When the block switcher does not have any transformations, we show it but as disabled.
// The background and opacity change helps make the icon legible, despite being disabled.
// Even when the block switcher does not have any transformations, it still serves as a block indicator.
.components-button.block-editor-block-switcher__no-switcher-icon:disabled {
opacity: 0.84;
opacity: 1;

// Also make the icon monochrome to further imply disabled state.
// We use !important here because icon colors are set as inline styles,
// and should be overridden when disabled.
// Since it's not clickable, though, don't show a hover state.
&,
.block-editor-block-icon.has-colors {
color: $dark-gray-primary !important;
}
Expand Down Expand Up @@ -164,10 +163,6 @@
}

.components-button.block-editor-block-switcher__toggle {
&::after {
display: block;
}

.block-editor-block-icon,
.block-editor-block-switcher__transform {
width: $block-toolbar-height;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { navigation as icon } from '@wordpress/icons';
import { mapMarker as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down
5 changes: 2 additions & 3 deletions packages/icons/src/library/map-marker.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/**
* WordPress dependencies
*/
import { SVG, Path, Circle } from '@wordpress/primitives';
import { SVG, Path } from '@wordpress/primitives';

const mapMarker = (
<SVG xmlns="https://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z" />
<Circle cx="12" cy="9" r="2.5" />
<Path d="M12.5 4C8.9 4 6 6.8 6 10.2c0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C19 6.8 16.1 4 12.5 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4zM12.5 9c-.8 0-1.5.7-1.5 1.5s.7 1.5 1.5 1.5 1.5-.7 1.5-1.5S13.3 9 12.5 9z" />
</SVG>
);

Expand Down
21 changes: 3 additions & 18 deletions storybook/test/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12481,12 +12481,7 @@ exports[`Storyshots Icons/Icon Library 1`] = `
xmlns="https://www.w3.org/2000/svg"
>
<path
d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z"
/>
<circle
cx="12"
cy="9"
r="2.5"
d="M12.5 4C8.9 4 6 6.8 6 10.2c0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C19 6.8 16.1 4 12.5 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4zM12.5 9c-.8 0-1.5.7-1.5 1.5s.7 1.5 1.5 1.5 1.5-.7 1.5-1.5S13.3 9 12.5 9z"
/>
</svg>
<svg
Expand All @@ -12499,12 +12494,7 @@ exports[`Storyshots Icons/Icon Library 1`] = `
xmlns="https://www.w3.org/2000/svg"
>
<path
d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z"
/>
<circle
cx="12"
cy="9"
r="2.5"
d="M12.5 4C8.9 4 6 6.8 6 10.2c0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C19 6.8 16.1 4 12.5 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4zM12.5 9c-.8 0-1.5.7-1.5 1.5s.7 1.5 1.5 1.5 1.5-.7 1.5-1.5S13.3 9 12.5 9z"
/>
</svg>
<svg
Expand All @@ -12517,12 +12507,7 @@ exports[`Storyshots Icons/Icon Library 1`] = `
xmlns="https://www.w3.org/2000/svg"
>
<path
d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zM7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.88-2.88 7.19-5 9.88C9.92 16.21 7 11.85 7 9z"
/>
<circle
cx="12"
cy="9"
r="2.5"
d="M12.5 4C8.9 4 6 6.8 6 10.2c0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C19 6.8 16.1 4 12.5 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4zM12.5 9c-.8 0-1.5.7-1.5 1.5s.7 1.5 1.5 1.5 1.5-.7 1.5-1.5S13.3 9 12.5 9z"
/>
</svg>
</div>
Expand Down