Open
Description
See: #12315
I also found it a bit surprising that there is no way to have local typed custom properties. (except result
)
@property --x {
syntax: "<color>";
inherits: true;
initial-value: pink;
}
@function --foo() returns <color> {
--x: rgb(255 0 0);
result: if(
style(--x: red): green;
else: black;
);
}
* {
background-color: --foo(); /* black */
}
What was the original motivation to make everything untyped inside custom functions?
Because values are resolved in imaginary child elements nothing leaks out when a function is evaluated.
I can imagine that when the types are preserved it is possible to break custom functions by registering seemingly unrelated properties.
So maybe it should be possible to do local registrations?