mirror of
https://github.com/Chalarangelo/mini.css.git
synced 2025-02-22 08:02:22 +01:00
Navigation header documentation
This commit is contained in:
parent
aba435f11a
commit
a5a56f38bb
2
dist/mini-default.css
vendored
2
dist/mini-default.css
vendored
@ -547,6 +547,8 @@ header {
|
||||
box-shadow: none; }
|
||||
header button:hover, header button:active, header button:focus, header [type="button"]:hover, header [type="button"]:active, header [type="button"]:focus, header a.button:hover, header a.button:active, header a.button:focus, header label.button:hover, header label.button:active, header label.button:focus, header .button:hover, header .button:active, header .button:focus {
|
||||
background: #37474f; }
|
||||
header > span:not(.logo) {
|
||||
vertical-align: super; }
|
||||
header .logo, header a.button {
|
||||
text-decoration: none; }
|
||||
|
||||
|
2
dist/mini-default.min.css
vendored
2
dist/mini-default.min.css
vendored
File diff suppressed because one or more lines are too long
@ -523,3 +523,6 @@
|
||||
- Tweaked colors and values of other things in the `navigation` module's variables in the flavor file.
|
||||
- Updated `navigation` module with optimization and borders.
|
||||
- Updated all `box-shadow` variable checks to test for `none` instead of `0` as that is the proper syntax used for no shadows. This will help with user-friendliness in customization.
|
||||
- Added some extra styling to the `header` component, allowing `span` elements to be used as separators between links.
|
||||
- Added defaults to header at the very top.
|
||||
- Added description for the `header` component in the `navigation` doc page.
|
||||
|
@ -129,6 +129,7 @@
|
||||
<a href="#" class="logo">Logo</a>
|
||||
<button>Home</button>
|
||||
<a href="#" class="button">News</a>
|
||||
<span>|</span>
|
||||
<button>About</button>
|
||||
<button>Contact</button>
|
||||
</header>
|
||||
@ -136,26 +137,45 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-sm-first col-md-8 col-md-normal">
|
||||
<p></p>
|
||||
<p>The <code><header></code> HTML element is used for a page's top horizontal navigation menu. It can contain a unique <code>.logo</code> element as its first child (this structure is not mandatory, but still recommended as a best practice), which can be either text (with or without a link) or an image. The rest of the elements inside the <code><header></code> must be <code><button></code>, <code><label class="button"></code> or <code><a class="button"></code> elements in order to be styled properly. Textual separators between those can be added using <code><span></code> elements.</p>
|
||||
<h3>Sample code</h3>
|
||||
<pre></pre>
|
||||
<pre><header>
|
||||
<a href="#" class="logo">Logo</a>
|
||||
<button>Home</button>
|
||||
<a href="#" class="button">News</a>
|
||||
<span>|</span>
|
||||
<button>About</button>
|
||||
<button>Contact</button>
|
||||
</header></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h3>Notes</h3>
|
||||
<ul>
|
||||
<li></li>
|
||||
<li></li>
|
||||
<li>The <code><header></code> element is partially responsive on smaller screen devices. More specifically, when the content inside it exceeds the width of the viewport (ie. overflows to the right), users will be able to scroll horizontally in order to see the rest of the menu.</li>
|
||||
<li>The <code><header></code> element does not display as <code class="fore-tertiary">fixed</code> by default. You can, however, alter this CSS property manually, if you so desire.</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-6 col-lg-4">
|
||||
<pre><!-- do code --></pre>
|
||||
<p class="do"><mark class="tertiary">Do:</mark> </p>
|
||||
<div class="col-sm-12 col-md-6">
|
||||
<pre><header>
|
||||
<a href="#" class="logo">Logo</a>
|
||||
<button>Action 1</button>
|
||||
<a href="#" class="button">Action 2</a>
|
||||
<label class="button">Action 3</label>
|
||||
</header></pre>
|
||||
<p class="do"><mark class="tertiary">Do:</mark> You can mix different elements styled like buttons inside a <code><header></code> element. In fact, we strongly recommend doing so, if you need to.</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-6 col-sm-last col-md-normal col-lg-4 col-lg-last">
|
||||
<pre><!-- don't code --></pre>
|
||||
<p class="dont"><mark class="secondary">Don't:</mark> </p>
|
||||
<div class="col-sm-12 col-md-6 col-sm-last col-md-normal">
|
||||
<pre><header>
|
||||
<a href="#" class="button logo">Logo</a>
|
||||
</header>
|
||||
<span class="fore-secondary"><!-- or --></span>
|
||||
<header>
|
||||
<a href="#" class="logo">Logo</a>
|
||||
<a href="#">Link</a>
|
||||
</header></pre>
|
||||
<p class="dont"><mark class="secondary">Don't:</mark> The <code>.logo</code> element should not be a <code><button></code> or a <code>.button</code> element. On the other hand, links and labels in the <code><header></code> should not be without a <code>.button</code> class. Ignoring this rule might cause unexpected behavior.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,6 +1,8 @@
|
||||
// Definitions for navigation elements.
|
||||
// Different elements are styled based on the same set of rules.
|
||||
// Header styling.
|
||||
$button-class-name: 'button' !default; // Class name for the button-like elements
|
||||
$header-logo-name: 'logo' !default; // Class name for <header>'s logo
|
||||
header {
|
||||
display: block; // Correct display for older versions of IE.
|
||||
height: $header-height;
|
||||
@ -22,7 +24,7 @@ header {
|
||||
@if $header-box-shadow != none {
|
||||
box-shadow: $header-box-shadow;
|
||||
}
|
||||
// Reposnivenes for smaller displays, scrolls horizontally.
|
||||
// Resposniveness for smaller displays, scrolls horizontally.
|
||||
white-space: nowrap;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
@ -60,6 +62,9 @@ header {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
> span:not(.#{$header-logo-name}) { // Style separators' vertical alignment.
|
||||
vertical-align: super;
|
||||
}
|
||||
@if $apply-link-underline { // Override for links if underline is enabled.
|
||||
.#{$header-logo-name}, a.#{$button-class-name} {
|
||||
text-decoration: none;
|
||||
|
Loading…
x
Reference in New Issue
Block a user