-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat(cxl-ui): cxl-featured-image add component #413
Conversation
size-limit report 📦
|
:host { | ||
position: relative; | ||
display: block; | ||
min-width: 360px; |
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.
min-width: 360px; | |
min-width: 320px; |
At the same time I'm wondering whether it even needs min-width
. It's block element which means it's 100% wide by default. And on screens smaller than 360 it causes horizontal scrollbar.
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.
Since the element technically doesn't have any content(only a background), without setting a minimum width, it collapses to 0.
One more thing, it should be visible on mobile only. Now question is whether it's better to encapsulate visibility inside the component or control it with external CSS. I don't know the answer yet |
The correct way would be to do it from the outside, though it wouldn't be a big deal taking a shortcut here. |
:host { | ||
position: relative; | ||
display: block; | ||
min-width: 320px; |
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.
bottom: 0; | ||
width: 100%; | ||
height: 75%; | ||
background-color: var(--cxl-featured-image-bg-color, var(--cxl-brand-color-black, rgb(26, 26, 26))); |
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.
We do not have --cxl-featured-image-bg-color
defined anywhere so component background color is not compatible with what we see on the desktop.
What about refactoring this code:
aybolit/packages/cxl-ui/scss/cxl-section.scss
Lines 119 to 147 in 22f6225
:host(.wide-background-black) { | |
&::before { | |
background-color: var(--cxl-brand-color-black); | |
} | |
} | |
:host(.wide-background-red) { | |
&::before { | |
background-color: var(--lumo-primary-color); | |
} | |
} | |
:host(.wide-background-blue) { | |
&::before { | |
background-color: var(--cxl-brand-color-blue); | |
} | |
} | |
:host(.wide-background-light-blue) { | |
&::before { | |
background-color: var(--cxl-brand-color-light-blue); | |
} | |
} | |
:host(.wide-background-green) { | |
&::before { | |
background-color: var(--cxl-brand-color-green); | |
} | |
} |
We could set variable value instead of explicit background color value. Doable @anoblet?
One more thing needed
|
|
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.
Good approach. Just two things to fix. Please also squash all commits into one
|
||
:host(.red) { | ||
#container { | ||
background-color: var(--cxl-brand-color-red); |
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.
@property({ type: String }) src = | ||
'https://ebpyu8ye7bj.exactdn.com/institute/wp-content/uploads/2023/12/ben-labay_team_headshot-1x1-bw-min-fix-min-compressed.png?strip=all&lossy=1&fit=720%2C720&ssl=1'; |
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 need to set default image. Especially with such URL. Keep it empty.
fa456ce
to
ac0ca62
Compare
ac0ca62
to
b3de6c6
Compare
https://app.clickup.com/t/86b0647n0