I have a CSS arch with a box-shadow, achieving a 3D effect. Is there a feature of CSS that would reduce the number of lines for box-shadow?
html {
padding: 40px;
}
.arch {
transition: all 250ms ease-in 0s;
background: orange;
border-radius: 50% 50% 0px 0px;
width: 270px;
height: 350px;
position: relative;
box-shadow: -1px 1px 0px #222,
-2px 2px 0px #222,
-3px 3px 0px #222,
-4px 4px 0px #222,
-5px 5px 0px #222,
-6px 6px 0px #222,
-7px 7px 0px #222,
-8px 8px 0px #222,
-9px 9px 0px #222,
-10px 10px 0px #222,
-11px 11px 0px #222,
-12px 12px 0px #222,
-13px 13px 0px #222,
-14px 14px 0px #222,
-15px 15px 0px #222,
-16px 16px 0px #222,
-17px 17px 0px #222,
-18px 18px 0px #222,
-19px 19px 0px #222,
-20px 20px 0px #222;
}
<div class="arch"></div>
2
Answers
You could use pseudo classes to achieve a similar effect:
If you are okay with using SVG, you could use an SVG too:
Here is an idea using
box-shadow
andclip-path
. Notice that the first shadow is using a spread different from 0