Skip to content

Commit

Permalink
Try a single icon for title blocks (#40596)
Browse files Browse the repository at this point in the history
* Updates the implementation of "title" blocks so that they consume a single icon. 
* Also updates the `title` icon. 
* Removes the now un-used icons, and replaces any use of `postTitle` icon with `postContent`.
  • Loading branch information
jameskoster authored May 5, 2022
1 parent 6c782ab commit 50ecf57
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 65 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/comments-title/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { commentTitle as icon } from '@wordpress/icons';
import { title as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { __ } from '@wordpress/i18n';
import {
category as categoryIcon,
page as pageIcon,
postTitle as postIcon,
postContent as postIcon,
tag as tagIcon,
} from '@wordpress/icons';

Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation-link/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import {
category,
page,
postTitle,
postContent,
tag,
customPostType,
} from '@wordpress/icons';
Expand All @@ -17,7 +17,7 @@ import fallbackVariations from './fallback-variations';
function getIcon( variationName ) {
switch ( variationName ) {
case 'post':
return postTitle;
return postContent;
case 'page':
return page;
case 'tag':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Object {
"description": "A link to a post.",
"icon": <SVG
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
xmlns="https://www.w3.org/2000/svg"
>
<Path
d="M4 14.5h16V16H4zM4 18.5h9V20H4zM4 4h3c2 0 3 .86 3 2.583 0 .891-.253 1.554-.76 1.988-.505.435-1.24.652-2.204.652H5.542V12H4V4zm2.855 4c.53 0 .924-.114 1.18-.343.266-.228.398-.579.398-1.051 0-.473-.132-.82-.397-1.04-.265-.229-.67-.343-1.217-.343H5.542V8h1.313z"
d="M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"
/>
</SVG>,
"isActive": [Function],
Expand Down Expand Up @@ -120,10 +120,10 @@ Object {
"description": "A link to a post.",
"icon": <SVG
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
xmlns="https://www.w3.org/2000/svg"
>
<Path
d="M4 14.5h16V16H4zM4 18.5h9V20H4zM4 4h3c2 0 3 .86 3 2.583 0 .891-.253 1.554-.76 1.988-.505.435-1.24.652-2.204.652H5.542V12H4V4zm2.855 4c.53 0 .924-.114 1.18-.343.266-.228.398-.579.398-1.051 0-.473-.132-.82-.397-1.04-.265-.229-.67-.343-1.217-.343H5.542V8h1.313z"
d="M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"
/>
</SVG>,
"isActive": [Function],
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-title/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { postTitle as icon } from '@wordpress/icons';
import { title as icon } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/query-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import deprecated from './deprecated';
/**
* WordPress dependencies
*/
import { queryTitle as icon } from '@wordpress/icons';
import { title as icon } from '@wordpress/icons';

const { name } = metadata;
export { metadata, name };
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/query-title/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { archiveTitle } from '@wordpress/icons';
import { title } from '@wordpress/icons';
const variations = [
{
isDefault: true,
Expand All @@ -11,7 +11,7 @@ const variations = [
description: __(
'Display the archive title based on the queried object.'
),
icon: archiveTitle,
icon: title,
attributes: {
type: 'archive',
},
Expand Down
6 changes: 6 additions & 0 deletions packages/icons/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

### Breaking Changes
- Removed icons no longer used by the UI: `commentTitle`, `postTitle`, `queryTitle`, `archiveTitle`.

### Enhancement
- Update the `title` icon to match g2 design language. ([#40596](https://github.com/WordPress/gutenberg/pull/40596))

## 8.4.0 (2022-05-04)

## 8.3.0 (2022-04-21)
Expand Down
4 changes: 0 additions & 4 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export { default as alignLeft } from './library/align-left';
export { default as alignNone } from './library/align-none';
export { default as alignRight } from './library/align-right';
export { default as archive } from './library/archive';
export { default as archiveTitle } from './library/archive-title';
export { default as arrowDown } from './library/arrow-down';
export { default as arrowLeft } from './library/arrow-left';
export { default as arrowRight } from './library/arrow-right';
Expand Down Expand Up @@ -54,7 +53,6 @@ export { default as commentAuthorName } from './library/comment-author-name';
export { default as commentContent } from './library/comment-content';
export { default as commentReplyLink } from './library/comment-reply-link';
export { default as commentEditLink } from './library/comment-edit-link';
export { default as commentTitle } from './library/comment-title';
export { default as cover } from './library/cover';
export { default as create } from './library/create';
export { default as crop } from './library/crop';
Expand Down Expand Up @@ -167,7 +165,6 @@ export { default as postDate } from './library/post-date';
export { default as postExcerpt } from './library/post-excerpt';
export { default as postFeaturedImage } from './library/post-featured-image';
export { default as postList } from './library/post-list';
export { default as postTitle } from './library/post-title';
export { default as postTerms } from './library/post-terms';
export { default as previous } from './library/previous';
export { default as next } from './library/next';
Expand All @@ -179,7 +176,6 @@ export { default as queryPagination } from './library/query-pagination';
export { default as queryPaginationNext } from './library/query-pagination-next';
export { default as queryPaginationNumbers } from './library/query-pagination-numbers';
export { default as queryPaginationPrevious } from './library/query-pagination-previous';
export { default as queryTitle } from './library/query-title';
export { default as quote } from './library/quote';
export { default as receipt } from './library/receipt';
export { default as redo } from './library/redo';
Expand Down
12 changes: 0 additions & 12 deletions packages/icons/src/library/archive-title.js

This file was deleted.

12 changes: 0 additions & 12 deletions packages/icons/src/library/comment-title.js

This file was deleted.

12 changes: 0 additions & 12 deletions packages/icons/src/library/post-title.js

This file was deleted.

12 changes: 0 additions & 12 deletions packages/icons/src/library/query-title.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/icons/src/library/title.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SVG, Path } from '@wordpress/primitives';

const title = (
<SVG xmlns="https://www.w3.org/2000/svg" viewBox="0 0 24 24">
<Path d="M5 4v3h5.5v12h3V7H19V4H5z" />
<Path d="M4 5.417h2.267V12h1.466V5.417H10V4H4v1.417ZM20 16H4v-1.5h16V16Zm-7 4H4v-1.5h9V20Z" />
</SVG>
);

Expand Down

0 comments on commit 50ecf57

Please sign in to comment.