-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add options to configure thumbnail alignment #706
Add options to configure thumbnail alignment #706
Conversation
@MisRob and @AlexVelezLl -Noting that Support for RTL will be address separately #665 |
Hi @AllanOXDi, I'd like to suggest one update that will help with the following
I think something similar to the following could help to open it up and make a bit clearer as well:
This ensures all thumbnail layouts have information on what alignment we've chosen.
If you can think about further improvements, I welcome them, this is one of the approaches I could think of right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to have this variation in the documentation too, showing some examples. What do you think? @AllanOXDi @MisRob
- (1) Intentionally fixed. Cards on the same row of a grid should have the same overall height and their sections too should have the same height so that information is placed consistently. As documented, consumers need to ensure that contents provided via slots fits well or is truncated. | ||
- (2) Solves issues with fixed height in a flex item | ||
*/ | ||
Just couple of comments that are referenced from several places: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if are these extra spaces enforced by the linter? 😅
6b0a82c
to
ec76ff6
Compare
@AllanOXDi I think this looks better now, thank you. I appreciate you simplified my original suggestion even further 👍 Let's just finish cleanup of the previous implementation. |
|
@AllanOXDi [required] I've just noticed that the thumbnail alignment still doesn't take effect for the horizontal layout with the small thumbnail which is expected behavior. Using the approach you've chosen
we can achieve that by
I think this is a nice merging of both approaches that will most importantly resolve the remaining issue for small thumbnail. Additionally, keeping everything in After this is setup, you can add new styles for
|
Hi @MisRob ,just noting that the |
Also, I have added a few different layouts on the playground for testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AllanOXDi, good progress! I think we're almost there. Left a few minor cleanup comments. There's only two changes I consider required:
- (1) The spacer value regression - however if we revert here, I think the issue it attempted to solve could be addressed in another PR since it's not related to thumbnails
- (2) Not mixing two techniques to achieve left/right alignment of slots. We can simply utilize flex features for aligning items as that's what is already in place. Overriding it with margins is not needed and on some occasions it creates conflicting or unnecessary styles. Not that using the margins technique would be generally bad - it's definitely valid one! My concern is about not mixing the two approaches. Let me know if you wanted to chat or had questions.
I think after this is done, all should be in place for merge.
lib/KCard/index.vue
Outdated
@@ -194,7 +220,7 @@ | |||
*/ | |||
stylesAndClasses() { | |||
/* In px. Needs to be the same as $spacer variable in styles part */ | |||
const SPACER = 24; | |||
const SPACER = 12; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[required] Was the change from 24 to 12 intentional? I think we will need to keep it due #709.
If this was part of the fix related to the lack of space on cards, that could be fixed by increasing the overall height in all layouts where it's needed. The overall heights are defined in the css part, for example:
.horizontal-with-large-thumbnail {
...
height: 240px;
...
Same applies to $spacer
.
I think it'd be fine to revert to 24 in this PR and then do the height fix in a follow-up PR if it'd be better, feel free to decide.
lib/KCard/index.vue
Outdated
@@ -205,10 +231,19 @@ | |||
height: '100%', | |||
}; | |||
|
|||
const titleAlignStyle = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[required] I believe that titleAlignStyle
can be removed completely after you utilize switching between flex-end
and flex-start
. Explained in mode detail in other comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need still need this to handle switching between the title.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response here #706 (comment)
Yes, thank you! I think this was my oversight, I don't know why I did it honestly. |
This helps a lot - thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! Good to go :)
I am observing two issues on the playground page, none of them blocking and even related to this work so I will open follow-ups later on.
Description
This PR introduces a new
thumbnailAlign
prop to the KCard component, enabling developers to configure the alignment of the thumbnail area within the card. This newthumbnailAlign
prop accepts 'left' and 'right' values, and it decides on which side is the thumbnail area displayed, particularly in the horizontal layout.Issue addressed
#706
With the left and right align options
Changelog
[#706]
KCard
KCard
[Add options to configure thumbnail alignment #706]: Add options to configure thumbnail alignment #706
Testing checklist
Reviewer guidance
After review
CHANGELOG.md
Comments