Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSS numeric factory #2000

Merged
merged 4 commits into from
Oct 28, 2024
Merged

Conversation

jamesnw
Copy link
Collaborator

@jamesnw jamesnw commented Oct 18, 2024

This is an alternate breakout of the CSS Typed OM spec as discussed in #1847. Rather than putting api.CSS.ch_static with the ch unit feature, this draws inspiration from MDN. https://developer.mozilla.org/en-US/docs/Web/API/CSS/factory_functions_static

Does this work as a feature?

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Oct 18, 2024
@jamesnw jamesnw added the question Further information is requested label Oct 22, 2024
Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I like this approach. It's probably the right way to do it, until there's a long enough history of support to justify decomposing the keys into CSS features.

It's also similar to how we cover groups of (actual) CSS functions (like the trig functions).

Some suggestions, but I'd be happy to see this move forward.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numeric-factory-functions.yml

@@ -0,0 +1,67 @@
name: CSS numeric factory functions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: CSS numeric factory functions
name: Numeric factory functions

@@ -0,0 +1,67 @@
name: CSS numeric factory functions
description: The CSS numeric factory functions create a CSSUnitValue, for instance with `CSS.px(12)` or `CSS.kHz(440)`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be careful not to imply that these are CSS functions, but rather a browser API. Maybe like this?

Suggested change
description: The CSS numeric factory functions create a CSSUnitValue, for instance with `CSS.px(12)` or `CSS.kHz(440)`.
description: The numeric factory functions, such as `CSS.px()` or `CSS.kHz()`, return a `CSSUnitValue` representing a CSS number value (as in `12px` or `440kHz`).

@@ -0,0 +1,67 @@
name: CSS numeric factory functions
description: The CSS numeric factory functions create a CSSUnitValue, for instance with `CSS.px(12)` or `CSS.kHz(440)`.
spec: https://drafts.css-houdini.org/css-typed-om-1/#numeric-factory
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? Or cssom?

Suggested change
spec: https://drafts.css-houdini.org/css-typed-om-1/#numeric-factory
spec: https://drafts.css-houdini.org/css-typed-om-1/#numeric-factory
group: css

@jamesnw jamesnw marked this pull request as ready for review October 28, 2024 14:28
@jamesnw jamesnw removed the question Further information is requested label Oct 28, 2024
@jamesnw jamesnw requested a review from ddbeck October 28, 2024 14:28
@ddbeck ddbeck merged commit 357bffb into web-platform-dx:main Oct 28, 2024
3 checks passed
vwallen pushed a commit to oddbird/web-features that referenced this pull request Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants