Re: [csswg-drafts] Proposal: Custom CSS Functions & Mixins (#9350)

@tabatkins Thanks! I'm working on a pre-processor so it's good to know which way CSS is going.

I'd still argue that while this works in the case of functions, it still suffers from the general CSS syntax flaw where it's a specific "micro-syntax" and there's not a general "list" or "list of lists" syntax in CSS itself.

From a general parsing perspective, the existence of `{Arial, serif}` as yet another list syntax means that this is a new exception to what `{` `}` has contained in specs up to this point, which has been a list of rules. That could make it more antagonistic to DX where, for example, an IDE has been able to speculate that `{` `}` will contain a list of rules (and has, until now), and color code appropriately.

So, it does and will work for this particular syntax (functions). But, at the same time, it is another addition to the pile of list-defining syntaxes in CSS, and list separators. I still wish that CSS would formalize a general set of list rules i.e. when commas are used, when spaces are used, when semi-colons are used, when slashes are used, and when curly braces are used, and what those semantics mean across the entire language in terms of lists, lists of lists, and in some cases in CSS (like `background` values), lists of lists of lists. I get that there's sort of "emergent" semantics based on how they've been historically used in values, but obviously in a non-comprehensive way, since `{` `}` emerged as another syntax to define lists of lists, even though some property values already contain lists of lists, and lists of lists of lists (but not in a language-generic way enough that made it suitable for the concept of CSS functions).

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


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

Received on Monday, 24 February 2025 18:45:52 UTC