Skip to content

Commit fa208ca

Browse files
add new buttons, update docs and stories test
1 parent 9eab550 commit fa208ca

File tree

3 files changed

+64
-50
lines changed

3 files changed

+64
-50
lines changed

modules/primer-marketing-buttons/README.md

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,31 @@ title: Marketing Buttons
1414
status: New Release
1515
-->
1616

17-
Marketing buttons extend primer-core buttons with more color and fill styles.
17+
Marketing buttons come in different colors and sizes, and are also available in a blue outlined version.
1818

19+
## Colors and outlined
1920

20-
## Colors
21+
Marketing buttons can be solid blue, outlined blue, or solid green.
2122

22-
Marketing buttons are available in orange.
23+
The solid blue and solid green buttons have more visual emphasis than the blue outlined button, therefore they should be used sparingly and only for call to actions that need emphasis.
2324

2425
```html
25-
<button class="btn btn-orange" type="button">Button button</button>
26+
<button class="btn-mktg" type="button">Learn more</button>
27+
<button class="btn-mktg btn-outline-mktg" type="button">Learn more</button>
28+
<button class="btn-mktg btn-primary-mktg" type="button">Sign up</button>
2629
```
2730

28-
## Outline button colors
31+
## Sizes
2932

30-
The `btn-outline` has also been extended with orange, purple, and green.
33+
Available in two sizes, marketing buttons have a default size and a large size.
3134

3235
```html
33-
<button class="btn btn-outline-orange" type="button">Button button</button>
34-
<a class="btn btn-outline-purple" href="#url" role="button">Link button</a>
35-
<button class="btn btn-outline-green" type="button">Button button</button>
36-
```
37-
38-
## Transparent button
39-
40-
A button can also be transparent and displayed with a white border with `btn-transparent`.
41-
42-
```html
43-
<div class="bg-gray-dark p-4 mt-4">
44-
<button class="btn btn-transparent" type="button">
45-
Button button
46-
<span class="Counter">12</span>
47-
</button>
48-
</div>
36+
<button class="btn-mktg" type="button">Learn more</button>
37+
<button class="btn-outline-mktg" type="button">Learn more</button>
38+
<button class="btn-primary-mktg" type="button">Sign up</button>
39+
<button class="btn-mktg btn-large-mktg" type="button">Learn more</button>
40+
<button class="btn-outline-mktg btn-large-mktg" type="button">Learn more</button>
41+
<button class="btn-primary-mktg btn-large-mktg" type="button">Sign up</button>
4942
```
5043

5144
<!-- %enddocs -->
Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
1-
.btn-orange { @include btn-solid($white, lighten($orange-500, 7.5%), darken($orange-500, 7.5%)); }
1+
.btn-mktg {
2+
display: inline-block;
3+
padding: $spacer-3 $spacer-4;
4+
font-size: $h5-size;
5+
font-weight: $font-weight-semibold;
6+
color: $white;
7+
white-space: nowrap;
8+
vertical-align: middle;
9+
cursor: pointer;
10+
user-select: none;
11+
background-color: $blue-450;
12+
border: 0;
13+
border-radius: $border-radius;
14+
transition: $transition-time / 2;
15+
appearance: none; // Corrects inability to style clickable `input` types in iOS.
16+
&:hover {
17+
text-decoration: none;
18+
background-color: $blue-500;
19+
}
20+
}
221

3-
.btn-outline-purple { @include btn-outline($purple); }
4-
.btn-outline-orange { @include btn-outline($orange); }
5-
.btn-outline-green { @include btn-outline($green); }
22+
.btn-primary-mktg {
23+
background-color: $green-450 !important;
624

7-
@mixin btn-transparent-active {
8-
color: $gray-800;
9-
background-color: $white;
10-
background-image: none;
11-
border-color: $white;
25+
&:hover {
26+
background-color: $green-500 !important;
27+
}
1228
}
1329

14-
.btn-transparent {
15-
color: $white;
16-
background-color: transparent;
17-
background-image: none;
18-
border: $border-width $border-style $white-fade-50;
30+
.btn-large-mktg {
31+
padding: 20px $spacer-5;
32+
font-size: $h4-size;
33+
}
34+
35+
.btn-outline-mktg {
36+
color: $blue-450 !important;
37+
background-color: rgba($white, 0) !important;
38+
box-shadow: 0 0 0 1px rgba($blue-450, 0.5) inset;
1939

20-
&:hover,
21-
&:active {
22-
@include btn-transparent-active;
40+
&:hover {
41+
color: $blue-500 !important;
42+
text-decoration: none;
43+
box-shadow: 0 0 0 1px rgba($blue-450, 1) inset;
2344
}
2445
}

modules/primer-marketing-buttons/stories.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ import React from 'react'
22
import { storiesOf } from '@storybook/react'
33

44
storiesOf('Marketing buttons', module)
5-
.add('Button colors', () => (
5+
.add('Button colors and outlined', () => (
66
<div className='p-4'>
7-
<button className="btn btn-orange mr-6" type="button">Button button</button>
7+
<button class="btn-mktg" type="button">Learn more</button>
8+
<button class="btn-mktg btn-outline-mktg" type="button">Learn more</button>
9+
<button class="btn-mktg btn-primary-mktg" type="button">Sign up</button>
810
</div>
911
))
10-
.add('Outline colors', () => (
12+
.add('Button sizes', () => (
1113
<div className='p-4'>
12-
<button className="btn btn-outline-orange mr-6" type="button">Button button</button>
13-
<a className="btn btn-outline-purple mr-6" href="#url" role="button">Link button</a>
14-
<button className="btn btn-outline-green mr-6" type="button">Button button</button>
15-
</div>
16-
))
17-
.add('Transparent button', () => (
18-
<div className="bg-gray-dark p-4 mt-4 mr-6">
19-
<button className="btn btn-transparent mr-6" type="button">Button button</button>
14+
<button class="btn-mktg" type="button">Learn more</button>
15+
<button class="btn-outline-mktg" type="button">Learn more</button>
16+
<button class="btn-primary-mktg" type="button">Sign up</button>
17+
<button class="btn-mktg btn-large-mktg" type="button">Learn more</button>
18+
<button class="btn-outline-mktg btn-large-mktg" type="button">Learn more</button>
19+
<button class="btn-primary-mktg btn-large-mktg" type="button">Sign up</button>
2020
</div>
2121
))

0 commit comments

Comments
 (0)