Ticket #11887 (closed feature: notabug)
Add an entry for $.cssNumber to the API docs
| Reported by: | BillyRayPreachersSon | Owned by: | BillyRayPreachersSon |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | css | Version: | 1.7.2 |
| Keywords: | 1.9-discuss | Cc: | |
| Blocking: | Blocked by: |
Description (last modified by mikesherov) (diff)
I think it would be worthwhile adding an entry for $.cssNumber to the API docs, alongside the existing entry for $.cssHooks.
At present, the only mention of it is right at the bottom of the entry for $.cssHooks, and so it's very easy to miss.
The main reason I think it might be a useful addition is for anyone wondering why setting the line-height style without a value does not give the same results as setting the font-size style without a value, e.g.:
var size = 10;
el.css({ fontSize:size, lineHeight:size });
Personally, I'd add it to both the "CSS" and "Mainpulation -> Style Properties" categories, as those would be the places I'd be looking if I had the aforementioned issue.
Change History
comment:2 follow-up: ↓ 5 Changed 12 months ago by dmethvin
- Owner set to BillyRayPreachersSon
- Status changed from new to pending
So are you asking that we expose jQuery.cssNumber as part of the API so that users can change it? Or just that the information contained there be included in the pages for .css() at api.jquery.com?
comment:3 Changed 12 months ago by mikesherov
dmethvin, I'm personally torn on this one. While it may be nice for plugin developers to be able to rely on $.cssNumber and $.cssProps, if we expose it, we're locked in. Perhaps just adding it to .css() and mentioning them as unstable hooks for plugin devs is good enough?
comment:4 Changed 12 months ago by dmethvin
- Priority changed from undecided to low
- Status changed from pending to open
- Component changed from unfiled to css
- Milestone changed from None to 1.9
Let's keep these internal for now, we can revisit in 1.9.
comment:5 in reply to: ↑ 2 Changed 10 months ago by BillyRayPreachersSon
Replying to dmethvin:
So are you asking that we expose jQuery.cssNumber as part of the API so that users can change it? Or just that the information contained there be included in the pages for .css() at api.jquery.com?
Just that the information contained be included in the docs, really.
comment:6 Changed 9 months ago by dmethvin
- Type changed from enhancement to feature
Bulk change from enhancement to feature.
comment:8 Changed 9 months ago by gibson042
+1 to documenting the properties; -1 to documenting the API.
comment:10 Changed 8 months ago by gibson042
+1
comment:11 Changed 8 months ago by mikesherov
- Status changed from open to closed
- Resolution set to notabug
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

A small typo crept in there: "without a value" should read "without a unit".
Unfortunately, there appears to be no way to edit a ticket, even as the reporter.