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(button): Patch for IE 11 helpkit-ember buttons #134

Merged
merged 9 commits into from
Feb 25, 2020

Conversation

sharath-sriram
Copy link
Contributor

@sharath-sriram sharath-sriram commented Feb 24, 2020

This is a quick fix to patch the buttons appearance wrt to icons and on IE 11.

Changes:

  1. Changed iconSize default to medium
  2. Added a span class nucleus-button__icon that enforces a top value to make the icon aligned with text. (Happens only for non-iconOnly buttons)
  3. Changed line-height to 1.2 (except for "mini" buttons which stay on a line-height 1)

@shibulijack-fd shibulijack-fd added the bug Something isn't working label Feb 24, 2020
{{else}}
<span class="icon-holder">
{{nucleus-icon name=icon size=_iconSize}}
</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Refactor this piece of code such that there's only one nucleus-icon invocation. Perhaps always have the span class icon-holder with an optional .active class based on iconOnly property.

@@ -37,6 +37,11 @@ $active-box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, .25);
height: 32px;
min-width: 80px;

& .icon-holder {
Copy link
Contributor

Choose a reason for hiding this comment

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

Follow BEM conventions.
http://getbem.com/naming/

@@ -37,6 +37,11 @@ $active-box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, .25);
height: 32px;
min-width: 80px;

& .nucleus-button__icon.active {
Copy link
Contributor

Choose a reason for hiding this comment

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

.nucleus-button is redundant. Check how this can be simplified using SCSS.

@@ -1,4 +1,8 @@
{{#if icon}}{{nucleus-icon name=icon size=_iconSize}}{{/if}}
{{#if icon}}
<span class="nucleus-button__icon {{unless iconOnly "active"}}">
Copy link
Contributor

Choose a reason for hiding this comment

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

A class named active is quite common and the consuming apps might override our styles. So can we make this class a little more nucleus specific?

@shibulijack-fd shibulijack-fd merged commit 0d7be8a into master Feb 25, 2020
@shibulijack-fd shibulijack-fd deleted the button-patch branch February 25, 2020 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants