-
Notifications
You must be signed in to change notification settings - Fork 132
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
Change seamless panels to inherit any parent's colours #2501
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2501 +/- ##
==========================================
+ Coverage 50.99% 51.02% +0.02%
==========================================
Files 124 124
Lines 5383 5372 -11
Branches 1160 1159 -1
==========================================
- Hits 2745 2741 -4
+ Misses 2348 2341 -7
Partials 290 290 ☔ View full report in Codecov by Sentry. |
Idk how my other allocate space for scrollbar commit got here 😞 but the changed files only reflect the changes relevant to this pr! |
Weird that the netlify deploy preview failed. Maybe it will fix itself on push |
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 @jingting1412 thanks for the work!
Functionality and all looks great - just some minor nits.
Could you also add some test cases for this behaviour? I think you should be able to add unit tests without too much issue
docs/userGuide/syntax/panels.md
Outdated
@@ -104,6 +104,29 @@ plain text ... | |||
</variable> | |||
</include> | |||
|
|||
<box> |
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.
TBH i think this is too much documentation and examples.. I would rather just keep one, preferably the first because the other two are very blinding and I am old.
In fact... I'm a bit tempted to not have documentation for this because I feel like its too small and specific feature. What do the rest of the reviewers think?
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.
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.
Yep I just left one example on the user guide so that user is at least aware of this property of seamless panels. Please tell me if the colour combo is not nice 😅
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.
Colour looks good to me : )
margin-top: 5px; | ||
display: flex; | ||
align-items: center; | ||
color: inherit; |
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.
Is the difference between .morph-display-wrapper-seamless
and .morph-display-wrapper
only the inheritance of color?
In that case, could we make it such that .morph-display-wrapper-seamless
is just color: inherit
? So that if we decide to change like the margin-top or something, we only change it in one place
So the button will always have the class .morph-display-wrapper
and will have the class .morph-display-wrapper-seamless
if it is seamless
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.
Yep sorry about that, I have made the changes accordingly
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've changed it now so that both the seamless and non-seamless morph wrapper would share the same basic styles, and only morph-display-wrapper-seamless
will have the color:inherit
property. This allows for future changes to the styles of all morph wrappers to be done in one place and allows the seamless wrapper to have the same styles as the other wrappers
docs/userGuide/syntax/panels.md
Outdated
|
||
:bulb: Seamless panels inherit the background colour and text colour of any parents! | ||
<br/> | ||
<panel type="seamless" header="This is an example seamless panel" popup-url="/userGuide/syntax/extra/loadContent.html"> |
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.
Why the popup-URL ?
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'm just making sure that all buttons follow the seamless behaviour when testing, I'll remove from the final example!
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.
Small nit!
<button :class="['morph-display-wrapper', 'btn', btnType]" @click="open()"> | ||
<button | ||
:class="[isSeamless ? 'morph-display-wrapper-seamless': 'morph-display-wrapper', | ||
'btn', |
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.
Shouldn't this button has the morph-display-wrapper
anyway regardless of whether it is seamless or not?
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 added the new morph-display-wrapper-seamless
since I've noticed that the colour of the minimized panels would not inherit the parent's colour with just morph-display-wrapper
With just morph-display-wrapper
:
Screen.Recording.2024-04-09.at.11.30.27.PM.mov
With morph-display-wrapper-seamless
and morph-display-wrapper
Screen.Recording.2024-04-09.at.11.32.06.PM.mov
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.
As in does the a seamless button also need the properties from morph-display-wrapper
?
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.
No seamless buttons wouldn't need properties from morph-display-wrapper
, seamless buttons only appear when the panel is not minimised so it shouldn't need any properties from morph-display-wrapper
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've taken a video for your reference that shows that toggling these properties would make a visual difference. The caret button seems to also be a seamless button which appears when the panel is minimised, so the non seamless panels and the seamless panels then have slightly different styling due to this line of code.
Screen.Recording.2024-04-12.at.7.54.19.PM.mov
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.
Rather than doing this or else statement, could all buttons have morph-display-wrapper
by default and then only seamless buttons will have morph-display-wrapper-seamless
?
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.
yep sure I've implemented it as such 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.
LGTM except for one small clarification!
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.
LGTM!
* Change seamless panels * Improve look of seamless panels * Add tests * Update userguide example --------- Co-authored-by: Chan Yu Cheng <[email protected]> Co-authored-by: Hannah <[email protected]>
Feature in action https://nus-cs2103-ay2324s2.github.io/website/schedule/week8/topics.html |
What is the purpose of this pull request?
Overview of changes:
#1697
Changed the seamless panels so that the background is transparent and it inherits the colours of any parents its contained in.
Anything you'd like to highlight/discuss:
As pointed out in the issue, this might break some edge cases (e.g. a seamless panel in a
<box background-color="black" color="black">
box).Testing instructions:
I've added some examples in the userguide to show the new look.
markbind serve -d
the docs to see the changes and try out different cases to see if it works or if there's any improvements.Proposed commit message: (wrap lines at 72 characters)
Change seamless panels to inherit colours of any parents
Checklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major
,r.Minor
,r.Patch
.Breaking change release note preparation (if applicable):