Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to get Chrome to do CSS transitions with letter-spacing smoothly?

Tags:

I am attempting to have a nice CSS transition for letter-spacing property.

It looks great in Firefox and Internet explorer 10 (something finally works as expected in IE. Omg, right?)

But it doesn't work in Chrome or Opera. In Chrome it is a series of jitters, so it goes from 2px to 1px to 0. No smooth-pixel rendering like in IE/Firefox.

Is there any way to make Chrome render it smoothly?

Here is a simple example:

p {     letter-spacing:2px;      -webkit-transition: letter-spacing, 1s;     -moz-transition: letter-spacing, 1s;     -o-transition: letter-spacing, 1s;     transition: letter-spacing, 1s; } p:hover {letter-spacing:0;} 

http://jsfiddle.net/aDhRz/

like image 691
user2413333 Avatar asked Sep 05 '13 16:09

user2413333


People also ask

Why is transition property not working?

The reason for this is, display:none property is used for removing block and display:block property is used for displaying block. A block cannot be partly displayed. Either it is available or unavailable. That is why the transition property does not work.

What is WebKit transition?

-webkit-transition is a non-standard boolean CSS media feature whose value indicates whether vendor-prefixed CSS transition s are supported or not. This media feature is only supported by WebKit. The standards-based alternative is to use a @supports feature query instead.

Which of the following options is used as a shorthand property to describe all transition related properties?

The transition CSS property is a shorthand property for transition-property , transition-duration , transition-timing-function , and transition-delay .


1 Answers

This problem is now fixed in Blink (powering the Chrome layout engine) but not yet rolled out in stable Chrome. But you can see it's working fine now in Chrome Canary.

Until it's available for everyone, I don't think there will be a workaround without a JavaScript solution using canvas. We're lucky Chrome auto-updates :)

Blink fix: http://src.chromium.org/viewvc/blink?view=revision&revision=153727

Seems that Google is taking Blink development seriously, because this bug exists in WebKit since 2008, and it's still not fixed.

WebKit bug report: https://bugs.webkit.org/show_bug.cgi?id=20606

like image 181
Joram van den Boezem Avatar answered Sep 30 '22 17:09

Joram van den Boezem