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

Unify styling of widget action icons #8064

Merged
merged 9 commits into from Jun 4, 2020
Merged

Unify styling of widget action icons #8064

merged 9 commits into from Jun 4, 2020

Conversation

linuspahl
Copy link
Contributor

This PR unifies the widget action icons styling by implementing an IconButton component.
This includes styling the hover / focus state, adding titles, and refactoring the widget actions bar grid.

Before:
image

After:
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.


IconButton.propTypes = {
title: PropTypes.string,
onClick: PropTypes.func,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I considered requiring the onClick prop, but e.g. in ReplaySearchButton we need to wrap the button with a link, because we can't open the page in another tab with history.push()

@kmerz
Copy link
Member

kmerz commented May 27, 2020

Looks a bit different then how you described it. I like it, let's discuss it.

Graylog (1)

@linuspahl
Copy link
Contributor Author

@kmerz Looks like this is happening with Firefox, because of the user agent stylesheet. For now I removed the background color, but I am still open for a discussion.

I prefer not displaying a background color, because currently the focus is on the widgets content when having a look at a widget grid. A background color would slightly attract this focus, in my opinion.

* Unify styling by implementing IconButton component
* Add titles
* Refactor widget actions toolbar grid
… to avoid eslint-disable for dependency cycles
@kmerz
Copy link
Member

kmerz commented Jun 4, 2020

Fat border after clicking:
Graylog (4)

Copy link
Member

@kmerz kmerz left a comment

Choose a reason for hiding this comment

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

All outlines are beautiful!

Thanks a lot for this! 👍

@kmerz kmerz merged commit 16dcccc into master Jun 4, 2020
@kmerz kmerz deleted the icon-button branch June 4, 2020 13:29
linuspahl added a commit that referenced this pull request Jun 11, 2020
* Unify widget action buttons styling
* Unify styling by implementing IconButton component
* Add titles
* Refactor widget actions toolbar grid

* Update snapshot

* Remove not needed link role

* Disable eslint warning for IconButton and PageErrorOverview dependecy cycles in common components index file

* Import common components directly in PageErrorOverview and IconButton to avoid eslint-disable for dependency cycles

* Remove background color of IconButtons for Firefox

* Update snapshots

* Add missing semicolon in Widget.jsx

* Updating snapshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants