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 scroll-timeline* properties #21277

Merged
merged 14 commits into from
Oct 10, 2022
Merged

Conversation

hamishwillee
Copy link
Collaborator

@hamishwillee hamishwillee commented Oct 4, 2022

FF103 added support for the following CSS properties behind a pref layout.css.scroll-linked-animations.enabled:

  • scroll-timeline-name
  • scroll-timeline-axis
  • scroll-timeline (shorthand)

This adds documentation. I am also updating related docs like animation-timeline to purge @scroll-timeline at-rule, which this replaces and which is not part of the spec.

Note that this requires preferences to be set in chrome and in FF to work. I'll look at BCD next so that will become obvious.

Other docs work can be tracked in #21069

@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Oct 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2022

Preview URLs (8 pages)
Flaws (6)

Note! 5 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/CSS/scroll-timeline-axis
Title: scroll-timeline-axis
Flaw count: 3

  • broken_links:
    • Link points to the page it's already on
    • Link points to the page it's already on
  • bad_bcd_queries:
    • No BCD data for query: css.properties.scroll-timeline-axis

URL: /en-US/docs/Web/CSS/scroll-timeline
Title: scroll-timeline
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: css.properties.scroll-timeline

URL: /en-US/docs/Web/CSS/scroll-timeline-name
Title: scroll-timeline-name
Flaw count: 2

  • broken_links:
    • Link points to the page it's already on
  • bad_bcd_queries:
    • No BCD data for query: css.properties.scroll-timeline-name

(this comment was updated 2022-10-10 03:35:54.999679)

@github-actions github-actions bot added the Content:Other Any docs not covered by another "Content:" label label Oct 7, 2022
@@ -88,12 +107,9 @@ A scroll timeline named `squareTimeline` is declared and applied to the `#square
animation-duration: 3s;
Copy link
Collaborator Author

@hamishwillee hamishwillee Oct 7, 2022

Choose a reason for hiding this comment

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

Not clear why you need animation-duration when a timeline is provided by the scrollbar. But in FF at least it does not rotate without this.

@@ -12,7 +12,10 @@ tags:
browser-compat: css.at-rules.scroll-timeline
---

{{CSSRef}}{{Non-standard_header}}{{Deprecated_header}}
{{CSSRef}}{{Deprecated_header}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we just delete this document altogether? It is implemented in chrome so people might be using it, but it is non standard and will shortly be superseded on all platforms

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can still keep it around until 'scroll-timeline' property becomes default in two browsers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. I'm in two minds. The argument to remove is that this is non standard, deprecated, and the result of a removed draft specification - i.e. should never have been in the wild. The argument to keep is that it is in chrome. Perhaps a compromise would be when the proper API is in one browser.

@hamishwillee hamishwillee marked this pull request as ready for review October 7, 2022 05:02
@hamishwillee hamishwillee requested review from a team as code owners October 7, 2022 05:02
@hamishwillee hamishwillee requested review from dipikabh and removed request for a team October 7, 2022 05:02
@dipikabh dipikabh self-assigned this Oct 7, 2022
Copy link
Contributor

@dipikabh dipikabh left a comment

Choose a reason for hiding this comment

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

Thanks for these updates, @hamishwillee! Just a few minor suggestions.

files/en-us/mozilla/firefox/experimental_features/index.md Outdated Show resolved Hide resolved
@@ -12,7 +12,10 @@ tags:
browser-compat: css.at-rules.scroll-timeline
---

{{CSSRef}}{{Non-standard_header}}{{Deprecated_header}}
{{CSSRef}}{{Deprecated_header}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can still keep it around until 'scroll-timeline' property becomes default in two browsers?

files/en-us/web/css/scroll-timeline-name/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/scroll-timeline-name/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/scroll-timeline-name/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/animation-timeline/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/animation-timeline/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/animation-timeline/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/animation-timeline/index.md Outdated Show resolved Hide resolved
hamishwillee and others added 2 commits October 10, 2022 09:52
Co-authored-by: Dipika Bhattacharya <dipika@foss-community.org>
Co-authored-by: Dipika Bhattacharya <dipika@foss-community.org>
hamishwillee and others added 2 commits October 10, 2022 10:05
Co-authored-by: Dipika Bhattacharya <dipika@foss-community.org>
Comment on lines +50 to +75
A `<scroll-timeline-name>` value followed by a `<scroll-timeline-axis>` value may be applied to the container element in any order.
At least one value must be applied.

Allowed values for `<scroll-timeline-name>` are:

- `none`
- : The timeline has no name.
- `<custom-ident>`
- : An arbitrary custom identifier that can be used to reference the scroll timeline in an [`animation-timeline`](/en-US/docs/Web/CSS/animation-timeline).
Possible values are described in [`<custom-ident>`](/en-US/docs/Web/CSS/custom-ident).

The `<scroll-timeline-axis>` indicates which scrollbar axis, in the element identified by `<scroll-timeline-name>`, provides the scroll timeline.
Allowed values are:

- `block`
- : (Default) Scrollbar in the block axis of the scroll container.
The block axis is the direction perpendicular to the flow of text within a line.
For horizontal writing modes like standard English this is the same as `vertical`, while for vertical writing modes it is the same as `horizontal`.
- `inline`
- : Scrollbar in the inline axis of the scroll container.
The inline axis is the direction parallel to the flow of text in a line.
For horizontal writing modes this is the same as `horizontal`, while for vertical writing modes this is the same as `vertical`.
- `vertical`
- : Scrollbar in the vertical axis of the scroll container.
- `horizontal`
- : Scrollbar in the horizontal axis of the scroll container.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. That makes sense. Does this work for you?

Suggested change
A `<scroll-timeline-name>` value followed by a `<scroll-timeline-axis>` value may be applied to the container element in any order.
At least one value must be applied.
Allowed values for `<scroll-timeline-name>` are:
- `none`
- : The timeline has no name.
- `<custom-ident>`
- : An arbitrary custom identifier that can be used to reference the scroll timeline in an [`animation-timeline`](/en-US/docs/Web/CSS/animation-timeline).
Possible values are described in [`<custom-ident>`](/en-US/docs/Web/CSS/custom-ident).
The `<scroll-timeline-axis>` indicates which scrollbar axis, in the element identified by `<scroll-timeline-name>`, provides the scroll timeline.
Allowed values are:
- `block`
- : (Default) Scrollbar in the block axis of the scroll container.
The block axis is the direction perpendicular to the flow of text within a line.
For horizontal writing modes like standard English this is the same as `vertical`, while for vertical writing modes it is the same as `horizontal`.
- `inline`
- : Scrollbar in the inline axis of the scroll container.
The inline axis is the direction parallel to the flow of text in a line.
For horizontal writing modes this is the same as `horizontal`, while for vertical writing modes this is the same as `vertical`.
- `vertical`
- : Scrollbar in the vertical axis of the scroll container.
- `horizontal`
- : Scrollbar in the horizontal axis of the scroll container.
A `<scroll-timeline-name>` value followed by a `<scroll-timeline-axis>` value may be applied to the container element in any order.
At least one value must be applied.
Allowed values are:
- `<scroll-timeline-name>`
- : The name used to identify the timeline.
See [`scroll-timeline-name`](/en-US/docs/Web/CSS/scroll-timeline-name).
- `<scroll-timeline-axis>`
- : The axis of the element that provides the scrollbar used for the timeline.
The default is the scrollbar in the block axis.
See [`scroll-timeline-axis`](/en-US/docs/Web/CSS/scroll-timeline-axis).

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is much better. Thank you :)

@hamishwillee
Copy link
Collaborator Author

Hi @dipikabh

Thanks for your thorough review - more than just a "few" suggestions :-) Much appreciated.

I have accepted most of them. Just one open issue my side as a result of your comments: https://github.com/mdn/content/pull/21277/files#r990857875

@hamishwillee hamishwillee requested a review from dipikabh October 9, 2022 23:40
Copy link
Contributor

@dipikabh dipikabh left a comment

Choose a reason for hiding this comment

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

Looks good, thanks a lot! 👍

@dipikabh dipikabh merged commit f8dd5ee into mdn:main Oct 10, 2022
@hamishwillee hamishwillee deleted the css-scroll-timeline branch October 10, 2022 22:27
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 Content:Other Any docs not covered by another "Content:" label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants