-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from cchaos/am/updating-buttons
Figuring out a better way to override
- Loading branch information
Showing
13 changed files
with
148 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 5 additions & 56 deletions
61
src/themes/eui-amsterdam/global_styling/mixins/_button.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,18 @@ | ||
@mixin euiButton { | ||
@include euiButtonBase; | ||
@include euiFont; | ||
@include euiFontSize; | ||
|
||
display: inline-block; | ||
appearance: none; | ||
cursor: pointer; | ||
height: $euiButtonHeight; | ||
line-height: $euiButtonHeight; // prevents descenders from getting cut off | ||
font-weight: $euiFontWeightMedium; | ||
text-decoration: none; | ||
border: none; | ||
text-align: center; | ||
transition: all $euiAnimSpeedNormal $euiAnimSlightBounce; | ||
white-space: nowrap; | ||
max-width: 100%; | ||
vertical-align: middle; | ||
font-weight: $euiFontWeightMedium; | ||
|
||
&:hover:not(:disabled) { | ||
transform: translateY(-1px); | ||
} | ||
// sass-lint:disable mixins-before-declarations | ||
// focus states should come after all default styles | ||
@include euiButtonFocus; | ||
|
||
&:hover:not(:disabled), | ||
&:focus { | ||
text-decoration: underline; | ||
} | ||
|
||
&:focus { | ||
animation: euiButtonActive $euiAnimSpeedNormal $euiAnimSlightBounce; | ||
} | ||
|
||
&:active:not(:disabled) { | ||
transform: translateY(1px); | ||
} | ||
} | ||
|
||
// 1. Apply margin to all but last item in the flex. | ||
// 2. Margin gets flipped because of the row-reverse. | ||
|
||
@mixin euiButtonContent($isReverse: false) { | ||
height: 100%; | ||
width: 100%; | ||
vertical-align: middle; | ||
|
||
.euiButton__icon, | ||
.euiButton__spinner { | ||
flex-shrink: 0; // Ensures the icons/spinner don't scale down below their intended size | ||
} | ||
|
||
@if ($isReverse) { | ||
flex-direction: row-reverse; | ||
|
||
> * + * { | ||
margin-left: 0; // 1, 2 | ||
margin-right: $euiSizeS; // 1, 2 | ||
} | ||
} @else { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
> * + * { | ||
margin-left: $euiSizeS; // 1 | ||
} | ||
} | ||
} | ||
|
||
// Keyframe animation declarations can be found in | ||
// utility/animations.scss |
Oops, something went wrong.