Skip to content

Commit 853dc53

Browse files
committed
Drop position:sticky use case
1 parent 607f77d commit 853dc53

2 files changed

Lines changed: 7 additions & 63 deletions

File tree

Overview.bs

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -175,40 +175,9 @@ exactly would that work here?
175175

176176
## Scroll-triggered style changes ## {#scroll-triggered-style-changes-usecase}
177177

178-
### The fixed navigation bar ### {#fixed-menu-bar-usecase}
179-
The content of displaying the menu bar is the commonplace web content.
180-
Usually, these menu bar is fixed always. But some content will want to fix menu bar when
181-
scrolling certain position.
182-
Here's the example content for scroll-triggered based changing styles.
183-
This example has a menu bar on the right of content, and this content has a large title content.
184-
This position of navigation bar will be fixed after exceeding the certain scroll position.
178+
Issue: Need a different use case here, the previous one could be done
179+
with ‘position: sticky’.
185180

186-
Usually, we can implement using to the scroll event. However, If we use the @trigger rule, we can implement this more simply.
187-
188-
<figure>
189-
<img src="img/usecase2.svg" width="600"
190-
alt="Use case 2: Scroll based styling">
191-
<figcaption>
192-
Use case 2: Scroll based styling.<br>
193-
The left figure is before scroll, menubar's position is not fixed.<br>
194-
The right figure is after scroll, menubar's position is fixed.
195-
</figcaption>
196-
</figure>
197-
198-
If we use animation-trigger style sheet, this example code will be as follow:
199-
<pre class='lang-css'>
200-
div#menu-bar {
201-
position: relative;
202-
top: 10px;
203-
}
204-
205-
@trigger scroll(element(#scrollableContent), vertical, 200px) {
206-
#menu-bar {
207-
position: fixed;
208-
top: 10px;
209-
}
210-
}
211-
</pre>
212181

213182
## Scroll-linked animations ## {#scroll-linked-animations-usecase}
214183

index.html

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,7 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
307307
<li><a href="#navigation-bar-shrinking-effect"><span class="secno">2.1.1</span> <span class="content">Navigation bar shrinking effect</span></a>
308308
<li><a href="#navigation-highlight-effect"><span class="secno">2.1.2</span> <span class="content">Navigation highlight effect</span></a>
309309
</ol>
310-
<li>
311-
<a href="#scroll-triggered-style-changes-usecase"><span class="secno">2.2</span> <span class="content">Scroll-triggered style changes</span></a>
312-
<ol class="toc">
313-
<li><a href="#fixed-menu-bar-usecase"><span class="secno">2.2.1</span> <span class="content">The fixed navigation bar</span></a>
314-
</ol>
310+
<li><a href="#scroll-triggered-style-changes-usecase"><span class="secno">2.2</span> <span class="content">Scroll-triggered style changes</span></a>
315311
<li>
316312
<a href="#scroll-linked-animations-usecase"><span class="secno">2.3</span> <span class="content">Scroll-linked animations</span></a>
317313
<ol class="toc">
@@ -487,31 +483,8 @@ <h4 class="heading settled" data-level="2.1.2" id="navigation-highlight-effect">
487483
good. In the past we’ve talked about using snap points semantics but how
488484
exactly would that work here?</p>
489485
<h3 class="heading settled" data-level="2.2" id="scroll-triggered-style-changes-usecase"><span class="secno">2.2. </span><span class="content">Scroll-triggered style changes</span><a class="self-link" href="#scroll-triggered-style-changes-usecase"></a></h3>
490-
<h4 class="heading settled" data-level="2.2.1" id="fixed-menu-bar-usecase"><span class="secno">2.2.1. </span><span class="content">The fixed navigation bar</span><a class="self-link" href="#fixed-menu-bar-usecase"></a></h4>
491-
The content of displaying the menu bar is the commonplace web content.
492-
Usually, these menu bar is fixed always. But some content will want to fix menu bar when
493-
scrolling certain position.
494-
Here’s the example content for scroll-triggered based changing styles.
495-
This example has a menu bar on the right of content, and this content has a large title content.
496-
This position of navigation bar will be fixed after exceeding the certain scroll position.
497-
<p>Usually, we can implement using to the scroll event. However, If we use the @trigger rule, we can implement this more simply.</p>
498-
<figure>
499-
<img alt="Use case 2: Scroll based styling" src="img/usecase2.svg" width="600">
500-
<figcaption> Use case 2: Scroll based styling.<br> The left figure is before scroll, menubar’s position is not fixed.<br> The right figure is after scroll, menubar’s position is fixed. </figcaption>
501-
</figure>
502-
<p>If we use animation-trigger style sheet, this example code will be as follow:</p>
503-
<pre class="lang-css highlight"><span class="nt">div#menu-bar </span><span class="p">{</span>
504-
<span class="k">position</span><span class="p">:</span> relative<span class="p">;</span>
505-
<span class="k">top</span><span class="p">:</span> <span class="m">10</span><span class="l">px</span><span class="p">;</span>
506-
<span class="p">}</span>
507-
508-
<span class="n">@trigger</span> <span class="nf">scroll</span><span class="p">(</span><span class="nf">element</span><span class="p">(</span>#scrollableContent<span class="p">)</span><span class="p">,</span> vertical<span class="p">,</span> <span class="m">200</span><span class="l">px</span><span class="p">)</span> <span class="p">{</span>
509-
<span class="nt">#menu-bar </span><span class="p">{</span>
510-
<span class="k">position</span><span class="p">:</span> fixed<span class="p">;</span>
511-
<span class="k">top</span><span class="p">:</span> <span class="m">10</span><span class="l">px</span><span class="p">;</span>
512-
<span class="p">}</span>
513-
<span class="p">}</span>
514-
</pre>
486+
<p class="issue" id="issue-11adae5f"><a class="self-link" href="#issue-11adae5f"></a> Need a different use case here, the previous one could be done
487+
with ‘position: sticky’.</p>
515488
<h3 class="heading settled" data-level="2.3" id="scroll-linked-animations-usecase"><span class="secno">2.3. </span><span class="content">Scroll-linked animations</span><a class="self-link" href="#scroll-linked-animations-usecase"></a></h3>
516489
<h4 class="heading settled" data-level="2.3.1" id="scrollable-animation-usecase"><span class="secno">2.3.1. </span><span class="content">Scrollable picture-story show</span><a class="self-link" href="#scrollable-animation-usecase"></a></h4>
517490
There are many animation contents which used the 3rd vendor plugins. These content can detect scroll event, and this content has interactive animation.
@@ -1699,6 +1672,8 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
16991672
<div class="issue"> Specifying scroll offsets as percentages for this use case is not
17001673
good. In the past we’ve talked about using snap points semantics but how
17011674
exactly would that work here?<a href="#issue-b27fc5dc"></a></div>
1675+
<div class="issue"> Need a different use case here, the previous one could be done
1676+
with ‘position: sticky’.<a href="#issue-11adae5f"></a></div>
17021677
<div class="issue">
17031678
<p>Should the physical directions ("horizontal" and "vertical") be removed, leaving
17041679
only the logical directions ("block" and "inline")?</p>

0 commit comments

Comments
 (0)