Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overrides for counters in our buttons #61

Merged
merged 8 commits into from
Mar 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions css/.primer-stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
### css/primer.css

- **Total Stylesheets:** 1
- **Total Stylesheet Size:** 30697
- **Total Stylesheet Size:** 31225
- **Total Media Queries:** 1
- **Total Rules:** 405
- **Selectors Per Rule:** 1.4419753086419753
- **Total Selectors:** 584
- **Identifiers Per Selector:** 2.1455479452054793
- **Specificity Per Selector:** 16.690068493150687
- **Total Rules:** 410
- **Selectors Per Rule:** 1.4536585365853658
- **Total Selectors:** 596
- **Identifiers Per Selector:** 2.1593959731543624
- **Specificity Per Selector:** 16.924496644295303
- **Top Selector Specificity:** 50
- **Top Selector Specificity Selector:** .fullscreen-overlay-enabled.dark-theme .tooltipped .tooltipped-s:before
- **Total Id Selectors:** 0
- **Total Identifiers:** 1253
- **Total Declarations:** 997
- **Total Identifiers:** 1287
- **Total Declarations:** 1006
- **Total Unique Colors:** 78
- **Total Important Keywords:** 1
2 changes: 1 addition & 1 deletion css/primer.css

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions docs/buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,30 @@ You can easily append a count to a **small button**. Add the `.with-count` class
</div>
{% endexample %}

You can also use the [counter](utilities/#counter) component within buttons:

{% example html %}
<button class="btn" type="button">
Button
<span class="counter">12</span>
</button>

<button class="btn btn-primary" type="button">
Button
<span class="counter">12</span>
</button>

<button class="btn btn-danger" type="button">
Button
<span class="counter">12</span>
</button>

<button class="btn btn-outline" type="button">
Button
<span class="counter">12</span>
</button>
{% endexample %}

## Button groups

Have a hankering for a series of buttons that are attached to one another? Wrap them in a `.btn-group` and the buttons will be rounded and spaced automatically.
Expand Down
29 changes: 29 additions & 0 deletions scss/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
vertical-align: text-top;
}

// Darken for just a tad more contrast against the button background
.counter {
text-shadow: none;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properties should be ordered background-color, text-shadow

background-color: #e5e5e5;
}

&:focus {
text-decoration: none;
border-color: #51a7e8;
Expand Down Expand Up @@ -76,6 +82,11 @@
background-image: linear-gradient(#8add6d, #60b044);
border-color: darken(#60b044, 2%);

.counter {
color: #60b044;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literals like #60b044 should only be used in variable declarations; they should be referred to via variable everywhere else.
Properties should be ordered background-color, color

background-color: #fff;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literals like #fff should only be used in variable declarations; they should be referred to via variable everywhere else.

}

&:hover {
color: #fff;
background-color: darken(#60b044, 5%);
Expand Down Expand Up @@ -132,6 +143,15 @@
border-color: #e1e1e1;
}
}

&:hover,
&:active,
&.selected {
.counter {
color: #b33630;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literals like #b33630 should only be used in variable declarations; they should be referred to via variable everywhere else.
Properties should be ordered background-color, color

background-color: #fff;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literals like #fff should only be used in variable declarations; they should be referred to via variable everywhere else.

}
}
}

// Outline button
Expand All @@ -144,6 +164,10 @@
background-image: none;
border: 1px solid #e5e5e5;

.counter {
background-color: #eee;
}

&:hover,
&:active,
&.selected,
Expand All @@ -154,6 +178,11 @@
background-color: $brand-blue;
background-image: none;
border-color: $brand-blue;

.counter {
color: $brand-blue;
background-color: #fff;
}
}

&:disabled,
Expand Down