-
Notifications
You must be signed in to change notification settings - Fork 141
Change seamless panels to inherit any parent's colours #2501
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
Changes from all commits
c7c878d
e2f6301
2f17992
6ba4c0c
d895984
d3e94a0
5c2d1c6
bb35d7b
c167f97
1ade57e
37cae18
e146ad1
a721356
53b71ff
4748e3f
fb5fc71
ff72dbd
9c0752d
578f815
057643e
bc09c01
f0d06b1
1f62ad3
b075167
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,13 @@ | |
| :class="['card-container', addClass]" | ||
| > | ||
| <span class="morph"> | ||
| <button :class="['morph-display-wrapper', 'btn', btnType]" @click="open()"> | ||
| <button | ||
| :class="['morph-display-wrapper', | ||
| {'morph-display-wrapper-seamless': isSeamless}, | ||
| 'btn', | ||
| btnType]" | ||
| @click="open()" | ||
| > | ||
| <div | ||
| v-if="!noMinimizedSwitch" | ||
| class="minimal-caret-wrapper" | ||
|
|
@@ -27,7 +33,7 @@ | |
| ref="cardContainer" | ||
| :class="['card-container', addClass]" | ||
| > | ||
| <div :class="['card', { 'expandable-card': isExpandableCard }, borderType]"> | ||
| <div :class="['card', { 'expandable-card': isExpandableCard, 'card-seamless': isSeamless }, borderType]"> | ||
| <div | ||
| :class="['card-header',{'header-toggle':isExpandableCard}, cardType, borderType]" | ||
| @click.prevent.stop="isExpandableCard && toggle()" | ||
|
|
@@ -40,8 +46,8 @@ | |
| </div> | ||
| <div | ||
| ref="headerWrapper" | ||
| :class="['header-wrapper card-title', cardType, | ||
| {'text-white':!isLightBg, 'header-transparent':!shouldShowHeader}]" | ||
| :class="[{'header-wrapper-seamless': isSeamless}, 'header-wrapper card-title', cardType, | ||
| {'text-white':!isLightBg && !isSeamless, 'header-transparent':!shouldShowHeader}]" | ||
| > | ||
| <slot name="header"></slot> | ||
| </div> | ||
|
|
@@ -96,6 +102,7 @@ | |
| <panel-switch | ||
| v-show="isExpandableCard && bottomSwitchBool" | ||
| :is-open="localExpanded" | ||
| :is-seamless="isSeamless" | ||
| @click.native.stop.prevent="toggle(true)" | ||
| /> | ||
| </div> | ||
|
|
@@ -133,8 +140,10 @@ export default { | |
| return this.type === 'seamless'; | ||
| }, | ||
| btnType() { | ||
| if (this.isSeamless || this.type === 'light') { | ||
| if (this.type === 'light') { | ||
| return 'btn-outline-secondary'; | ||
| } else if (this.isSeamless) { | ||
| return ''; | ||
| } | ||
| return `btn-outline-${this.type || 'secondary'}`; | ||
| }, | ||
|
|
@@ -151,12 +160,12 @@ export default { | |
| }, | ||
| cardType() { | ||
| if (this.isSeamless) { | ||
| return 'bg-white'; | ||
| return 'bg-transparent'; | ||
| } | ||
| return `bg-${this.type || 'light'}`; | ||
| }, | ||
| isLightBg() { | ||
| return this.cardType === 'bg-light' || this.cardType === 'bg-white' || this.cardType === 'bg-warning'; | ||
| return this.cardType === 'bg-light' || this.cardType === 'bg-warning'; | ||
| }, | ||
| }, | ||
| }; | ||
|
|
@@ -175,6 +184,13 @@ export default { | |
| .seamless-button { | ||
| opacity: 0; | ||
| transition: 0.3s opacity; | ||
| color: inherit; | ||
| border-color: inherit; | ||
| } | ||
|
|
||
| .seamless-button:hover { | ||
| border-color: transparent; | ||
| background-color: color-mix(in srgb, currentcolor 25%, transparent); | ||
| } | ||
|
|
||
| .card-header:hover .seamless-button { | ||
|
|
@@ -229,6 +245,10 @@ export default { | |
| width: 100%; | ||
| } | ||
|
|
||
| .card-seamless { | ||
| background-color: inherit; | ||
| } | ||
|
|
||
| .card-title { | ||
| display: inline-block; | ||
| font-size: 1em; | ||
|
|
@@ -279,6 +299,8 @@ export default { | |
|
|
||
| .card-collapse > hr { | ||
| margin-top: 0; | ||
| background-color: currentcolor; | ||
| opacity: 0.5; | ||
|
yucheng11122017 marked this conversation as resolved.
|
||
| } | ||
|
|
||
| .card-group > .card-container > .expandable-card { | ||
|
|
@@ -292,7 +314,7 @@ export default { | |
|
|
||
| .bottom-button-wrapper > .collapse-button { | ||
| margin-top: 5px; | ||
| opacity: 0.2; | ||
| opacity: 0.5; | ||
| } | ||
|
|
||
| .bottom-button-wrapper > .collapse-button:hover { | ||
|
|
@@ -324,6 +346,14 @@ export default { | |
| align-items: center; | ||
| } | ||
|
|
||
| .morph-display-wrapper-seamless { | ||
| color: inherit; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the difference between
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep sorry about that, I have made the changes accordingly
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:hover { | ||
| color: inherit; | ||
| } | ||
|
|
||
| /* Bootstrap extra small(xs) responsive breakpoint */ | ||
| @media (width <= 575.98px) { | ||
| .header-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.
Shouldn't this button has the
morph-display-wrapperanyway 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-seamlesssince I've noticed that the colour of the minimized panels would not inherit the parent's colour with justmorph-display-wrapperWith just
morph-display-wrapper:Screen.Recording.2024-04-09.at.11.30.27.PM.mov
With
morph-display-wrapper-seamlessandmorph-display-wrapperScreen.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 frommorph-display-wrapperThere 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-wrapperby default and then only seamless buttons will havemorph-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