-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try: Overlay caption w. text-shadow. #63471
Changes from 5 commits
01e744b
9b62ee9
5f3d3a9
4ca916c
a489d99
2cc9623
171f791
f8cf8e0
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 | ||||
---|---|---|---|---|---|---|
|
@@ -43,22 +43,46 @@ figure.wp-block-gallery.has-nested-images { | |||||
width: auto; | ||||||
} | ||||||
|
||||||
// Position caption and scrim at the bottom. | ||||||
&:has(figcaption)::before, | ||||||
figcaption { | ||||||
background: linear-gradient(0deg, rgba($color: $black, $alpha: 0.7) 0, rgba($color: $black, $alpha: 0.3) 70%, transparent); | ||||||
position: absolute; | ||||||
bottom: 0; | ||||||
right: 0; | ||||||
left: 0; | ||||||
max-height: 100%; | ||||||
} | ||||||
|
||||||
// Create a background blur layer. | ||||||
&:has(figcaption)::before { | ||||||
content: ""; | ||||||
z-index: 0; | ||||||
height: 100%; | ||||||
max-height: 40%; | ||||||
|
||||||
// Blur the background under the gradient scrim. | ||||||
backdrop-filter: blur(4px); | ||||||
|
||||||
// Crop the caption so the blur is only on the edge. | ||||||
mask-image: linear-gradient(0deg, rgba($color: $black, $alpha: 1) 20%, rgba($color: $black, $alpha: 0) 100%); | ||||||
jasmussen marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
} | ||||||
|
||||||
// Place the caption at the bottom. | ||||||
figcaption { | ||||||
z-index: 1; | ||||||
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. There doesn't seem to be any visual difference without 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. Good catch on both z-indexes. They were briefly necessary in one of the versions I was testing, but in this final version they are not. |
||||||
color: $white; | ||||||
text-shadow: 0 0 1.5px rgba($color: $black, $alpha: 1); | ||||||
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.
Suggested change
Since |
||||||
font-size: $default-font-size; | ||||||
left: 0; | ||||||
margin-bottom: 0; | ||||||
max-height: 60%; | ||||||
margin: 0; | ||||||
overflow: auto; | ||||||
padding: 0 8px 8px; | ||||||
position: absolute; | ||||||
padding: 1em; | ||||||
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. This is a non-blocker suggestion. Because Below is what it looks like on my environment, but how does it look on yours?
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 don't disagree, though since this PR already touches a fair bit of CSS, I wonder if it's not best to do this separately? Thank you again for the thorough reviews! |
||||||
text-align: center; | ||||||
width: 100%; | ||||||
box-sizing: border-box; | ||||||
@include custom-scrollbars-on-hover(transparent, rgba($white, 0.8)); | ||||||
|
||||||
// Dark gradient scrim. | ||||||
background: linear-gradient(0deg, rgba($color: $black, $alpha: 0.4) 0%, rgba($color: $black, $alpha: 0) 100%, transparent); | ||||||
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.
Suggested change
The gradient style should remain the same. |
||||||
|
||||||
img { | ||||||
display: inline; | ||||||
} | ||||||
|
@@ -85,6 +109,10 @@ figure.wp-block-gallery.has-nested-images { | |||||
margin: 0; | ||||||
padding: 10px 10px 9px; | ||||||
position: relative; | ||||||
text-shadow: none; | ||||||
} | ||||||
&::before { | ||||||
content: none; | ||||||
} | ||||||
} | ||||||
} | ||||||
|
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 doesn't seem to be any visual difference without
z-index: 0
, but is it necessary?