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): improvised styling #137

Merged
merged 12 commits into from
Mar 3, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
variant="text"
size="mini"
icon="nucleus-cross"
iconOnly=true
onClick=(action banner.close)}}
</div>
{{/nucleus-inline-banner}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
customClass=(concat "nucleus-banner-item__close")
icon="nucleus-cross"
iconSize="mini"
iconOnly=true
onClick=(action "onClose" item)}}
{{/if}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/button/addon/components/nucleus-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class NucleusButton extends Component {
@computed('iconSize', 'size')
get _iconSize() {
let iconSize = this.get('iconSize');
let defaultSize = this.get('size') ? this.get('size') : 'medium';
let defaultSize = this.get('size') ? this.get('size') : 'small';
return iconSize ? iconSize : defaultSize;
}

Expand Down
9 changes: 7 additions & 2 deletions packages/button/addon/styles/components/_nucleus-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ $active-box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, .25);

.nucleus-button {
font-size: $font-size-14;
vertical-align: middle;
line-height: 1.2;
padding: 6px 12px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid transparent;
border-radius: 4px;
outline: 0;
Expand All @@ -38,9 +42,10 @@ $active-box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, .25);
min-width: 80px;

&__icon {
display: inherit;

&.nucleus--active {
position: relative;
top: .125em;
margin-right: 4px;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#if icon}}
<span class="nucleus-button__icon {{unless iconOnly "nucleus--active"}}">
{{nucleus-icon name=icon size=_iconSize}}
{{nucleus-icon name=icon size=_iconSize variant=_iconVariant}}
</span>
{{/if}}
{{#if (and _isLoading _isShowLoading)}}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module('Integration | Component | nucleus-button', function(hooks) {
});

test('it with icon property shows icon', async function(assert) {
await render(hbs`{{nucleus-button icon="nucleus-cross"}}`);
await render(hbs`{{nucleus-button icon="nucleus-cross" iconOnly=true}}`);

assert.dom('button svg').hasClass('nucleus-icon', 'svg icon is rendered');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
variant="text"
size="mini"
icon="nucleus-cross"
iconOnly=true
onClick=(action "onCloseTip")}}
</div>
{{/if}}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
customClass=(concat "nucleus-modal__close " position)
icon="nucleus-cross"
iconSize="mini"
iconOnly=true
onClick=(action onClose)}}
{{/if}}
{{/if}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
size="mini"
customClass=(concat "flash-message-close")
icon="nucleus-cross"
iconOnly=true
onClick=(action close)}}
</div>
{{/flash-message}}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.