Changing the way EuiCard inherits EuiPanel#415
Merged
cchaos merged 7 commits intoelastic:masterfrom Feb 16, 2018
Merged
Conversation
added 4 commits
February 15, 2018 14:18
Having EuiPanel > EuiCard doesn’t work because it still needs `display: flex` on EuiPanel but the order in which the SASS files are loaded doesn’t allow for EuiCard styles to override EuiPanel.
This reverts commit d980560.
EuiPanel now has a mixin that can be used by any component. EuiCard uses this mixin to inherit the styles of EuiPanel but doesn’t have specificity/order issues.
added 2 commits
February 15, 2018 15:54
cjcenizal
approved these changes
Feb 16, 2018
Contributor
cjcenizal
left a comment
There was a problem hiding this comment.
LGTM just had a couple thoughts
src/components/card/_card.scss
Outdated
| overflow: hidden; | ||
| padding: $euiCardSpacing; | ||
|
|
||
| > * { |
Contributor
There was a problem hiding this comment.
Can we avoid this by putting these styles on the descendent classes themselves, e.g. euiCard__top, euiCard__content and euiCard__footer? I used to love doing stuff like this but I have always ended up regretting it.
src/components/card/card.js
Outdated
| } | ||
|
|
||
| const OuterElement = onClick ? 'button' : 'div'; | ||
| const InnerElement = onClick ? 'span' : 'div'; |
Contributor
There was a problem hiding this comment.
Why not just leave this a span in all cases?
| * - EuiCard | ||
| */ | ||
| @mixin euiPanel($selector){ | ||
| @if variable-exists(selector) == false { |
Contributor
There was a problem hiding this comment.
This is really neat, I've never seen this sort of mixin before in Sass. TIL.
Contributor
Author
There was a problem hiding this comment.
Yeah I'm trying to get better at writing error messages for Sass
snide
approved these changes
Feb 16, 2018
Spans always and no universal selector
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EuiPanel now has a mixin that can be used by any component. EuiCard uses this mixin to inherit the styles of EuiPanel but doesn’t have specificity/order issues.
Fixes #408
