-
Notifications
You must be signed in to change notification settings - Fork 711
[css-easing-2] linear() custom easing #7484
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
Conversation
The indenting system used by this spec is maddening
which may be needed for slower animations. | ||
</div> | ||
|
||
A <dfn export>linear easing function</dfn> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind moving this normative text to the top of the section, and having all the examples below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much of it do you want above the examples? Everything from here until ### Syntax ###
?
css-easing-2/Overview.bs
Outdated
|
||
Note: Although this produces a [=linear easing function=], | ||
it serializes as `linear`, | ||
as per the rules in [Serialization](#serialization). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want a literal linear(0, 1)
to serialize as linear
? I think that would be surprising. I'd prefer to not collapse the keyword and function together; just saying that linear
acts the same as linear(0, 1)
should be fine imo.
<style> | ||
@media (prefers-color-scheme: dark) { | ||
.easing-graph { | ||
background: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you converted some of the SVGs to have opaque backgrounds, others you've newly added are still transparent, so this is actually making them less readable than the default background: white
would do. I think you either want to remove this or make all the SVGs opaque.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tabatkins ping. This is the last bit I'm unsure about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your screenshot shows them against the lightmode note styling. Have you checked it against the darkmode note styling to confirm that it's actually readable? I suspect it's not. (I'm fine with removing the background in lightmode, since they're authored to be readable against a light background.) I'm mostly just confused why you decided you needed to add an opaque background to some images, but explicitly remove an opaque background from others, when they look fairly similar in color usage to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use dark mode by default so I checked it there too (part of this PR is making those images work well in dark mode). The lack of consistency in the backgrounds is an error on my part, I'll fix them so they're all transparent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me with Tab's suggestions incorporated.
I agree that we probably want linear(0, 1)
to serialize as linear(0, 1)
.
Co-authored-by: Tab Atkins Jr. <[email protected]>
@tabatkins @birtles In terms of serialization, I think the normative text is correct.
It explicitly says that So:
I think that's the behaviour we're agreeing on, so I guess the note is misleading? |
Yes, looks good to me. |
I've tried to make the note a bit clearer:
|
Implementation bugs:
|
I think |
I think it is fixed, thanks. I do not really know when a CSS type or an inline value definition should be used, or if it matters at all. A workaround for me could be to assume that a function with no argument is a CSS type reference that is not wrapped in angled brackets, but I would rather not do that, even if there is currently no CSS function that takes no argument (I think). |
The spec was updated in w3c/csswg-drafts#7484.
This PR defines
linear()
, a way to create custom easings, as discussed in #229 (comment).In addition, I tweaked the diagrams so they respect dark mode.
Due to various issues, this PR existed in other forms previously:
I think this is ready to land. Once it does, I'll ensure issues are filed with Firefox/Safari/Chrome.