Re: [csswg-drafts] Declarative custom functions (#7490)

@johannesodland @LeaVerou @tabatkins @dbaron
I see tremendous value in extending CSS `@custom-function` rules to be more full-featured and not rely on JS.

I 100% agree that Houdini functions will be a huge advantage to CSS users. However, most instances I can imagine using CSS’s `@custom-function` would be styling-specific and not require extra JS scripting.

In my experience, it’s often very helpful to clearly divide styles from scripts when possible. Functions that are purely style-related can stay in the CSS and be fully capable, supporting conditional logic using native CSS if-statements, short-circuiting, recursion, and more, all without a JS counterpart as outlined in my previous comment.

I understand some of those features weren’t included in the original spec outlined in this issue, however, my vision—before knowing of this spec—and this spec are quite closely aligned, and I believe most/all features I mentioned is already possible using existing CSS syntax.

I also believe such features and enhancements would make CSS functions vastly more useful and desirable overall.

Per @LeaVerou’s comment, there could very well be used as fallback functions in some instances until the JS loads, but I also think these functions could stand strong on their own in many instances without needing JS.

-- 
GitHub Notification of comment by brandonmcconnell
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7490#issuecomment-1257405461 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 26 September 2022 02:49:19 UTC