Skip to content

Commit ecb420d

Browse files
committed
Improve the example for how to specify styles for different forward/reverse behavior.
This addresses https://www.w3.org/Bugs/Public/show_bug.cgi?id=14611 without any technical fixes as proposed in http://lists.w3.org/Archives/Public/www-style/2012Mar/0013.html and resolved in the 2012 February 29 teleconference (minutes at http://lists.w3.org/Archives/Public/www-style/2012Mar/0013.html ).
1 parent f97d7ef commit ecb420d

2 files changed

Lines changed: 53 additions & 9 deletions

File tree

css3-transitions/Overview.html

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
177177
transitions </a>
178178

179179
<li><a href="#reversing"><span class=secno>4. </span> Automatically
180-
reversing transitions </a>
180+
reversing interrupted transitions </a>
181181

182182
<li><a href="#transition-events-"><span class=secno>5. </span> Transition
183183
Events </a>
@@ -796,11 +796,35 @@ <h2 id=starting><span class=secno>3. </span> Starting of transitions</h2>
796796
class=property>transition-delay</code></a>&rsquo; properties at the time
797797
the animatable property would first have its new computed value.
798798

799-
<div class=example>
799+
<div class=example id=manual-reversing-example>
800800
<p style="display:none"> Example(s):</p>
801801

802-
<pre>li { transition: background-color linear 1s; background: blue; }
803-
li:hover { transition-duration: 2s; background-color: green; }</pre>
802+
<p>This provides a way for authors to specify different values of the
803+
&lsquo;<code class=css>transition-*</code>&rsquo; properties for the
804+
&ldquo;forward&rdquo; and &ldquo;reverse&rdquo; transitions (but see <a
805+
href="#reversing">below</a> for special reversing behavior when an
806+
<em>incomplete</em> transition is interrupted). Authors can specify the
807+
value of &lsquo;<a href="#transition-duration"><code
808+
class=property>transition-duration</code></a>&rsquo;, &lsquo;<a
809+
href="#transition-timing-function"><code
810+
class=property>transition-timing-function</code></a>&rsquo;, or &lsquo;<a
811+
href="#transition-delay"><code
812+
class=property>transition-delay</code></a>&rsquo; in the same rule where
813+
they specify the value that triggers the transition, or can change these
814+
properties at the same time as they change the property that triggers the
815+
transition. Since it's the new values of these &lsquo;<code
816+
class=css>transition-*</code>&rsquo; properties that affect the
817+
transition, these values will be used for the transitions <em>to</em> the
818+
associated transitioning values. For example:</p>
819+
820+
<pre>li {
821+
transition: background-color linear 1s;
822+
background: blue;
823+
}
824+
li:hover {
825+
background-color: green;
826+
transition-duration: 2s; /* applies to the transition *to* the :hover state */
827+
}</pre>
804828

805829
<p> When a list item with these style rules enters the :hover state, the
806830
computed &lsquo;<a href="#transition-duration"><code
@@ -847,7 +871,7 @@ <h2 id=starting><span class=secno>3. </span> Starting of transitions</h2>
847871
another element that is transitioning the same property.
848872

849873
<h2 id=reversing><span class=secno>4. </span> Automatically reversing
850-
transitions</h2>
874+
interrupted transitions</h2>
851875

852876
<p> A common type of transition effect is when a running transition is
853877
interrupted and the property is reset to its original value. An example is

css3-transitions/Overview.src.html

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,32 @@ <h2 id="starting">
758758
at the time the animatable property would first have its new
759759
computed value.
760760
</p>
761-
<div class="example">
761+
<div class="example" id="manual-reversing-example">
762762
<p style="display:none">
763763
Example(s):
764764
</p>
765-
<pre>li { transition: background-color linear 1s; background: blue; }
766-
li:hover { transition-duration: 2s; background-color: green; }</pre>
765+
<p>This provides a way for authors to specify different values
766+
of the 'transition-*' properties for the &ldquo;forward&rdquo;
767+
and &ldquo;reverse&rdquo; transitions (but see <a
768+
href="#reversing">below</a> for special reversing behavior when
769+
an <em>incomplete</em> transition is interrupted). Authors can
770+
specify the value of 'transition-duration',
771+
'transition-timing-function', or 'transition-delay' in the same
772+
rule where they specify the value that triggers the transition,
773+
or can change these properties at the same time as they change
774+
the property that triggers the transition. Since it's the new
775+
values of these 'transition-*' properties that affect the
776+
transition, these values will be used for the transitions
777+
<em>to</em> the associated transitioning values. For example:
778+
</p>
779+
<pre>li {
780+
transition: background-color linear 1s;
781+
background: blue;
782+
}
783+
li:hover {
784+
background-color: green;
785+
transition-duration: 2s; /* applies to the transition *to* the :hover state */
786+
}</pre>
767787
<p>
768788
When a list item with these style rules enters the :hover
769789
state, the computed 'transition-duration' at the time that
@@ -810,7 +830,7 @@ <h2 id="starting">
810830
</p>
811831

812832
<h2 id="reversing">
813-
Automatically reversing transitions
833+
Automatically reversing interrupted transitions
814834
</h2>
815835
<p>
816836
A common type of transition effect is when a running transition is

0 commit comments

Comments
 (0)