Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Style active section #26

Open
briankoser opened this issue Jan 22, 2014 · 1 comment
Open

Style active section #26

briankoser opened this issue Jan 22, 2014 · 1 comment

Comments

@briankoser
Copy link
Owner

{% capture location %}{{ page.url | remove_first:'/' | split:'/' | first }}{% endcapture %}
<nav><ul>
<li><a {% if location == 'about' %}class="active" {% endif %}href="/about/">About</a></li>
<li><a {% if location == 'projects' %}class="active" {% endif %}href="/projects/">Projects</a></li>
<li><a {% if location == 'blog' %}class="active" {% endif %}href="/blog/">Blog</a></li>
<li><a {% if location == 'contact' %}class="active" {% endif %}href="/contact/">Contact</a></li>
@briankoser
Copy link
Owner Author

Add .active-link to CSS:

a:hover,
    .active-link {
        -webkit-transition: border-bottom-width 300ms cubic-bezier(1, 0, 0, 1);
                transition: border-bottom-width 300ms cubic-bezier(1, 0, 0, 1);
        border-bottom: solid 3px #006b9f;
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant