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
Add side navigation variant with icons on the left #2932
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
templates/docs/examples/patterns/side-navigation/icons.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{% extends "_layouts/examples.html" %} | ||
{% block title %}Side navigation / With icons{% endblock %} | ||
|
||
{% block standalone_css %}patterns_side-navigation{% endblock %} | ||
|
||
{% block content %} | ||
<div class="p-side-navigation--icons"> | ||
<ul class="p-side-navigation__list"> | ||
<li class="p-side-navigation__item"> | ||
<a class="p-side-navigation__link is-active" href="#"><i class="p-icon--information p-side-navigation__icon"></i>Information</a> | ||
</li> | ||
<li class="p-side-navigation__item"> | ||
<a class="p-side-navigation__link" href="#"><i class="p-icon--user p-side-navigation__icon"></i>Users</a> | ||
<ul class="p-side-navigation__list"> | ||
<li class="p-side-navigation__item"> | ||
<a class="p-side-navigation__link" href="#">Anna von Example</a> | ||
</li> | ||
<li class="p-side-navigation__item "> | ||
<a class="p-side-navigation__link" href="#">Bob Anonymous</a> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="p-side-navigation__item "> | ||
<a class="p-side-navigation__link" href="#"> | ||
<i class="p-icon--help p-side-navigation__icon"></i> | ||
Get help | ||
<span class="p-side-navigation__status"> | ||
<span class="p-label--updated">Updated</span> | ||
</span> | ||
</a> | ||
</li> | ||
</ul> | ||
<ul class="p-side-navigation__list"> | ||
<li class="p-side-navigation__item"> | ||
<a class="p-side-navigation__link" href="#">Release notes</a> | ||
</li> | ||
<li class="p-side-navigation__item"> | ||
<a class="p-side-navigation__link" href="#">Contribute</a> | ||
</li> | ||
<li class="p-side-navigation__item"> | ||
<a class="p-side-navigation__link" href="#">Contact us</a> | ||
<ul class="p-side-navigation__list"> | ||
<li class="p-side-navigation__item"> | ||
<a class="p-side-navigation__link" href="#">IRC channel</a> | ||
</li> | ||
<li class="p-side-navigation__item"> | ||
<a class="p-side-navigation__link" href="#">Discourse forum</a> | ||
</li> | ||
<li class="p-side-navigation__item"> | ||
<a class="p-side-navigation__link" href="#">Contact form</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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 the levels should be configurable when you invoke the mixin; many sites won't need 3 levels, and some might need 5; my proposal: @mixin p-side-navigation($depth: 3)
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.
Feels a bit overkill.
The design was discussed many times and it seems for now we barely have examples that would use all 3 level of navigation. If anything really needs more nesting we could add it later.
Also nesting is just 2 not very long rules (4 precisely if you count
--icons
variant), so there is no much benefit in file size to reduce it to just one.The complexity of adding configurable mixin that probably no one will use doesn't seem worth it. It doesn't seem like we do anything like this anywhere else.
While flexibility and ability to configure things is great it comes with cost of maintenance and ease of use.
I guess the biggest problem we are trying to solve with Vanilla is to keep our products consistent, so lets start with good default variants of components. If anything different is needed we can consider it on case by case basis.