Skip to content

Commit

Permalink
Add documentation tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
jgthms committed Jul 12, 2018
1 parent fcaea07 commit 5a47885
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/_data/links.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"path": "/documentation/overview"
},
"overview-start": {
"name": "Getting started",
"name": "Start",
"subtitle": "You only need <strong>1 CSS file</strong> to use Bulma",
"color": "danger",
"icon": "rocket",
Expand All @@ -31,7 +31,7 @@
"path": "/documentation/overview/customize"
},
"overview-classes": {
"name": "CSS Classes",
"name": "Classes",
"subtitle": "Bulma is simply a <strong>collection</strong> of CSS classes. Write the HTML code you want.",
"color": "link",
"icon_brand": "true",
Expand Down
19 changes: 19 additions & 0 deletions docs/_layouts/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@ <h1 class="title">
</div>
</header>

{% if page.hide_tabs %}
<hr style="margin: 0 0 3rem;">
{% else %}
<nav class="bd-tabs">
<div class="tabs">
<ul>
{% for link_id in category_links %}
{% assign link = site.data.links.by_id[link_id] %}
<li {% if link_id == current_link_id %}class="is-active"{% endif %}>
<a href="{{ site.url }}{{ link.path }}">
{{ link.name }}
</a>
</li>
{% endfor %}
</ul>
</div>
</nav>
{% endif %}

<div class="bd-content">
{{ content }}
</div>
Expand Down
20 changes: 17 additions & 3 deletions docs/_sass/main.sass
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,30 @@
margin-left: auto

.bd-header
border-bottom: 2px solid $background
margin-bottom: $main-spacing
padding-bottom: $main-spacing
.subtitle
color: $text-light
strong
color: currentColor
#meta
margin-top: -0.5rem

.bd-tabs
margin-bottom: $main-spacing
.tabs
overflow: visible
ul,
a
border-bottom-color: $white-ter
border-bottom-width: 2px
ul
flex-wrap: wrap
max-width: 100%
a
margin-bottom: -2px
li:not(.is-active) a:hover
border-bottom-color: $border

.bd-content
hr:first-child
display: none
Expand Down Expand Up @@ -195,7 +209,7 @@
.bd-header
align-items: center
display: flex
min-height: 130px
min-height: 140px
.bd-header-titles
flex-grow: 1
flex-shrink: 1
Expand Down
2 changes: 1 addition & 1 deletion docs/bulma-docs.sass
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $carbon-width: 300px
$carbon-height: 100px
$main-spacing: 3rem
$intro-width: 1080px
$sidebar-width: 14rem
$sidebar-width: 10.5rem

@import "../bulma"

Expand Down
35 changes: 30 additions & 5 deletions docs/css/bulma-docs.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/css/bulma-docs.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/documentation/columns.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Columns
layout: documentation
doc-tab: columns
hide_tabs: true
breadcrumb:
- home
- documentation
Expand Down
1 change: 1 addition & 0 deletions docs/documentation/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Components
layout: documentation
doc-tab: components
hide_tabs: true
breadcrumb:
- home
- documentation
Expand Down
1 change: 1 addition & 0 deletions docs/documentation/elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Elements
layout: documentation
doc-tab: elements
hide_tabs: true
breadcrumb:
- home
- documentation
Expand Down
1 change: 1 addition & 0 deletions docs/documentation/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Form
layout: documentation
doc-tab: form
hide_tabs: true
breadcrumb:
- home
- documentation
Expand Down
1 change: 1 addition & 0 deletions docs/documentation/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Layout
layout: documentation
doc-tab: layout
hide_tabs: true
breadcrumb:
- home
- documentation
Expand Down
1 change: 1 addition & 0 deletions docs/documentation/modifiers.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Modifiers
layout: documentation
doc-tab: modifiers
hide_tabs: true
breadcrumb:
- home
- documentation
Expand Down
1 change: 1 addition & 0 deletions docs/documentation/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Overview
layout: documentation
doc-tab: overview
hide_tabs: true
breadcrumb:
- home
- documentation
Expand Down

0 comments on commit 5a47885

Please sign in to comment.