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

Fix IconButton indent regression #5324

Merged
merged 1 commit into from Mar 1, 2018
Merged

Conversation

jasmussen
Copy link
Contributor

Yesterday I merged a fix to the IconButton component which adds a text-indent for when the component has text. This works because the SVG inside is not affected by text-indent.

But the quick-shortcuts in the block appender wrap this icon with a span, which is affected by the text-indent.

I can look for other solutions that do not rely on text-indent, but simply removing this span entirely seems to have no negative effects. Why was it added? No CSS appears to target the element.

In master:

screen shot 2018-03-01 at 08 58 38

In this branch:

screen shot 2018-03-01 at 08 59 15

Yesterday I merged a fix to the IconButton component which adds a `text-indent` for when the component has text. This works because the SVG inside is not affected by text-indent.

But the quick-shortcuts in the block appender wrap this icon with a `span`, which _is_ affected by the text-indent.

I can look for other solutions that do not rely on text-indent, but simply removing this span entirely seems to have no negative effects. Why was it added? No CSS appears to target the element.
@jasmussen jasmussen added the [Type] Bug An existing feature does not function as intended label Mar 1, 2018
@jasmussen jasmussen self-assigned this Mar 1, 2018
@@ -43,9 +43,7 @@ function InserterWithShortcuts( { items, isLocked, onToggle, onInsert } ) {
onClick={ () => onInsert( item ) }
label={ sprintf( __( 'Add %s' ), item.title ) }
icon={ (
<span className="editor-inserter-with-shortcuts__block-icon">
Copy link
Contributor

Choose a reason for hiding this comment

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

I recall this span being added because of blocks with custom SVG icons but I think it's not necessary anymore because we don't mix text and icons in the same button like we used to do and this is taken care of at the IconButton level.

@jasmussen jasmussen merged commit 7109a87 into master Mar 1, 2018
@jasmussen jasmussen deleted the fix/icon-button-regression branch March 1, 2018 08:20
@jasmussen
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants