#1031: Custom Functions (@function)

Visit on Github.

Opened Dec 18, 2024

こんにちは TAG-さん!

I'm requesting a TAG review of Custom Functions (@function)

"A custom function can be thought of as an advanced custom property, which instead of being substituted by a single fixed value provides its substitution value based on function parameters and local variables." (From the spec.)

  • Explainer¹: https://css.oddbird.net/sasslike/mixins-functions/ (Also explains mixins, which is not in scope for this review.)
  • Specification: https://drafts.csswg.org/css-mixins-1/#defining-custom-functions
  • WPT Tests: N/A
  • User research: https://css.oddbird.net/sasslike/mixins-functions/#author-interest
  • Security and Privacy self-review²: <details><summary>tl;dr: nothing to report, expand for details.</summary><ul><li>2.1 What information might this feature expose to Web sites or other parties, and for what purposes is that exposure necessary? <br>A: It doesn't expose anything. It's both defined and used within CSS.</li></li><li>2.2 Do features in your specification expose the minimum amount of information necessary to enable their intended uses? <br>A: Yes. (Nothing.)</li></li><li>2.3 How do the features in your specification deal with personal information, personally-identifiable information (PII), or information derived from them? <br>A: N/A</li></li><li>2.4 How do the features in your specification deal with sensitive information? <br>A: N/A</li></li><li>2.5 Do the features in your specification introduce new state for an origin that persists across browsing sessions? <br>A: No.</li></li><li>2.6 Do the features in your specification expose information about the underlying platform to origins? <br>A: No.</li></li><li>2.7 Does this specification allow an origin to send data to the underlying platform? <br>A: No.</li></li><li>2.8 Do features in this specification enable access to device sensors? <br>A: No.</li></li><li>2.9 Do features in this specification enable new script execution/loading mechanisms? <br>A: No.</li></li><li>2.10 Do features in this specification allow an origin to access other devices? <br>A: No.</li></li><li>2.11 Do features in this specification allow an origin some measure of control over a user agent's native UI? <br>A: No.</li></li><li>2.12 What temporary identifiers do the features in this specification create or expose to the web? <br>A: None.</li></li><li>2.13 How does this specification distinguish between behavior in first-party and third-party contexts? <br>A: N/A.</li></li><li>2.14 How do the features in this specification work in the context of a browser's Private Browsing or Incognito mode? <br>A: As normal / not applicable.</li></li><li>2.15 Does this specification have both "Security Considerations" and "Privacy Considerations" sections? <br>A: Not yet. </li></li><li>2.16 Do features in your specification enable origins to downgrade default security protections? <br>A: N/A.</li></li><li>2.17 How does your feature handle non-"fully active" documents? <br>A: N/A.</li></li><li>2.18 What should this questionnaire have asked? <br>A: N/A.</li></ul></details>
  • GitHub repo: https://github.com/w3c/csswg-drafts/tree/main/css-mixins-1
  • Primary contacts:
    • @mirisuzanne, CSSWG Invited Expert, original proposal author and spec editor.
    • @tabatkins, Google, spec editor.
    • @andruud, Google, working on the feature in Chromium.
  • Organization/project driving the specification: Chromium
  • Multi-stakeholder support³:
  • Status/issue trackers for implementations⁴: https://issues.chromium.org/issues/325504770

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • Relevant time constraints or deadlines: Q1 2025.
  • The group where the work on this specification is currently being done: CSSWG
  • The group where standardization of this work is intended to be done (if different from the current group): CSSWG
  • Major unresolved issues with or opposition to this specification: https://github.com/w3c/csswg-drafts/issues/10954 (not opposition, but could lead to removal of the using keyword and associated behavior.)
  • This work is being funded by: N/A

Discussions