Skip to content

Commit 607ce88

Browse files
committed
Merge branch 'release-10.0.0' into code_padding
2 parents cce0269 + 800b108 commit 607ce88

File tree

18 files changed

+199
-57
lines changed

18 files changed

+199
-57
lines changed

modules/primer-base/lib/normalize.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,11 @@ template, /* 1 */
8989
========================================================================== */
9090

9191
/**
92-
* 1. Remove the gray background on active links in IE 10.
93-
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
92+
* Remove the gray background on active links in IE 10.
9493
*/
9594

9695
a {
9796
background-color: transparent; /* 1 */
98-
-webkit-text-decoration-skip: objects; /* 2 */
9997
}
10098

10199
/**

modules/primer-buttons/README.md

Lines changed: 22 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -42,41 +42,9 @@ status: Stable
4242

4343
Buttons are used for **actions**, like in forms, while textual hyperlinks are used for **destinations**, or moving from one page to another.
4444

45-
#### Buttons
45+
{:toc}
4646

47-
```html
48-
<button class="m-1 btn" type="button">Close</button>
49-
<button class="m-1 btn btn-primary" type="button">Comment</button>
50-
<button class="m-1 btn btn-danger" type="button">Rename repository</button>
51-
<button class="m-1 btn btn-blue" type="button">Sign up for free</button>
52-
<button class="m-1 btn btn-purple" type="button">Try if for free</button>
53-
<br>
54-
<button class="m-1 btn hover" type="button">Close</button>
55-
<button class="m-1 btn btn-primary hover" type="button">Comment</button>
56-
<button class="m-1 btn btn-danger hover" type="button">Rename repository</button>
57-
<button class="m-1 btn btn-blue hover" type="button">Sign up for free</button>
58-
<button class="m-1 btn btn-purple hover" type="button">Try if for free</button>
59-
<br>
60-
<button class="m-1 btn focus" type="button">Close</button>
61-
<button class="m-1 btn btn-primary focus" type="button">Comment</button>
62-
<button class="m-1 btn btn-danger focus" type="button">Rename repository</button>
63-
<button class="m-1 btn btn-blue focus" type="button">Sign up for free</button>
64-
<button class="m-1 btn btn-purple focus" type="button">Try if for free</button>
65-
<br>
66-
<button class="m-1 btn selected" type="button">Close</button>
67-
<button class="m-1 btn btn-primary selected" type="button">Comment</button>
68-
<button class="m-1 btn btn-danger selected" type="button">Rename repository</button>
69-
<button class="m-1 btn btn-blue selected" type="button">Sign up for free</button>
70-
<button class="m-1 btn btn-purple selected" type="button">Try if for free</button>
71-
<br>
72-
<button class="m-1 btn disabled" type="button">Close</button>
73-
<button class="m-1 btn btn-primary disabled" type="button">Comment</button>
74-
<button class="m-1 btn btn-danger disabled" type="button">Rename repository</button>
75-
<button class="m-1 btn btn-blue disabled" type="button">Sign up for free</button>
76-
<button class="m-1 btn btn-purple disabled" type="button">Try if for free</button>
77-
```
78-
79-
#### Default buttons
47+
## Default button
8048

8149
Use the standard—yet classy—`.btn` for form actions and primary page actions. These are used extensively around the site.
8250

@@ -94,7 +62,7 @@ You can find them in two sizes: the default `.btn` and the smaller `.btn-sm`.
9462
<button class="btn btn-sm" type="button">Small button</button>
9563
```
9664

97-
#### Primary
65+
## Primary button
9866

9967
Primary buttons are green and are used to indicate the *primary* action on a page. When you need your buttons to stand out, use `.btn.btn-primary`. You can use it with both button sizes—just add `.btn-primary`.
10068

@@ -103,7 +71,7 @@ Primary buttons are green and are used to indicate the *primary* action on a pag
10371
<button class="btn btn-sm btn-primary" type="button">Small primary button</button>
10472
```
10573

106-
#### Danger
74+
## Danger button
10775

10876
Danger buttons are red. They help reiterate that the intended action is important or potentially dangerous (e.g., deleting a repo or transferring ownership). Similar to the primary buttons, just add `.btn-danger`.
10977

@@ -112,7 +80,7 @@ Danger buttons are red. They help reiterate that the intended action is importan
11280
<button class="btn btn-sm btn-danger" type="button">Small danger button</button>
11381
```
11482

115-
#### Outline
83+
## Outline button
11684

11785
Outline buttons downplay an action as they appear like boxy links. Just add `.btn-outline` and go.
11886

@@ -121,7 +89,7 @@ Outline buttons downplay an action as they appear like boxy links. Just add `.bt
12189
<button class="btn btn-sm btn-outline" type="button">Outline button</button>
12290
```
12391

124-
#### Large button
92+
## Large button
12593
Use `.btn-large` to increase the padding and border radius of a button. This is useful for prominent calls to action in hero sections.
12694

12795
[Type scale utilities](https://styleguide.github.com/primer/utilities/typography/#type-scale-utilities) can be used to alter the font-size if needed. Padding is applied in em's so that it scales proportionally with the font-size.
@@ -146,7 +114,7 @@ Use `.btn-large` with a type scale utility to transform the text to a bigger siz
146114

147115
```
148116

149-
#### Disabled state
117+
## Disabled state
150118

151119
Disable `<button>` elements with the boolean `disabled` attribute and `<a>` elements with the `.disabled` class.
152120

@@ -172,7 +140,7 @@ Similar styles are applied to primary, danger, and outline buttons:
172140
<a class="btn btn-outline disabled" href="#url" role="button">Disabled button</a>
173141
```
174142

175-
#### Block buttons
143+
## Block button
176144

177145
Make any button full-width by adding `.btn-block`. It adds `width: 100%;`, changes the `display` from `inline-block` to `block`, and centers the button text.
178146

@@ -181,7 +149,17 @@ Make any button full-width by adding `.btn-block`. It adds `width: 100%;`, chang
181149
<p><button class="btn btn-sm btn-block" type="button">Small block button</button></p>
182150
```
183151

184-
#### With counts
152+
## Link button
153+
154+
Create a button that looks like a link with `.btn-link`. Rather than using an `<a>` to trigger JS, this style on a `<button>` should be used for better accessibility.
155+
156+
**The `.btn-link` class is not designed to be used with `.btn`; the overlapping styles are not compatible.**
157+
158+
```html
159+
<p><button class="btn-link" type="button">Link button</button></p>
160+
```
161+
162+
## Button with counts
185163

186164
You can easily append a count to a **small button**. Add the `.with-count` class to the `.btn-sm` and then add the `.social-count` after the button.
187165

@@ -221,7 +199,7 @@ You can also use the [counter](../../product/components/labels) component within
221199
</button>
222200
```
223201

224-
#### Button groups
202+
## Button groups
225203

226204
Have a hankering for a series of buttons that are attached to one another? Wrap them in a `.BtnGroup` and the buttons will be rounded and spaced automatically.
227205

@@ -258,7 +236,7 @@ Add `.BtnGroup-form` to `<form>`s within `.BtnGroup`s for proper spacing and rou
258236
</div>
259237
```
260238

261-
#### Hidden text button
239+
## Hidden text button
262240

263241
Use `.hidden-text-expander` to indicate and toggle hidden text.
264242

@@ -271,7 +249,7 @@ Use `.hidden-text-expander` to indicate and toggle hidden text.
271249
You can also make the expander appear inline by adding `.inline`.
272250

273251

274-
#### Using button styles with the details summary element
252+
## Using button styles with the details summary element
275253

276254
You can add `.btn` and `.btn-*` classes to any
277255
[`<summary>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary)

modules/primer-buttons/stories.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,8 @@ storiesOf('Button', module)
6565
<button className="btn btn-large btn-outline-blue" type="button">Large button button</button>
6666
</div>
6767
))
68+
.add('btn-link', () => (
69+
<div className='p-4 d-flex flex-justify-between'>
70+
<button className='btn-link'>Button</button>
71+
</div
72+
))

modules/primer-markdown/lib/lists.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
margin-bottom: 0;
4646
}
4747

48+
li {
49+
word-wrap: break-all;
50+
}
51+
4852
li > p {
4953
margin-top: $spacer-3;
5054
}

modules/primer-marketing-utilities/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $ npm run build
3333

3434
## Documentation
3535

36-
36+
You can read more about utilities in the [docs folder](./docs/)
3737

3838
## License
3939

modules/primer-marketing-utilities/docs/borders.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Borders
33
status: New release
4-
status_issue: https://github.com/github/design-systems/issues/325
54
---
65

76
The following border utilities are meant to used in addition to those within primer-core.
@@ -17,3 +16,22 @@ Top, right, bottom, and left border utilities are can be used responsively to ad
1716
.border-top-0
1817
</div>
1918
```
19+
20+
## Border Colors
21+
22+
### White border with alpha transparency
23+
24+
Use `.border-white-fade` to add a white border with an alpha transparency of 0.15. This is useful when you want a border that is a lighter shade of the background color. Additional border colors are available in [primer-core border utilities](/borders/#border-colors).
25+
26+
```html
27+
<div class="bg-gray-dark text-white p-3 mb-2">
28+
<span class="border border-white-fade p-2">
29+
.border-white-fade .bg-gray-dark
30+
</span>
31+
</div>
32+
<div class="bg-blue text-white p-3">
33+
<span class="border border-white-fade p-2">
34+
.border-white-fade .bg-blue
35+
</span>
36+
</div>
37+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Layout
3+
status: New release
4+
---
5+
6+
Marketing layout utilities build on top of [primer-core utilities](/layout/#position), adding the option of responsive positioning.
7+
8+
{:toc}
9+
10+
## Responsive position
11+
12+
Use responsive position utilities to adjust the position of an element at different breakpoints.
13+
14+
```html
15+
<div class="position-relative p-6 bg-gray">
16+
<div class="d-inline-block position-md-absolute bottom-0 right-0 border bg-white p-2">
17+
.position-md-absolute
18+
</div>
19+
</div>
20+
21+
<div class="float-left border m-3" style="width:100px; height:100px;">
22+
default
23+
</div>
24+
<div class="float-left position-lg-relative border m-3" style="width:100px; height:100px; top:12px; left:12px;">
25+
.position-lg-relative
26+
</div>
27+
<div class="float-left border m-3" style="width:100px; height:100px;">
28+
default
29+
</div>
30+
<div class="float-left border m-3" style="width:100px; height:100px;">
31+
default
32+
</div>
33+
```

modules/primer-marketing-utilities/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
// utilities
33
@import "./lib/filters.scss";
44
@import "./lib/borders.scss";
5+
@import "./lib/layout.scss";

modules/primer-marketing-utilities/lib/borders.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515
.border-#{$breakpoint}-left-0 { border-left: 0 !important; }
1616
}
1717
}
18+
19+
/* Use with .border to turn the border rgba white 0.15 */
20+
.border-white-fade { border-color: $white-fade-15 !important; }
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Layout utilities
2+
// stylelint-disable block-opening-brace-space-before, primer/selector-no-utility, comment-empty-line-before
3+
4+
// Responsive position utilities
5+
6+
@each $breakpoint in map-keys($breakpoints) {
7+
@include breakpoint($breakpoint) {
8+
/* Set position to relative */
9+
.position-#{$breakpoint}-relative { position: relative !important; }
10+
/* Set position to absolute */
11+
.position-#{$breakpoint}-absolute { position: absolute !important; }
12+
/* Set position to fixed */
13+
.position-#{$breakpoint}-fixed { position: fixed !important; }
14+
}
15+
}

0 commit comments

Comments
 (0)