This commit is contained in:
Jeremy Thomas 2016-12-23 13:20:13 +00:00
parent 919504dfea
commit bec6de6407
8 changed files with 40 additions and 122 deletions

View File

@ -1,11 +1,7 @@
<nav class="nav"> <nav class="nav">
<div class="nav-left"> <div class="nav-left">
<a class="nav-item is-brand" href="{{ site.url }}/"> <a class="nav-item is-brand" href="{{ site.url }}">
{% if page.route == 'index' %} <img src="{{ site.url }}/images/bulma-logo.png" alt="{{ site.title }}">
<img src="{{ site.url }}/images/bulma-type.png" alt="{{ site.title }}">
{% else %}
<img src="{{ site.url }}/images/bulma-type-white.png" alt="{{ site.title }}">
{% endif %}
</a> </a>
</div> </div>
@ -43,7 +39,7 @@
Blog Blog
</a> </a>
{% if page.route == 'index' %} {% if page.route != 'nothing' %}
<span class="nav-item"> <span class="nav-item">
<a id="twitter" <a id="twitter"
class="button" class="button"

View File

@ -3,13 +3,11 @@ layout: default
route: documentation route: documentation
--- ---
<section class="hero is-primary"> <div class="container">
<div class="hero-head"> {% include header.html %}
<div class="container"> </div>
{% include header.html %}
</div>
</div>
<section class="hero is-primary">
<div class="hero-body"> <div class="hero-body">
<div class="container"> <div class="container">
<div class="columns is-vcentered"> <div class="columns is-vcentered">

View File

@ -94,7 +94,7 @@ th {
} }
html { html {
background-color: whitesmoke; background-color: white;
font-size: 14px; font-size: 14px;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
@ -3714,6 +3714,13 @@ a.nav-item.is-tab.is-active {
padding-bottom: calc(0.5rem - 3px); padding-bottom: calc(0.5rem - 3px);
} }
@media screen and (min-width: 1000px) {
.nav-item a.is-brand,
a.nav-item.is-brand {
padding-left: 0;
}
}
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.nav-menu { .nav-menu {
background-color: white; background-color: white;
@ -3792,33 +3799,10 @@ a.nav-item.is-tab.is-active {
width: 100%; width: 100%;
} }
.nav > .container > .nav-left > .nav-item:first-child:not(.is-tab) {
padding-left: 0;
}
.nav > .container > .nav-right > .nav-item:last-child:not(.is-tab) {
padding-right: 0;
}
.container > .nav > .nav-left > .nav-item:first-child:not(.is-tab) {
padding-left: 0;
}
.container > .nav > .nav-right > .nav-item:last-child:not(.is-tab) {
padding-right: 0;
}
.nav.has-shadow { .nav.has-shadow {
box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1); box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1);
} }
@media screen and (max-width: 999px) {
.nav > .container > .nav-left > .nav-item.is-brand:first-child,
.container > .nav > .nav-left > .nav-item.is-brand:first-child {
padding-left: 1.5rem;
}
}
.pagination, .pagination,
.pagination-list { .pagination-list {
align-items: center; align-items: center;

View File

@ -24,6 +24,9 @@ doc-subtab: nav
<li><code>nav-center</code></li> <li><code>nav-center</code></li>
<li><code>nav-right</code></li> <li><code>nav-right</code></li>
</ul> </ul>
<p>
Each nav item needs to be wrapped in a <code>nav-item</code> element.
</p>
<p> <p>
For responsiveness, <strong>2 additional</strong> classes are available: For responsiveness, <strong>2 additional</strong> classes are available:
</p> </p>
@ -33,41 +36,45 @@ doc-subtab: nav
</ul> </ul>
</div> </div>
<div class="example"> {% capture nav_example %}
<nav class="nav"> <nav class="nav">
<div class="nav-left"> <div class="nav-left">
<a class="nav-item is-brand" href="#"> <a class="nav-item">
<img src="{{ site.url }}/images/bulma-type.png" alt="Bulma logo"> <img src="{{ site.url }}/images/bulma-type.png" alt="Bulma logo">
</a> </a>
</div> </div>
<div class="nav-center"> <div class="nav-center">
<a class="nav-item" href="#"> <a class="nav-item">
<span class="icon"> <span class="icon">
<i class="fa fa-github"></i> <i class="fa fa-github"></i>
</span> </span>
</a> </a>
<a class="nav-item" href="#"> <a class="nav-item">
<span class="icon"> <span class="icon">
<i class="fa fa-twitter"></i> <i class="fa fa-twitter"></i>
</span> </span>
</a> </a>
</div> </div>
<!-- This "nav-toggle" hamburger menu is only visible on mobile -->
<!-- You need JavaScript to toggle the "is-active" class on "nav-menu" -->
<span class="nav-toggle"> <span class="nav-toggle">
<span></span> <span></span>
<span></span> <span></span>
<span></span> <span></span>
</span> </span>
<!-- This "nav-menu" is hidden on mobile -->
<!-- Add the modifier "is-active" to display it on mobile -->
<div class="nav-right nav-menu"> <div class="nav-right nav-menu">
<a class="nav-item" href="#"> <a class="nav-item">
Home Home
</a> </a>
<a class="nav-item" href="#"> <a class="nav-item">
Documentation Documentation
</a> </a>
<a class="nav-item" href="#"> <a class="nav-item">
Blog Blog
</a> </a>
@ -78,7 +85,7 @@ doc-subtab: nav
</span> </span>
<span>Tweet</span> <span>Tweet</span>
</a> </a>
<a class="button is-primary" href="#"> <a class="button is-primary">
<span class="icon"> <span class="icon">
<i class="fa fa-download"></i> <i class="fa fa-download"></i>
</span> </span>
@ -87,63 +94,14 @@ doc-subtab: nav
</span> </span>
</div> </div>
</nav> </nav>
{% endcapture %}
<div class="example">
{{nav_example}}
</div> </div>
{% highlight html %} {% highlight html %}
<nav class="nav"> {{nav_example}}
<div class="nav-left">
<a class="nav-item is-brand" href="#">
<img src="{{ site.url }}/images/bulma-type.png" alt="Bulma logo">
</a>
</div>
<div class="nav-center">
<a class="nav-item" href="#">
<span class="icon">
<i class="fa fa-github"></i>
</span>
</a>
<a class="nav-item" href="#">
<span class="icon">
<i class="fa fa-twitter"></i>
</span>
</a>
</div>
<span class="nav-toggle">
<span></span>
<span></span>
<span></span>
</span>
<div class="nav-right nav-menu">
<a class="nav-item" href="#">
Home
</a>
<a class="nav-item" href="#">
Documentation
</a>
<a class="nav-item" href="#">
Blog
</a>
<span class="nav-item">
<a class="button" >
<span class="icon">
<i class="fa fa-twitter"></i>
</span>
<span>Tweet</span>
</a>
<a class="button is-primary" href="#">
<span class="icon">
<i class="fa fa-download"></i>
</span>
<span>Download</span>
</a>
</span>
</div>
</nav>
{% endhighlight %} {% endhighlight %}
<hr> <hr>

View File

@ -40,7 +40,7 @@ doc-subtab: variables
<li> <li>
<strong>Generated variables</strong> where variables are <strong>calculated</strong> from the values set in the previous file. For example, you can have: <strong>Generated variables</strong> where variables are <strong>calculated</strong> from the values set in the previous file. For example, you can have:
<ul> <ul>
<li><code>$body-background: $grey-lighter</code>: the page's main background is the lighter grey</li> <li><code>$body-background: $white</code>: the page's main background</li>
<li><code>$link: $primary</code>: the links use the primary color</li> <li><code>$link: $primary</code>: the links use the primary color</li>
<li><code>$family-primary: $family-sans-serif</code>: the primary font family is the sans-serif one</li> <li><code>$family-primary: $family-sans-serif</code>: the primary font family is the sans-serif one</li>
</ul> </ul>

BIN
docs/images/bulma-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -54,6 +54,10 @@ a.nav-item
border-bottom: 3px solid $primary border-bottom: 3px solid $primary
color: $primary color: $primary
padding-bottom: calc(0.5rem - 3px) padding-bottom: calc(0.5rem - 3px)
// Responsiveness
+desktop
&.is-brand
padding-left: 0
// Containers // Containers
@ -120,26 +124,6 @@ a.nav-item
display: flex display: flex
min-height: $nav-height min-height: $nav-height
width: 100% width: 100%
& > .nav-left
& > .nav-item:first-child:not(.is-tab)
padding-left: 0
& > .nav-right
& > .nav-item:last-child:not(.is-tab)
padding-right: 0
.container > &
& > .nav-left
& > .nav-item:first-child:not(.is-tab)
padding-left: 0
& > .nav-right
& > .nav-item:last-child:not(.is-tab)
padding-right: 0
// Modifiers // Modifiers
&.has-shadow &.has-shadow
box-shadow: 0 2px 3px rgba($black, 0.1) box-shadow: 0 2px 3px rgba($black, 0.1)
// Responsiveness
+touch
& > .container,
.container > &
& > .nav-left
& > .nav-item.is-brand:first-child
padding-left: 1.5rem

View File

@ -85,8 +85,6 @@ $light-invert: $dark !default
$dark-invert: $light !default $dark-invert: $light !default
// General colors // General colors
$body-background: $white-ter !default
$background: $white-ter !default $background: $white-ter !default
$border: $grey-lighter !default $border: $grey-lighter !default