Skip to content

Commit

Permalink
fix(core/button): add space between leading icon and text (#149)
Browse files Browse the repository at this point in the history
Co-authored-by: PhentomPT <phentom.net@gmail.com>
Co-authored-by: Lukas Maurer <lukas.maurer@siemens.com>
  • Loading branch information
3 people committed Nov 20, 2022
1 parent 0e0e669 commit 8392ef6
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/core/scss/components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
transition: $default-time;
padding: 0 $small-space;
min-width: 5rem;
gap: $tiny-space;

@include ellipsis;

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/breadcrumb/breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
}

.crumb-text + .glyph-chevron-right-small {
margin-inline-start: $small-space;
margin-inline-start: $tiny-space;
margin-inline-end: 0; // Overwrite global selector: .btn .glyph
}

Expand Down
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.
16 changes: 12 additions & 4 deletions packages/core/src/components/button/base-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ const isSecondary = (variant: string) => {
return variant.toUpperCase() === 'Secondary'.toUpperCase();
};

export const getButtonClasses = (variant: 'Primary' | 'Secondary', outline: boolean, ghost: boolean, iconOnly = false, iconOval = false, selected: boolean, disabled: boolean) => {
export const getButtonClasses = (
variant: 'Primary' | 'Secondary',
outline: boolean,
ghost: boolean,
iconOnly = false,
iconOval = false,
selected: boolean,
disabled: boolean
) => {
return {
'btn': true,
btn: true,
'btn-primary': isPrimary(variant) && !outline && !ghost,
'btn-outline-primary': isPrimary(variant) && outline && !ghost,
'btn-invisible-primary': isPrimary(variant) && !outline && ghost,
Expand All @@ -26,7 +34,7 @@ export const getButtonClasses = (variant: 'Primary' | 'Secondary', outline: bool
'btn-invisible-secondary': isSecondary(variant) && !outline && ghost,
'btn-icon': iconOnly,
'btn-oval': iconOval,
'selected': isSecondary(variant) && (outline || ghost) && selected,
'disabled': disabled,
selected: isSecondary(variant) && (outline || ghost) && selected,
disabled: disabled,
};
};
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.

0 comments on commit 8392ef6

Please sign in to comment.