Skip to content

Commit a6c0404

Browse files
committed
ADD: Nav for vertical list
1 parent 48f0d7e commit a6c0404

File tree

4 files changed

+104
-6
lines changed

4 files changed

+104
-6
lines changed

dist/spectre.css

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,8 @@ textarea.form-input {
20092009
}
20102010
.breadcrumb,
20112011
.tab,
2012-
.pagination {
2012+
.pagination,
2013+
.nav {
20132014
list-style: none;
20142015
margin: .5rem 0;
20152016
}
@@ -2086,18 +2087,45 @@ textarea.form-input {
20862087
.pagination .page-item a {
20872088
border-radius: .2rem;
20882089
color: #333;
2089-
display: inline-block;
20902090
padding: .6rem .8rem;
20912091
text-decoration: none;
20922092
}
20932093
.pagination .page-item a:focus,
20942094
.pagination .page-item a:hover {
2095+
background: #eff1fa;
20952096
color: #5764c6;
20962097
}
20972098
.pagination .page-item.active a {
20982099
background: #5764c6;
20992100
color: #fff;
21002101
}
2102+
.nav {
2103+
display: flex;
2104+
display: -ms-flexbox;
2105+
display: -webkit-flex;
2106+
-webkit-flex-direction: column;
2107+
-ms-flex-direction: column;
2108+
flex-direction: column;
2109+
}
2110+
.nav .nav-item a {
2111+
border-radius: .2rem;
2112+
color: #333;
2113+
padding: .6rem .8rem;
2114+
text-decoration: none;
2115+
}
2116+
.nav .nav-item a:focus,
2117+
.nav .nav-item a:hover {
2118+
color: #5764c6;
2119+
}
2120+
.nav .nav-item.active a {
2121+
color: #5764c6;
2122+
}
2123+
.nav .nav {
2124+
margin-left: 2rem;
2125+
}
2126+
.nav .nav a {
2127+
color: #808080;
2128+
}
21012129
.modal {
21022130
-webkit-align-items: center;
21032131
align-items: center;

dist/spectre.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2241,7 +2241,7 @@ <h6>Korean</h6>
22412241
<section id="navigation" class="container grid-960">
22422242
<header class="text-center"><h4>navigation</h4></header>
22432243
<section class="notes">
2244-
<p><strong>Navigation</strong> includes several components, including breadcrumbs, tabs and pagination.</p>
2244+
<p><strong>Navigation</strong> includes several components, including breadcrumbs, tabs, pagination and nav.</p>
22452245
</section>
22462246
<header id="breadcrumbs" class="text-center"><h5>breadcrumbs</h5></header>
22472247
<div class="columns">
@@ -2518,6 +2518,44 @@ <h6>Korean</h6>
25182518
&lt;<span class="tag">/ul</span>&gt;
25192519
</pre>
25202520

2521+
<header id="nav" class="text-center"><h5>nav</h5></header>
2522+
<div class="columns">
2523+
<div class="column col-6 col-xs-12">
2524+
<ul class="nav">
2525+
<li class="nav-item">
2526+
<a href="#nav">Elements</a>
2527+
</li>
2528+
<li class="nav-item">
2529+
<a href="#nav"><strong>Layout</strong></a>
2530+
<ul class="nav">
2531+
<li class="nav-item">
2532+
<a href="#nav">flexbox-grid</a>
2533+
</li>
2534+
<li class="nav-item">
2535+
<a href="#nav">responsive</a>
2536+
</li>
2537+
<li class="nav-item">
2538+
<a href="#nav">navbar</a>
2539+
</li>
2540+
<li class="nav-item">
2541+
<a href="#nav">empty states</a>
2542+
</li>
2543+
</ul>
2544+
</li>
2545+
<li class="nav-item">
2546+
<a href="#nav">Components</a>
2547+
</li>
2548+
<li class="nav-item">
2549+
<a href="#nav">Utilities</a>
2550+
</li>
2551+
</ul>
2552+
</div>
2553+
2554+
</div>
2555+
<section class="notes">
2556+
<p>Add a container element with the class <code>nav</code>. And add child elements with the classname <code>nav-item</code>. The <code>nav-item</code> with the class <code>active</code> will be highlighted.</p>
2557+
</section>
2558+
25212559
</section>
25222560

25232561
<section id="modals" class="container grid-960">

src/navigation.less

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Navigation
22
.breadcrumb,
33
.tab,
4-
.pagination {
4+
.pagination,
5+
.nav {
56
list-style: none;
67
margin: .5rem 0;
78
}
@@ -91,11 +92,11 @@
9192
a {
9293
border-radius: @border-radius;
9394
color: @body-font-color;
94-
display: inline-block;
9595
padding: .6rem .8rem;
9696
text-decoration: none;
9797
&:focus,
9898
&:hover {
99+
background: @core-secondary-color;
99100
color: @core-color;
100101
}
101102
}
@@ -108,3 +109,34 @@
108109
}
109110
}
110111
}
112+
113+
// Nav
114+
.nav {
115+
display: flex;
116+
flex-direction: column;
117+
118+
.nav-item {
119+
a {
120+
border-radius: @border-radius;
121+
color: @body-font-color;
122+
padding: .6rem .8rem;
123+
text-decoration: none;
124+
&:focus,
125+
&:hover {
126+
color: @core-color;
127+
}
128+
}
129+
&.active {
130+
a {
131+
color: @core-color;
132+
}
133+
}
134+
}
135+
136+
& .nav {
137+
margin-left: 2rem;
138+
a {
139+
color: lighten(@body-font-color, 30%);
140+
}
141+
}
142+
}

0 commit comments

Comments
 (0)