-
Notifications
You must be signed in to change notification settings - Fork 247
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
Tech media queries sticky #389
Conversation
I was slighly puzzled by the focus on landscape vs. portrait - should the point not be that headers / footers should be made unstuck if the screen is too small to allow enough space for seeing the scrolling content? We are also moving into dangerous territory as having situations where only one orientation might be usable is in conflict with 1.3.4 Orientation (AA). |
I was also a bit puzzled about which SC this was supposed to be a sufficient technique for. As written, it seems to be for Orientation, but the requirement for Orientation is not that content needs to be transformed; just that it not be locked. |
Hi @detlevhfischer, @mbgower, @alastc, @mraccess77, @patrickhlauke, @DavidMacDonald and all others reading this Good remarks but doesn't make the solution more easy. Think we have to come up with the proper conditions first. Here a small overview of sticky so far: @detlevhfischer comments:
Yes, that's exactly what's needed if you do not specifically mean width of the screen in portrait mode (like a small mobile) (well not the screen is too small but the "left over visible area NOT being sticky" is too small, but ok... :-). After more thought this may be pretty hard to define as a general rule as this may be different for each and every site in all kind of different circumstances but we'll give it a try.
Can you give an example for this?
Not sure what you mean here, if I check the example out in Chrome dev tools and set device to iPhone5, iPad, Galaxy S5 etc. more than 70/80% of the screen is scrollable content?!
All information I've received so far was about the height / horizontal / landscape like issues with sticky headers. So zooming / narrower viewports was not the basis for this technique. I'm not saying you may have a good point here to have a good look at but this was not how the need for this technique was born. I'll provide a couple of examples later in this comment with the proper Github issues. @mbgower comments:
Yes, correct, it should be all about Reflow, but as you're both puzzled we need to adjust this technique so it will be clear what we mean / want and come up with proper criteria / conditions. @jake-abma My comments and references for this technique: The assignment / text for this technique can be seen at: https://www.w3.org/WAI/GL/wiki/Wcag21-techniques#Reflow The example shown previously from Patrick can be seen here: https://codepen.io/patrickhlauke/pen/RyOQZE and used "@media screen and (min-height: 20em)". Instead of height you may / can also use "portrait / landscape" which is more of a general approach while 20em is more specific and relies on what has been defined as the default size. Without the default size and some calculations the "portrait / landscape" seemed more clear as a technique. This was also supported by some comments from @mraccess77, not sure if this was by phone or in Github messages but Jon mentioned the sticky problem turned up when using mobile phones and using them in landscape mode for better reading purposes. Please correct me if I remembered wrong! @DavidMacDonald is also talking about landscape at: w3c/wcag21#850 The issue from @WayneEDick and the comment from @StommePoes is also about the height: w3c/wcag21#846 Sticky turns up here:
Conclusion: Sticky headers / footers are, or will be a burden when they take up too much space and the leftover scrollable area / content is not enough to easily read the text. Although we've talked a lot about height in previous issues it shouldn't matter if it is width or height. The exact condition for a technique need to be more clear to make sure it covers what we want here. Maybe more than one technique is needed to cover sticky headers / footers. Need to dive deeper into this topic with a fresh mind before I start adjusting the technique... |
Hi everyone, And thanks Jake for tackling this. A few notes from having been involved in the development of the reflow SC:
What I'd like to encourage with this is a progressive-enhancement approach, the main issues we've come across in testing are:
By progressive enhancement, I mean that the application of 'stickyness' or non-scrolling is enabled when there is sufficient space. For example, if a header is 100px tall and we assume that taking less than 25% of the vertical height is reasonable, then it should only stick if the height is 400px or greater. If the menu is 500px high, then it should only prevent scrolling when there is 500px vertical height available. In this way it doesn't matter what device is being used, it is about the content. Cheers, -Alastair |
Hi @alastc, thx for the inspect and suggestions, after my vacation will do the changes and techniques. Cheers! |
+1 |
2 similar comments
+1 |
+1 |
@detlevhfischer @alastc @mbgower / all, NEW OBJECTIVE:
Changed the example already and wondering if this suits the needs more... https://rawgit.com/w3c/wcag/example-css-sticky/working-examples/css-sticky/index.html In short there are just a couple of MQs at different sizes so:
Please provide feedback before I start to re-write the technique as this may change if the example is not sufficient. It may not cover all size scenarios but I think we're on the save side here. Cheers! |
Hi Jake, I wonder if it's possible to simplify even further? I'd suggest switching it around to more of a progressive enhancement approach, so:
So the objective is to only use the sticky header when there is sufficient vertical space. Or does it need to be the max-height verison to get the same effect? |
Yep, I just think it's slightly clearer, and maps to progressive-enhancement more easily. Doesn't make much difference in this case, but a good principle across the board. It should also help in the wording, 'have enough space to include a sticky element' rather than removing it when there isn't. |
Hi @alastc I can add another style for tablet landscape like:
and
This way we give a hint / idea to automatically get rid of the sticky part when in landscape mode. Do or Don't? |
Correction, made the following change:
and
Hope it's not too controversial, any case / edge case objections for this case? |
UPDATED: technique for sticky headers / footers, you can preview Sticky headers / footers, and there is an associated example page. Please Re-review... |
Yes, that'd make more sense i'd say
techniques don't have to be exhaustive / you don't really NEED to have techniques for any possible way of doing things. i'd say nowadays, media queries are likely the tool of choice for this sort of thing, rather than JS. (you can also do CSS MQs in JS with |
All the units are relative to something, so it really depends on what the content of the container is, and how it is laid out. If you set the container to 100px, then using a vertical height media query in PX makes sense. Whether text wraps is another matter, and not really the target of this technique. (Especially as setting the height in EM wouldn't prevent text-wrapping and increasing the height of the container. Making sure the background extends would solve that problem.)
Extending what Patrick said, each technique should be focused and clear. We can have another technique that's very similar, but for JavaScript. Given that it would be adjusting style properties, I think it's natural to start with a CSS one. |
Changed "height" to "min-height", scaling if fine now. Cheers! |
+1 I really love this example.
Wayne
…On Mon, Sep 17, 2018 at 11:27 PM Jake Abma ***@***.***> wrote:
Changed "height" to "min-height", scaling if fine now.
Cheers!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#389 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AH0OF3uQY1IuxB7S-woMNBj_pZU2x7K-ks5ucJJggaJpZM4U7La7>
.
|
Looks good to me. I cannot reproduce the situations where there was hardly any space for scollable content, not sure whether this is because the example changed or I am doing it differently now... |
Hi @detlevhfischer , in our case the content has enough space because the sticky header / footer are not that 'high', but when you'll have higher ones you'll end up with not enough space and only a narrow view left for the content. The technique shows what happens / sticky becoming UNsticked... but indeed the need in this example page might not be / seem that important. Would you say to have the header keep it's height at all times so the needs seems more clear? |
I'd say a header of substantial height make the need for getting it 'unstuck' more obvious - but the example works as it stands. |
adjusted the example to bigger headers and footers, will this be more clear? |
https://www.w3.org/2018/10/09-ag-minutes.html#item08
@alastc will you do the "It would be good to have a quick refinement on the text and check in with Jake to make sure we have not changed anything significant. "? Cheers! |
https://rawgit.com/w3c/wcag/tech-media-queries-sticky/techniques/css/media-queries-sticky.html changed CSS example to bigger header/footers / simplified |
Hi @jake-abma , I am in two minds about this: while I like short and succinct Techniques, I think there is perhaps an obligation to call out significant disadvantages of certain design patterns when they exist, such as those caused by the use sticky headers. Looking at this Technique, authors will otherwise implicity assume that using sticky headers is great if you just take care of un-sticking them. My suggestion for a re-formulation to include of a warning about issues brought upon uses by sticky headers would be this: Old:
Proposed change: Sticky regions always stay visible in the viewport while the other content will disappear underneath when scrolling. Note: Be aware that sticky regions can create disadvantages for keyboard users and should therefore be used judiciously. The problem for keyboard users tabbing through a page with a fixed header is that once the page has started to scroll, tabbing backwards to reach interactive elements higher up on the page will often mean that the focus becomes invisible once it moves behind the sticky header. Users must then scroll up to be able to see the focus - something they may not necessarily be aware of. In the same way, the visible focus can disappear behind a sticky footer, so users would need to scroll down to be able to see their focus position, which is a major inconvenience. |
Detlev: I wouldn't remove the bit about zoomed desktops-- developers who think only mobile who happen to have a dedicated mobile site separate from the "desktop" one would then miss that this is still relevant to them. |
@StommePoes Thanks Mallory, I have modified my recommended edit to reflect your concern. |
Great @detlevhfischer, changed! |
New technique for sticky headers / footers, you can preview Sticky headers / footers, and there is an associated example page.