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

[CSS] Implement trigonometric functions and constants #19832

Closed
11 of 12 tasks
Rumyra opened this issue Aug 22, 2022 · 25 comments
Closed
11 of 12 tasks

[CSS] Implement trigonometric functions and constants #19832

Rumyra opened this issue Aug 22, 2022 · 25 comments
Assignees
Labels
Content:CSS Cascading Style Sheets docs fx release archive A closed issue relating to firefox release notes for developers.

Comments

@Rumyra
Copy link
Collaborator

Rumyra commented Aug 22, 2022

Acceptance Criteria

  • The listed features are documented sufficiently on MDN
  • BCD is updated
  • Interactive example and data repos are updated if appropriate
  • The content has been reviewed as needed

For folks helping with Firefox related documentation

  • Set bugs to dev-doc-complete
  • Add entry to Firefox release notes if feature is enabled in release
    or
  • Add entry to Firefox experimental features page if feature is not yet enabled in release

Features to document

Implement trigonometric functions and constants https://drafts.csswg.org/css-values-4/#trig-funcs

Related Gecko bugs

https://bugzilla.mozilla.org/show_bug.cgi?id=1774589

Issues and PRs

@Rumyra Rumyra added Content:CSS Cascading Style Sheets docs Firefox 105 labels Aug 22, 2022
@github-actions github-actions bot added needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. and removed Content:CSS Cascading Style Sheets docs labels Aug 22, 2022
@bsmth
Copy link
Member

bsmth commented Sep 6, 2022

The functions to be added to mdn/content:

see Ramiy's comment below for the status of PRs

@ramiy
Copy link
Contributor

ramiy commented Sep 6, 2022

Hi @Rumyra ,

Since Firefox 103, those functions are behind the layout.css.trig.enabled flag.

We need to make sure they will ship in Firefox 105 (not Nightly).

Please read the comments at mdn/browser-compat-data#17505

@bsmth
Copy link
Member

bsmth commented Sep 6, 2022

Hi @ramiy that's great, thanks a lot for your contribution. Do you already have a branch for the outstanding functions? I think we could probably get them all to land in a single PR, what do you think?

@ramiy
Copy link
Contributor

ramiy commented Sep 6, 2022

Hi @ramiy that's great, thanks a lot for your contribution. Do you already have a branch for the outstanding functions? I think we could probably get them all to land in a single PR, what do you think?

No, they are not ready yet.

@bsmth
Copy link
Member

bsmth commented Sep 6, 2022

OK, thanks. Would you like to collaborate on a fork? I can open a draft PR to compare changes if that's convenient. Let me know how you would like to proceed.

@Rumyra
Copy link
Collaborator Author

Rumyra commented Sep 6, 2022

Hi @ramiy - these are to be shipped in 105 - see the afore mentioned bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1774589

Hence why the issue is open, as the content team works on updates monthly. As these are for 105 we're looking to get them complete by the end of next week. If you need @bsmth support to do this please let us know - thanks!

@evilpie
Copy link
Contributor

evilpie commented Sep 7, 2022

They are not enabled by default in 105, but behind a flag. https://searchfox.org/mozilla-beta/source/modules/libpref/init/StaticPrefList.yaml#7633-7638

https://bugzilla.mozilla.org/show_bug.cgi?id=1787070 will enable them.

@Rumyra
Copy link
Collaborator Author

Rumyra commented Sep 7, 2022

Thanks @evilpie that's really helpful.

@ramiy if you still need our support let us know. We can also do the relevant bcd updates when they are released to stable if that helps

@bsmth
Copy link
Member

bsmth commented Sep 13, 2022

As I see it now, the only outstanding changes are BCD updates. I'm holding off from adding the dev-doc-complete label on Bugzilla until then.

I'm also skipping interactive examples for the moment because the mdn/content pages already have nice-looking examples.

@ramiy
Copy link
Contributor

ramiy commented Sep 14, 2022

@Rumyra @bsmth

How should we document the trigonometric constants ( e | pi | infinity | -infinity | NaN ) ?

@bsmth
Copy link
Member

bsmth commented Sep 14, 2022

Shall we put them under numbers -> https://developer.mozilla.org/en-US/docs/Web/CSS/number

Note: While not technically numbers, these keywords act as numeric values, similar to e and pi. Thus to get an infinite length, for example, requires an expression like calc(infinity * 1px).

@ramiy
Copy link
Contributor

ramiy commented Sep 14, 2022

See the Calc Syntax section in the spec.

<calc-constant> = e | pi | infinity | -infinity | NaN

Should we create a new CSS data type ? Even is the answer is "no", eventually we will have to create this new type.

@bsmth
Copy link
Member

bsmth commented Sep 14, 2022

Should we create a new CSS data type ?

I think we can skip that for now and add a "Numeric Constants" subsection to numbers for the moment, what do you think? We might indeed have to add a dedicated page in future. One thing to inform that decision: the spec lists these constants under math expressions not under numeric data types.

@ramiy
Copy link
Contributor

ramiy commented Sep 14, 2022

Why am I hesitating?

Because infinity/-infinity is not just a <number>, it can also be a <dimension> which can specify distances (<length>), durations (<time>), frequencies (<frequency>), resolutions (<resolution>), and other quantities.

I prefer to create new data types for <calc-sum>, <calc-product>, <calc-value> and <calc-constant>.

@bsmth
Copy link
Member

bsmth commented Sep 15, 2022

OK, I see your point. How about we mention e | pi | infinity | -infinity | NaN on the values and units page under numeric constants as they're still not types, as such, but referred to in the spec as "keywords" under math expressions.

I'm curious where <calc-sum> etc. would fit in the our docs. Note that we have the following: https://developer.mozilla.org/en-US/docs/Web/CSS/calc

@bsmth
Copy link
Member

bsmth commented Sep 15, 2022

@ramiy I think we should limit the scope of these changes for the moment. Let's just add some basic notes about the constants (one or two paras) as a sibling or child of numeric types either on the values or types page. We need to have a longer think about where it makes sense to have <calc-constant> and friends documented. 🙌🏻

@bsmth
Copy link
Member

bsmth commented Sep 15, 2022

@ramiy -> If you would like to make bigger changes (i.e. adding pages), could you please fill out a content suggestion issue so we can plan for it? Thank you! :)

@ramiy
Copy link
Contributor

ramiy commented Sep 15, 2022

I'm curious where <calc-sum> etc. would fit in the our docs. Note that we have the following: https://developer.mozilla.org/en-US/docs/Web/CSS/calc

See the calc syntax. The spec talks about calc-sum & friends too. I thin they should be documented in MDN.

Some of the content currently documented in calc() will be moved to <calc-sum>, <calc-product>, <calc-value> and <calc-constant>.

@bsmth
Copy link
Member

bsmth commented Sep 19, 2022

Yes, I think this makes sense. Could you please fill out a content suggestion issue so that we can track this? Thanks a lot

@hamishwillee
Copy link
Collaborator

@bsmth How is this one going? I was just doing a sweep of 105 items that still have dev-doc-needed and it includes these two:

Mostly just checking that 1682444 is part of this so we don't need another release issue to be created?

@bsmth
Copy link
Member

bsmth commented Oct 14, 2022

Hi @hamishwillee thanks for checking. I think you're right in including this one into this ticket:

Although 1682444 looks unrelated, did you mean to link to this?

@hamishwillee
Copy link
Collaborator

Although 1682444 looks unrelated, did you mean to link to this?

Whoops. No. . Should we add a note to the calc one that it is addressed by this issue?

@bsmth
Copy link
Member

bsmth commented Oct 14, 2022

Should we add a note to the calc one that it is addressed by this issue?

Good idea, just added a comment to the bug 👍🏻

@hamishwillee
Copy link
Collaborator

Thanks! I think its a generally good idea to cross link so that anyone in the team can tell that a bugzilla bug is already being addressed in some way. We're not so bad at that in more recent times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs fx release archive A closed issue relating to firefox release notes for developers.
Projects
Archived in project
Development

No branches or pull requests

7 participants
@evilpie @Rumyra @ramiy @hamishwillee @bsmth @Josh-Cena and others