Replies: 1 comment
-
Let's dig deeper. Shadows always match the light source. Speaking of light, we usually mean 3 types of sources:
The main source of scattered light has same // offset-x | offset-y | blur-radius | spread-radius
box-shadow:
inset
offset-x
-offset-y // - if lamp top left, or else +
var(--tw-how-scattered) // it should be inited with 0 for dev next params, 0 - projector(SpotLight), inf - Ambient Light
var(--tw-how-far-is-the-lamp) // we should hold this param at 80% for deep objects and 100% for flat
var(--tw-shadow-color) // if we use black color - shadow is shadow, if we use white color - It is worth noting that on the web, the light source is always in front of the monitor screen, and not behind it or to the side. If we are talking about a For most cases, we want to fix the coordinates of the light source. Groups can be used for this. .group/sun -- set offset-x | offset-y
.group/sun:shadow-[10px_1px_3] -- set That's all. We need to figure out how to do it right. |
Beta Was this translation helpful? Give feedback.
-
Let's say we want to create a
green
medium
inner shadow
in acircle
from the edges towards thecenter
.Is it works? - No.
While all utilities are quite flexible, but visuals and animations always force me to write css separately. And then abstract it into a configuration.
I would really like to be able to first write this quickly using ready-made classes defining css variables 1 to 1, and then put it into a repeating patterns configuration.
This approach is declared as the goal of tailwind. And I don't understand why we're not being honest about it here.
You can also notice that when defining shadows, variables appear that do not have equivalent classes.
.shadow-inner { --tw-shadow: inset 0 2px 4px 0 rgba(0,0,0,.05); --tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color); box-shadow: + var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow); }
Or in conflict:
It certainly works, but with varying degrees of success.
Beta Was this translation helpful? Give feedback.
All reactions