Skip to content

Commit

Permalink
Simplify footer styling
Browse files Browse the repository at this point in the history
- Remove unnecessary over-qualified CSS selectors, e.g. `ul.footer-nav`.
- Wrap navigation items in a proper `nav` element, which maps to the
  navigation role in the accessibility tree.
- Remove unnecessary `article` element.
- Consistently use double quotes.
  • Loading branch information
tysongach committed Jun 2, 2017
1 parent ec0c8f9 commit 89dc293
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 43 deletions.
26 changes: 8 additions & 18 deletions app/assets/stylesheets/components/_footer.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
footer {
padding: 4em 1em;
.app-footer {
padding: $large-spacing $base-spacing;
text-align: center;
}

ul.footer-nav {
margin-bottom: 4em;

li {
display: inline-block;
.app-footer__nav {
margin-bottom: $base-spacing;
}

~ li::before {
border-left: 1px solid $base-border-color;
content: "";
display: inline-block;
height: 1em;
margin-left: 0.5em;
padding-left: 0.5em;
vertical-align: middle;
}
}
}
.app-footer__nav-link:not(:first-of-type) {
margin-left: $base-spacing;
}
54 changes: 29 additions & 25 deletions app/views/application/_footer.haml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
%footer
%ul.footer-nav
%li
= link_to "Source Code", "https://github.com/houndci/hound"
%li
= link_to "FAQ", "https://intercom.help/hound/frequently-asked-questions"
%li
= link_to "Terms", "https://github.com/houndci/hound/blob/master/doc/TERMS.md"
%li
= link_to "Privacy", "https://github.com/houndci/hound/blob/master/doc/PRIVACY.md"
%li
= link_to "Security", "https://github.com/houndci/hound/blob/master/doc/SECURITY.md"
%footer.app-footer{ role: "contentinfo" }
%nav.app-footer__nav
= link_to "Source Code",
"https://github.com/houndci/hound",
class: "app-footer__nav-link"
= link_to "FAQ",
"https://intercom.help/hound/frequently-asked-questions",
class: "app-footer__nav-link"
= link_to "Terms",
"https://github.com/houndci/hound/blob/master/doc/TERMS.md",
class: "app-footer__nav-link"
= link_to "Privacy",
"https://github.com/houndci/hound/blob/master/doc/PRIVACY.md",
class: "app-footer__nav-link"
= link_to "Security",
"https://github.com/houndci/hound/blob/master/doc/SECURITY.md",
class: "app-footer__nav-link"

%article.legal
%p
Hound is maintained by #{link_to 'thoughtbot', 'http://thoughtbot.com'}.
Questions? Try the
#{link_to "FAQ", "https://intercom.help/hound/frequently-asked-questions"}
or Tweet
#{link_to "@houndci", "https://twitter.com/houndci", new_window_options}.
%p
Hound is maintained by #{link_to "thoughtbot", "https://thoughtbot.com/"}.
Questions? Try the
#{link_to "FAQ", "https://intercom.help/hound/frequently-asked-questions"}
or tweet
#{link_to "@houndci", "https://twitter.com/houndci", new_window_options}.

%p
Hound is Copyright © #{Date.today.year} thoughtbot. It is open source
software and may be redistributed under the terms specified in the
#{link_to "LICENSE", "https://github.com/houndci/hound/blob/master/LICENSE"}.
%p
Hound is Copyright © #{Date.today.year} thoughtbot. It is open source
software and may be redistributed under the terms specified in the
#{link_to "license", "https://github.com/houndci/hound/blob/master/LICENSE"}.

%p
The names and logos for Hound are trademarks of thoughtbot.
%p
The names and logos for Hound are trademarks of thoughtbot.

0 comments on commit 89dc293

Please sign in to comment.