Skip to content

Fix IconButton indent regression#5324

Merged
jasmussen merged 1 commit intomasterfrom
fix/icon-button-regression
Mar 1, 2018
Merged

Fix IconButton indent regression#5324
jasmussen merged 1 commit intomasterfrom
fix/icon-button-regression

Conversation

@jasmussen
Copy link
Copy Markdown
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
@jasmussen jasmussen requested review from aduth and youknowriad March 1, 2018 08:02
onClick={ () => onInsert( item ) }
label={ sprintf( __( 'Add %s' ), item.title ) }
icon={ (
<span className="editor-inserter-with-shortcuts__block-icon">
Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants