Skip to content

Commit

Permalink
Add label-rounded class and cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
picturepan2 committed Aug 20, 2017
1 parent 4fe9dff commit c2dcb64
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 12 deletions.
21 changes: 13 additions & 8 deletions docs/dist/spectre.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
========================================================================== */
html {
font-family: sans-serif;
/* 1 */
line-height: 1.15;
/* 3 */
-webkit-text-size-adjust: 100%;
/* 2 */
/* 1 */
-ms-text-size-adjust: 100%;
/* 3 */
}
Expand Down Expand Up @@ -423,7 +421,7 @@ h6 {
color: inherit;
font-weight: 500;
line-height: 1.2;
margin-bottom: .5em;
margin-bottom: .25em;
margin-top: 0;
}
.h1,
Expand Down Expand Up @@ -477,13 +475,13 @@ kbd {
background: #454d5d;
border-radius: .1rem;
color: #fff;
padding: .1em .3em;
padding: .15rem .2rem;
}
mark {
background: #ffe9b3;
border-radius: .1rem;
color: #454d5d;
padding: .1em .3em;
padding: .15rem .2rem;
}
blockquote {
border-left: .1rem solid #e7e9ed;
Expand Down Expand Up @@ -1209,7 +1207,12 @@ input.disabled + .form-icon {
color: #50596c;
display: inline-block;
line-height: 1;
padding: .1em .3em;
padding: .15rem .2rem;
}
.label.label-rounded {
border-radius: 5rem;
padding-left: .4rem;
padding-right: .4rem;
}
.label.label-primary {
background: #5764c6;
Expand All @@ -1235,7 +1238,9 @@ code {
background: #fdf4f4;
border-radius: .1rem;
color: #e06870;
padding: .1em .3em;
font-size: .65rem;
line-height: 1rem;
padding: .15rem .2rem;
}
.code {
border-radius: .1rem;
Expand Down
2 changes: 1 addition & 1 deletion docs/dist/spectre.min.css

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions docs/elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,19 @@ <h3 class="s-title"><a href="#labels" class="anchor" aria-hidden="true">#</a>Lab
<div class="docs-note">
<p>Add the <code>label</code> class to &lt;span&gt; or &lt;small&gt; elements. You can add another class <code>label-primary</code>, <code>label-secondary</code>, <code>label-success</code>, <code>label-warning</code> and <code>label-error</code> for colored labels.</p>
</div>
<div class="columns">
<div class="column">
<span class="label label-rounded">default label</span>
<span class="label label-rounded label-primary">primary label</span>
<span class="label label-rounded label-secondary">secondary label</span>
<span class="label label-rounded label-success">success label</span>
<span class="label label-rounded label-warning">warning label</span>
<span class="label label-rounded label-error">error label</span>
</div>
</div>
<div class="docs-note">
<p>Add the <code>label-rounded</code> class to have rounded labels.</p>
</div>

<!-- labels example -->
<pre class="code" data-lang="HTML"><code>&lt;<span class="tag">span</span> <span class="atn">class</span>=<span class="atv">&quot;label&quot;</span>&gt;default label&lt;<span class="tag">/span</span>&gt;
Expand Down
2 changes: 2 additions & 0 deletions src/codes.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Codes
code {
font-size: .65rem;
.label-base();
.label-variant(@code-color, lighten(@code-color, 33%));
line-height: @line-height;
}

.code {
Expand Down
6 changes: 6 additions & 0 deletions src/labels.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
.label-variant(lighten(@body-font-color, 5%), @bg-color);
line-height: 1;

&.label-rounded {
border-radius: 5rem;
padding-left: .4rem;
padding-right: .4rem;
}

&.label-primary {
.label-variant(@light-color, @primary-color);
}
Expand Down
2 changes: 1 addition & 1 deletion src/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// Label base style
.label-base() {
border-radius: @border-radius;
padding: .1em .3em;
padding: .15rem .2rem;
}

.label-variant(@color: @light-color, @bg-color: @primary-color) {
Expand Down
1 change: 0 additions & 1 deletion src/normalize.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

html {
font-family: sans-serif; /* 1 */
line-height: 1.15; /* 2 */
-ms-text-size-adjust: 100%; /* 3 */
-webkit-text-size-adjust: 100%; /* 3 */
}
Expand Down
2 changes: 1 addition & 1 deletion src/typography.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ h6 {
color: inherit;
font-weight: 500;
line-height: 1.2;
margin-bottom: .5em;
margin-bottom: .25em;
margin-top: 0;
}
.h1,
Expand Down

0 comments on commit c2dcb64

Please sign in to comment.