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

Support display: "" #184

Closed
wants to merge 1 commit into from
Closed

Support display: "" #184

wants to merge 1 commit into from

Conversation

ef4
Copy link

@ef4 ef4 commented Jul 16, 2014

This is a proposal to change the meaning of display: auto so that it leaves the final value up to the stylesheets, stripping the inline display property off entirely.

Much of the time, this gives the same effect as the previous getDisplayType logic, since elements will simply revert to their natural default display type. But now the user has fine-grained control over which display value is ultimately used.

Alternatively, if people really like the current meaning of display: auto, I could also see this new semantic being given a different name, like display: blank or display: cascade.

@julianshapiro
Copy link
Owner

That was the original behavior, until I realized that devs most often don't want the cascading styles to take effect, which is -- unless I'm missing something -- precisely why they are setting display from within Velocity to begin with.

If you'd like to work around this, pass in display: null so that Velocity skips automatic display setting (depending on the command / UI pack effect being called), and set element.style.display = ""; in a begin or complete callback, as per your use case.

What do you think?

@ef4
Copy link
Author

ef4 commented Jul 16, 2014

The reason I'm setting display from velocity is that I otherwise see a flash of pre-animated content on some platforms.

But I wasn't using the begin callback, I was just calling jQuery.show before invoking velocity. Perhaps that alleviates the issue, I will try that.

I still think it would be nice if there was a way to pass an empty value for display so I can keep all the display logic in velocity, when my intent is to let the stylesheet take over. What if we went with my alternative proposal and make this a new option, like display: cascade?

@julianshapiro julianshapiro changed the title Make display:auto respect cascading styles Support display: "" Jul 16, 2014
@zol
Copy link

zol commented Aug 20, 2014

+1 For this PR. I too am working on a general purpose meteor js animation package that would benefit from this option. I would actually prefer this to be the default. I don't really understand the benefit of forcing the display property to something other than the default for the element or whatever the stylesheet specifies.

@julianshapiro
Copy link
Owner

Done. Coming up in the next build.

@julianshapiro
Copy link
Owner

Please test, confirm it works, and get back to me. Thank you so much!

ef4 added a commit to ember-animation/liquid-fire that referenced this pull request Aug 23, 2014
@ef4
Copy link
Author

ef4 commented Aug 23, 2014

Thanks, it's working for me.

Rycochet pushed a commit that referenced this pull request Aug 3, 2020
Dropped support for the easeBack and easeElastic easings. They are
rarely used, look stupid, and take up a bunch of lines.

Sped up bezier curve easing performance. Thanks, @gre.

The display option now gets browser-prefixed if necessary. This
inherently adds cross-browser support for the ‘flex’ value. Closes #257.

Fixed bug where slideDown/up left excess inline styles on elements.
Closes #260. cc @kpeatt, @scalvert.

Allow passing an empty string to `display` to remove the inline style
from the element. Closes #184.

Shimmed version of jQuery’s $.dequeue() now accepts a raw DOM element
*set* instead of just a single element.

You can now stop custom queues individually. Closes #262.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants