-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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 documentation for using multiple drop-shadows #37138
base: main
Are you sure you want to change the base?
Changes from all commits
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 | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -38,6 +38,9 @@ drop-shadow(5px 5px 15px red) | |||||||||||||||
/* The order of color and length values can be changed */ | ||||||||||||||||
/* drop-shadow( <color> <length> <length> <length> ) */ | ||||||||||||||||
drop-shadow(#e23 0.5rem 0.5rem 1rem) | ||||||||||||||||
|
||||||||||||||||
/* You can pass multiple drop-shadow's to a filter to stack them */ | ||||||||||||||||
drop-shadow(10px 10px red) drop-shadow(-5px -5px yellow) | ||||||||||||||||
``` | ||||||||||||||||
|
||||||||||||||||
The `drop-shadow()` function accepts a parameter of type `<shadow>` (defined in the {{cssxref("box-shadow")}} property), with the exception that the `inset` keyword and `spread` parameters are not allowed. | ||||||||||||||||
|
@@ -64,6 +67,12 @@ The `drop-shadow()` function accepts a parameter of type `<shadow>` (defined in | |||||||||||||||
<div>drop-shadow(16px 16px red)</div> | ||||||||||||||||
<div>drop-shadow(red 1rem 1rem 10px)</div> | ||||||||||||||||
<div>drop-shadow(-16px -16px red)</div> | ||||||||||||||||
<div> | ||||||||||||||||
drop-shadow(1px 1px red) | ||||||||||||||||
drop-shadow(1px -1px red) | ||||||||||||||||
drop-shadow(-1px 1px red) | ||||||||||||||||
Comment on lines
+71
to
+73
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. [mdn-linter] reported by reviewdog 🐶
Suggested change
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. These should either all be on the same line, or all be on separate lines.
All the suggestions the linter is making are bad. 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. Hi @TheJaredWilcurt. Yup, the linter is really annoying sometimes. To stop it from committing linting crimes in cases like this, update the language specifier on the opening code fence to include ```css-nolint /* CSS code here */ ``` or ```js-nolint // JS code here ``` 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. Then re add, commit, and push, and it should turn the PR green. |
||||||||||||||||
drop-shadow(-1px -1px red) | ||||||||||||||||
</div> | ||||||||||||||||
``` | ||||||||||||||||
|
||||||||||||||||
```css | ||||||||||||||||
|
@@ -94,6 +103,14 @@ div:nth-child(3) { | |||||||||||||||
div:nth-child(4) { | ||||||||||||||||
filter: drop-shadow(-16px -16px red); | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
div:nth-child(5) { | ||||||||||||||||
filter: | ||||||||||||||||
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. My only comment here is that I would make the four shadows a bit more different, in color and/or placement. At the moment, it is difficult to see that multiuple shadows are being applied, as they are all so close together. |
||||||||||||||||
drop-shadow(1px 1px red) | ||||||||||||||||
drop-shadow(1px -1px red) | ||||||||||||||||
drop-shadow(-1px 1px red) | ||||||||||||||||
drop-shadow(-1px -1px red); | ||||||||||||||||
TheJaredWilcurt marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+108
to
+112
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. [mdn-linter] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||
} | ||||||||||||||||
``` | ||||||||||||||||
|
||||||||||||||||
{{EmbedLiveSample("Setting a drop shadow", "100%", "300px")}} | ||||||||||||||||
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. You also need to update the paragraph following the example to describe your new addition. At the moment, it only describes the first four shadows. |
||||||||||||||||
|
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.