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

v4 Color update #22551

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9291277
new color vars with light and dark shades
mdo Apr 23, 2017
b623007
turn the colors into a sass map we can loop over
mdo Apr 23, 2017
4852521
color contrat via yiq method
mdo Apr 23, 2017
8670b13
no need for a mixin when we can loop
mdo Apr 23, 2017
c65c310
use loop instead of mixin for text utils
mdo Apr 23, 2017
f23e292
add color borders while we're add it
mdo Apr 23, 2017
9167257
update to use new colors that compile
mdo Apr 23, 2017
83e6266
remove deleted mixins
mdo Apr 23, 2017
7c2fcf7
comment out for now
mdo Apr 23, 2017
9b7bbf7
move to generating classes
mdo Apr 23, 2017
5ffd2d8
hella buttons up in here
mdo Apr 23, 2017
fcd23e5
tweak mixin to use color contrast function, reduce styles, tweak acti…
mdo Apr 23, 2017
f26a126
rip the card mixins
mdo Apr 23, 2017
46b2083
document all the new rad shit
mdo Apr 23, 2017
b725352
update card variants to use border utils, fix broken if
mdo Apr 23, 2017
cb56c5e
update buttons here
mdo Apr 23, 2017
610bd93
rip badge variants, use bg utils
mdo Apr 24, 2017
8bfd5f8
nix button variant vars
mdo Apr 24, 2017
ec9533a
change button classes in button group docs
mdo Apr 24, 2017
d6f9926
update progress docs to use new bg utils
mdo Apr 24, 2017
6ee8e6d
start docs for color palette under options
mdo Apr 24, 2017
92080aa
Updated color system
mdo May 1, 2017
be6fdcf
enable colorkeyword in linter
mdo May 2, 2017
d6f8317
Merge branch 'v4-dev' into colors
mdo May 2, 2017
7ed17b5
more docs
mdo May 2, 2017
64d5970
more color updates, grays map
mdo May 2, 2017
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
32 changes: 32 additions & 0 deletions docs/_data/colors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
- name: red
hex: "#d9534f"

- name: orange
hex: "#f0ad4e"

- name: yellow
hex: "#ffd500"

- name: green
hex: "#5cb85c"

- name: teal
hex: "#5bc0de"

- name: blue
hex: "#5cb85c"

- name: pink
hex: "#ff5b77"

- name: purple
hex: "#613d7c"

- name: white
hex: "#fff"

- name: gray
hex: "#464a4c"

- name: gray-dark
hex: "#292b2c"
10 changes: 10 additions & 0 deletions docs/assets/scss/_colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// Docs color palette classes
//

@each $color, $value in $colors {
.swatch-#{$color} {
background-color: #{$value};
@include color-yiq($value);
}
}
22 changes: 14 additions & 8 deletions docs/assets/scss/_component-examples.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@
.bd-example-container-header {
height: 3rem;
margin-bottom: .5rem;
background-color: lighten($brand-primary, 50%);
background-color: lighten($blue, 50%);
border-radius: .25rem;
}

.bd-example-container-sidebar {
float: right;
width: 4rem;
height: 8rem;
background-color: lighten($brand-warning, 25%);
background-color: lighten($orange, 25%);
border-radius: .25rem;
}

Expand Down Expand Up @@ -210,6 +210,12 @@
}

// Buttons
.bd-example {
> .btn {
margin: .25rem;
}
}

.bd-example > .btn-group {
margin-top: .25rem;
margin-bottom: .25rem;
Expand Down Expand Up @@ -357,12 +363,12 @@

.bd-example-border-utils {
[class^="border-"] {
display: inline-block;
width: 6rem;
height: 6rem;
margin: .25rem;
background-color: #f5f5f5;
border: 1px solid;
// display: inline-block;
// width: 6rem;
// height: 6rem;
// margin: .25rem;
// background-color: #f5f5f5;
// border: 1px solid;
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/scss/_featurettes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
color: #333;
}
.bd-featurette-img:hover {
color: $brand-primary;
color: $blue;
text-decoration: none;
}
.bd-featurette-img img {
Expand Down
4 changes: 2 additions & 2 deletions docs/assets/scss/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}
.bd-toc-link:hover,
.bd-toc-link:focus {
color: $brand-primary;
color: $blue;
text-decoration: none;
}
.active > .bd-toc-link {
Expand Down Expand Up @@ -94,7 +94,7 @@
}
.bd-sidebar .nav > li > a:hover,
.bd-sidebar .nav > li > a:focus {
color: $brand-primary;
color: $blue;
text-decoration: none;
background-color: transparent;
}
Expand Down
1 change: 1 addition & 0 deletions docs/assets/scss/docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ $bd-info: #5bc0de;
@import "examples";
@import "team";
@import "browser-bugs";
@import "colors";
@import "brand";
@import "clipboard-js";

Expand Down
22 changes: 11 additions & 11 deletions docs/components/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ Provide contextual feedback messages for typical user actions with the handful o

## Examples

Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the four **required** contextual classes (e.g., `.alert-success`). For inline dismissal, use the [alerts jQuery plugin](#dismissing).
Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the four **required** contextual classes (e.g., `.alert-green`). For inline dismissal, use the [alerts jQuery plugin](#dismissing).

{% example html %}
<div class="alert alert-success" role="alert">
<div class="alert alert-green" role="alert">
<strong>Well done!</strong> You successfully read this important alert message.
</div>
<div class="alert alert-info" role="alert">
<div class="alert alert-teal" role="alert">
<strong>Heads up!</strong> This alert needs your attention, but it's not super important.
</div>
<div class="alert alert-warning" role="alert">
<div class="alert alert-orange" role="alert">
<strong>Warning!</strong> Better check yourself, you're not looking too good.
</div>
<div class="alert alert-danger" role="alert">
<div class="alert alert-red" role="alert">
<strong>Oh snap!</strong> Change a few things up and try submitting again.
</div>
{% endexample %}
Expand All @@ -39,16 +39,16 @@ Alerts are available for any length of text, as well as an optional dismiss butt
Use the `.alert-link` utility class to quickly provide matching colored links within any alert.

{% example html %}
<div class="alert alert-success" role="alert">
<div class="alert alert-green" role="alert">
<strong>Well done!</strong> You successfully read <a href="#" class="alert-link">this important alert message</a>.
</div>
<div class="alert alert-info" role="alert">
<div class="alert alert-teal" role="alert">
<strong>Heads up!</strong> This <a href="#" class="alert-link">alert needs your attention</a>, but it's not super important.
</div>
<div class="alert alert-warning" role="alert">
<div class="alert alert-orange" role="alert">
<strong>Warning!</strong> Better check yourself, you're <a href="#" class="alert-link">not looking too good</a>.
</div>
<div class="alert alert-danger" role="alert">
<div class="alert alert-red" role="alert">
<strong>Oh snap!</strong> <a href="#" class="alert-link">Change a few things up</a> and try submitting again.
</div>
{% endexample %}
Expand All @@ -58,7 +58,7 @@ Use the `.alert-link` utility class to quickly provide matching colored links wi
Alerts can also contain additional HTML elements like headings, paragraphs and dividers.

{% example html %}
<div class="alert alert-success" role="alert">
<div class="alert alert-green" role="alert">
<h4 class="alert-heading">Well done!</h4>
<p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
<hr>
Expand All @@ -79,7 +79,7 @@ Using the alert JavaScript plugin, it's possible to dismiss any alert inline. He
You can see this in action with a live demo:

{% example html %}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<div class="alert alert-orange alert-dismissible fade show" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
Expand Down
42 changes: 15 additions & 27 deletions docs/components/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Documentation and examples for badges, our small count and labeling
group: components
---

Small and adaptive tag for adding context to just about any content.
Small and adaptive tag for adding context to just about any content. Use with background utilities to mix and match colors as you need them.

## Contents

Expand All @@ -17,25 +17,21 @@ Small and adaptive tag for adding context to just about any content.
Badges scale to match the size of the immediate parent element by using relative font sizing and `em` units.

{% example html %}
<h1>Example heading <span class="badge badge-default">New</span></h1>
<h2>Example heading <span class="badge badge-default">New</span></h2>
<h3>Example heading <span class="badge badge-default">New</span></h3>
<h4>Example heading <span class="badge badge-default">New</span></h4>
<h5>Example heading <span class="badge badge-default">New</span></h5>
<h6>Example heading <span class="badge badge-default">New</span></h6>
<h1>Example heading <span class="badge bg-gray">New</span></h1>
<h2>Example heading <span class="badge bg-gray">New</span></h2>
<h3>Example heading <span class="badge bg-gray">New</span></h3>
<h4>Example heading <span class="badge bg-gray">New</span></h4>
<h5>Example heading <span class="badge bg-gray">New</span></h5>
<h6>Example heading <span class="badge bg-gray">New</span></h6>
{% endexample %}

## Contextual variations

Add any of the below mentioned modifier classes to change the appearance of a badge.
Add any of the below mentioned modifier classes to change the appearance of a badge. **Note the addition of `.text-gray` on the badge with `.bg-white`.**

{% example html %}
<span class="badge badge-default">Default</span>
<span class="badge badge-primary">Primary</span>
<span class="badge badge-success">Success</span>
<span class="badge badge-info">Info</span>
<span class="badge badge-warning">Warning</span>
<span class="badge badge-danger">Danger</span>
{% for color in site.data.colors %}
<span class="badge bg-{{ color.name }}{% if color.name == "white" %} text-gray{% endif %}">{{ color.name | capitalize }}</span>{% endfor %}
{% endexample %}

{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
Expand All @@ -46,23 +42,15 @@ Add any of the below mentioned modifier classes to change the appearance of a ba
Use the `.badge-pill` modifier class to make badges more rounded (with a larger `border-radius` and additional horizontal `padding`). Useful if you miss the badges from v3.

{% example html %}
<span class="badge badge-pill badge-default">Default</span>
<span class="badge badge-pill badge-primary">Primary</span>
<span class="badge badge-pill badge-success">Success</span>
<span class="badge badge-pill badge-info">Info</span>
<span class="badge badge-pill badge-warning">Warning</span>
<span class="badge badge-pill badge-danger">Danger</span>
{% for color in site.data.colors %}
<span class="badge badge-pill bg-{{ color.name }}{% if color.name == "white" %} text-gray{% endif %}">{{ color.name | capitalize }}</span>{% endfor %}
{% endexample %}

## Links

Using the `.badge` classes with the `<a>` element quickly provide _actionable_ badges with hover and focus states.
Using the `.badge` classes with the `<a>` element quickly provide _actionable_ badges with hover states.

{% example html %}
<a href="#" class="badge badge-default">Default</a>
<a href="#" class="badge badge-primary">Primary</a>
<a href="#" class="badge badge-success">Success</a>
<a href="#" class="badge badge-info">Info</a>
<a href="#" class="badge badge-warning">Warning</a>
<a href="#" class="badge badge-danger">Danger</a>
{% for color in site.data.colors %}
<a href="#" class="badge bg-{{ color.name }}{% if color.name == "white" %} text-gray{% endif %}">{{ color.name | capitalize }}</a>{% endfor %}
{% endexample %}
Loading