Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
fix(button): follow core Carbon icon positioning (#697)
Browse files Browse the repository at this point in the history
* fix(button): follow core Carbon icon positioning

* fix(button): add custom styles for ghost variants

* fix(button): support condensed layout

* fix(button): update ghost button styles

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
emyarod and kodiakhq[bot] authored Sep 13, 2021
1 parent 14c6bb2 commit db4e4c1
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,36 @@ $css--plex: true !default;
max-width: 100%;
}

.#{$prefix}-ce--btn--has-icon {
padding-right: 12px;
}

::slotted([slot='icon']) {
fill: currentColor;
margin-left: calc(#{rem(60px)} - #{$spacing-04} - #{$icon-size-01});
position: absolute;
right: rem(16px);
flex-shrink: 0;
}

&[isExpressive] ::slotted([slot='icon']) {
width: rem(20px);
height: rem(20px);
}

&[icon-layout='condensed'] ::slotted([slot='icon']) {
margin-left: $spacing-03;
&[icon-layout='condensed'] .#{$prefix}--btn {
padding-right: rem(39px);
}

.#{$prefix}--btn--icon-only ::slotted([slot='icon']) {
margin-left: 0;
position: static;
}

&[kind='ghost'],
&[kind='danger-ghost'] {
::slotted([slot='icon']) {
position: static;
margin-left: rem(8px);
}

&[icon-layout='condensed'] .#{$prefix}--btn {
padding-right: rem(16px);
}
}
}

Expand Down

0 comments on commit db4e4c1

Please sign in to comment.