Replies: 5 comments 5 replies
-
I'd like to replace Still, I think having the interface is helpful both for static analysis as well as the reader. |
Beta Was this translation helpful? Give feedback.
-
FWIW, that was the initial use-case I had when I created the parser. I had wanted to create a minimized preview of a website. None of the attempts at scaling an |
Beta Was this translation helpful? Give feedback.
-
Ah, I see. On that basis then, we should
Keeping this open for suggestions for the above interface name... |
Beta Was this translation helpful? Give feedback.
-
It would be good to deconflate the Doing so would require a deprecation step. The easiest way would be to deprecate the |
Beta Was this translation helpful? Give feedback.
-
When passed (recursively) through
CSSBlockList::allValues()
, this becomes a union type:CSSList|Rule|RuleSet|Value
.To help with static analysis, we could introduce an (empty) interface that these classes would all implement, e.g.
CSSElement
.But I'm wondering if this method has much practical use. The
Value
s returned are without any context information, so you would get objects representing things like10px
, without any idea of where they occur in the CSS. I suppose, since they are objects, you can modify them, with changes reflected in the rendered CSS, so you could use this method to replace, say, all instances of10px
with12px
. Is that a plausible use case? Are there other use cases for this?It would not be much effort to introduce a
CSSElement
interface for the static analysis. I'm just wondering if this feature has any value, and could perhaps instead be deprecated and removed...Beta Was this translation helpful? Give feedback.
All reactions