Comments

lewisnyman’s picture

StatusFileSize
new818 bytes

Uploaded the css file so it can reviewed with Dreditor

lewisnyman’s picture

Issue summary: View changes
joaogarin’s picture

StatusFileSize
new488 bytes

Only found this line break at the end of :

.skip-link.visually-hidden.focusable:hover,
.skip-link.visually-hidden.focusable:focus,
.skip-link.visually-hidden.focusable:active

joaogarin’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: seven-skiplink-2408475-3.patch, failed testing.

Status: Needs work » Needs review
lewisnyman’s picture

Status: Needs review » Needs work
  1. .skip-link,
    .skip-link:link,
    .skip-link:visited {
    

    I think we might be able to remove these :link and :visited selectors, as .skip-link should be strong enough to override the 'a' selector. That means we can merge these two blocks together

  2. .skip-link:hover,
    .skip-link:focus,
    .skip-link:active {
      outline: 0;
    }
    

    We can remove these lines and just add the outline: 0 property to the .skip-link selector

joaogarin’s picture

StatusFileSize
new1.08 KB

Think it works like this?

skip-link rule might be a bit crowded but the file looks more clean.

joaogarin’s picture

Status: Needs work » Needs review
lewisnyman’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new300.39 KB

Thanks for the work, unfortunately I found one or two issues, this is what the skip link looks like now:

It seems like we should move text-decoration: none under a skip-link:focus so it overrides it correctly. CSSlint is also saying that we should only remove outline on :focus selectors, although I'm not sure why. If we are having a :focus selector anyway I don't see the harm in moving it down.

Does that make sense?

lewisnyman’s picture

Also:
1. The comment at the top of the file needs a @file tag, see: https://www.drupal.org/coding-standards/docs#file
2. It needs a blank line after the comment

joaogarin’s picture

Hello,

Here is the patch. Maybe on the @file tag there should be a more intuitive explanation about what the skiplink is? Thanks for your patience;)

joaogarin’s picture

Status: Needs work » Needs review
lewisnyman’s picture

Status: Needs review » Needs work

Maybe on the @file tag there should be a more intuitive explanation about what the skiplink is?

Yeah that sounds like a good idea :) Maybe something like: "Allows keyboard users to quickly skip to the main content of the page"

joaogarin’s picture

Status: Needs work » Needs review
StatusFileSize
new1.34 KB

Hello,

Here is a new patch with a better info on the @file tag.

joaogarin’s picture

StatusFileSize
new1.34 KB

Added a missing full stop in the end of the comment.

idebr’s picture

Status: Needs review » Needs work

@joaoagarin Thanks for working on this! It's looking much cleaner already :)

  1. +++ b/core/themes/seven/css/components/skip-link.css
    @@ -1,6 +1,8 @@
       margin-top: 0;
    

    The skip-link has no margin-top by default, so this attribute can be removed.

  2. +++ b/core/themes/seven/css/components/skip-link.css
    @@ -8,35 +10,24 @@
       display: inline-block;
    

    An element that has position: absolute is always treated as display: block;, so this attribute can be removed.

  3. +++ b/core/themes/seven/css/components/skip-link.css
    @@ -8,35 +10,24 @@
       padding: 1px 10px 2px 10px; /* LTR */
    

    This padding looks identical on LTR and RTL, so the RTL styling and the /* LTR */ comment can be removed.

  4. +++ b/core/themes/seven/css/components/skip-link.css
    @@ -8,35 +10,24 @@
       outline: 0;
    

    The outline: 0; is already inherited by a:focus { outline: 0; }, so this can be removed as well.

  5. In the Bartik equivalent of this cleanup, we replaced the positioning of the skip-link with a transform: translateX(-50%); since the margin-left only makes an approximation. This approach has identical results on LTR and RTL, so all related RTL styling can be removed as well.
idebr’s picture

joaogarin’s picture

Hello,

Thanks for the info. I will provide another patch as soon as possible. Probably tonight or so!I haven't forgotten this;P

joaogarin’s picture

Status: Needs work » Needs review
StatusFileSize
new1.38 KB

Hello I am putting up a patch with these changes. I haven't yet tried the approach with CSS transform. I will try it out later in the night if I get some time on it.

joaogarin’s picture

StatusFileSize
new251.33 KB

Just providing a screenshot how it looks now.

idebr’s picture

Status: Needs review » Needs work
Issue tags: +Novice

@joaogarin Thanks for working on this! I did a manual test and found a few more things that should be fixed before this can be committed:

  1. +++ b/core/themes/seven/css/components/skip-link.css
    @@ -1,42 +1,29 @@
    + * Skip link - Allows keyboard users to quickly skip to the main content of the page.
    

    A line in a comment should be no longer than 80 characters.

  2. +++ b/core/themes/seven/css/components/skip-link.css
    @@ -1,42 +1,29 @@
       position: absolute;
    

    This attribute is inherited from .visually-hidden, so it can be removed safely from this selector.

  3. +++ b/core/themes/seven/css/components/skip-link.css
    @@ -1,42 +1,29 @@
       margin-left: -5.25em; /* LTR */
    

    Let's replace the negative margin with a transform: translateX(-50%) like the similar issue in Bartik: #2409069: Clean up the "skip-link" component in Bartik. This approach has identical results on LTR and RTL, so all related RTL styling and comments can be removed as well.

  4. +++ b/core/themes/seven/css/components/skip-link.css
    @@ -1,42 +1,29 @@
       width: auto;
    

    This is the default value for width, so this attribute can be removed.

  5. +++ b/core/themes/seven/css/components/skip-link.css
    @@ -1,42 +1,29 @@
    +  padding: 1px 10px 2px 10px;
    

    The last 10px is inferred, so this can be written as shorthand, eg. padding: 1px 10px 2px;

  6. +++ b/core/themes/seven/css/components/skip-link.css
    @@ -1,42 +1,29 @@
     .skip-link.visually-hidden.focusable:hover,
     .skip-link.visually-hidden.focusable:focus,
    -.skip-link.visually-hidden.focusable:active
    -{
    +.skip-link.visually-hidden.focusable:active {
    

    This :focus state is the only applicable state, so the selectors for :hover and :active can be removed.

pjbaert’s picture

Assigned: Unassigned » pjbaert

I'll grab this

pjbaert’s picture

Assigned: pjbaert » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.49 KB
new1.14 KB

I updated the lines @idebr mentioned

pjbaert’s picture

StatusFileSize
new1.42 KB
new1.16 KB

Deleted one more reference to RTL

lewisnyman’s picture

Status: Needs review » Needs work

Great thanks! I manually tested this and it looks good on LTR and RTL. One tiny nitpick:

+++ b/core/themes/seven/css/components/skip-link.css
@@ -1,42 +1,23 @@
- * Skip link.
+ * @file
+ * Skip link - Allows keyboard users to skip to the main content of the page.

I think the description belongs on a separate line to the title, see the Doxygen standards

pjbaert’s picture

Status: Needs work » Needs review
StatusFileSize
new1.43 KB

Updated
The description is now on a different line.

lewisnyman’s picture

Status: Needs review » Reviewed & tested by the community

Nice one! Thanks.

idebr’s picture

+1, thanks @pjbaert!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Something is broken here - if I have toolbar enabled and I tab through the focusable elements on the page the skip link does not appear.

idebr’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new5.41 KB
new4.5 KB
new6.18 KB

I'm unable to reproduce the issue reported by @alexpott:

Windows Google Chrome:

Windows Firefox:

Windows IE11:

pjbaert’s picture

+1
I did have another look at it but I can't seem to reproduce the bug @alexpott suggests.

lewisnyman’s picture

How about with the toolbar menu set to vertical display?

idebr’s picture

Same thing:

Windows Google Chrome:

Windows Firefox:

Windows IE11:

lewisnyman’s picture

Status: Needs review » Reviewed & tested by the community

hmm ok, in that case setting back to RTBC and maybe Alex can give us some more information.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Found out why! If you turn off javascript then the "skip to main content" does not appear in chrome (os x). Regardless of javascript being on I can not get it to appear in Firefox (os x). But this is due to:

In Firefox, type "about:config" in the URL bar. There is no accessibility.tabfocus preference on the mac, so you'll have to make one. Right click in the window, create a new "integer" pref, and set it to 7.

see https://stackoverflow.com/questions/11704828/how-to-allow-keyboard-focus...

So I think we should get a follow up to fix the fact that with toolbar and no javascript the skip to main content tab is hidden.

CSS is not frozen in beta. Committed 5cd98c4 and pushed to 8.0.x. Thanks!

  • alexpott committed 5cd98c4 on 8.0.x
    Issue #2408475 by joaogarin, pjbaert: Rewrite skip-link component inline...
idebr’s picture

Thanks @aloxpott! I had that option enabled for so long I had forgotten it existed at all.

I created a followup for the skip-link being invisible with the toolbar enabled but without javascript at #2449539: Skip link not visible without javascript

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.