Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
120 Skiplinks #303
120 Skiplinks #303
Changes from 2 commits
75e451d
1ce3a10
d2c2216
4677e80
72ff666
f9f4154
ba16369
851fc21
b213cf5
cb6d067
200c5ea
f8ff360
67221eb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't this extend the helper classes,
.su-sr-only-element
or.su-sr-only-text
, or include the mixins,hide-visually
,hide-text
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can. The approach here, though, is a little bit different than that of what those two mixins (or related classes) do. I used Homesite as an example of an approach and aimed to mirror that implementation, which only "hides" something from print, but does not leverage nor extend the Bourbon mixins (hiding the element or the text).
While
@include hide-visually;
and@include hide-visually("unhide");
for hover and focus states might get us something similar as far as behavior, it would be a slight shift from what Homesite is doing, I believe.Related: I noticed that Homesite had a
_placeholders.scss
file that has a primary purpose of being available for extended code. If we do want to use extends here (or in the future), we might want to consider doing something similar.https://code.stanford.edu/ucomm/homesite-2017/blob/master/wp-content/themes/homesite17/scss/base/_placeholders.scss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know specifically what would be different if we used
hide-visually
? Is it the animation of having the skip links drop down fromtop:-500px
?I'm ok with this as is. I was just curious why we're not using the utilities that were updated as part of this PR.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a wrapper around this? Isn't the idea that this link be placed as the first element after the body tag? If that is so, I would recommend removing or changing the
<header>
tag as to not compete with other header elements right after the body tag.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - this has been removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id's are hard and don't really belong in a pattern library. There is no way to ensure that the next developer's software doesn't or does have a main-content id. Unfortunately, for this functionality, we need one. I would suggest opening up the anchor link to a twig variable and perhaps generate a random id if one is not provided.
Example not tested*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to have the target in this template file? It won't be directly usable if this main markup is here. I am assuming this is an example. I would like to see a directly usable option as well as the demo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sherakama is your recommendation that the twig template only include the following?
And, then, perhaps add example markup directly to the SCSS file, something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think skiplinks are a special snowflake. They are, by definition, not self-contained. I don't believe there's anyway to get them to work with a single twig file.
Since they'll require the user to create custom markup anyway, I vote for having all the necessary pieces in our
.twig
file, and document how users need to use each piece. I would therefore vote for restoring the<header>
wrapper around the link itself, since it demonstrates the recommended placement for the link.