Bug Tracker

Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#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:
Blocked by: Blocking:

Description (last modified by mikesherov)

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 (12)

comment:1 Changed 11 years ago by BillyRayPreachersSon

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.

comment:2 Changed 11 years ago by dmethvin

Owner: set to BillyRayPreachersSon
Status: newpending

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 11 years 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 11 years ago by dmethvin

Component: unfiledcss
Milestone: None1.9
Priority: undecidedlow
Status: pendingopen

Let's keep these internal for now, we can revisit in 1.9.

comment:5 in reply to:  2 Changed 11 years 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 11 years ago by dmethvin

Type: enhancementfeature

Bulk change from enhancement to feature.

comment:7 Changed 11 years ago by mikesherov

Keywords: 1.9-discuss added

comment:8 Changed 10 years ago by gibson042

+1 to documenting the properties; -1 to documenting the API.

comment:9 Changed 10 years ago by mikesherov

Description: modified (diff)

+1, knowledge is power

comment:10 Changed 10 years ago by gibson042

+1

comment:11 Changed 10 years ago by mikesherov

Resolution: notabug
Status: openclosed

comment:12 Changed 10 years ago by dmethvin

Milestone: 1.9None
Note: See TracTickets for help on using tickets.