Skip to content

Commit 0826b44

Browse files
committed
Merge branch 'master' into next
2 parents e5f3767 + 9bbdc4c commit 0826b44

File tree

9 files changed

+58
-46
lines changed

9 files changed

+58
-46
lines changed

MIGRATING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ If you've installed Primer CSS with npm, you very likely already have `node_modu
6060

6161
If you've installed Primer CSS with something _other than_ npm, or you don't know how it was installed, consult the documentation for your setup first, then [let us know][help] if you still can't figure it out.
6262

63+
## Compiled CSS files
64+
65+
The compiled CSS files can be found under `/dist` in case you want to directly link to them.
66+
6367
## Fonts
6468
The marketing-specific font files published in the [`fonts` directory](https://unpkg.com/[email protected]/fonts/) of `[email protected]` are published in the `fonts` directory of `@primer/css`. If you use these fonts, you'll need to do the following:
6569

docs/content/components/box-overlay.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,4 @@ Box overlays come in three widths. The default `Box--overlay` is 440px wide, `Bo
5656
<link href="https://unpkg.com/@github/details-dialog-element/index.css" rel="stylesheet" />
5757
```
5858

59-
In github.com there is a shared dialog partial. You will only have to pass in the modal content:
60-
61-
```erb
62-
<%= render layout: "shared/details_dialog", locals: {
63-
button_text: "Delete account",
64-
title: "Are you sure you want to delete this account?",
65-
button_class: "btn btn-danger"
66-
} do %>
67-
<div class="Box-body overflow-auto">
68-
<p>
69-
This action is irreversible.
70-
</p>
71-
<button type="button" class="btn btn-block btn-danger mt-2" data-close-dialog>
72-
Delete
73-
</button>
74-
</div>
75-
<% end %>
76-
```
77-
7859
[aria attributes]: https://www.w3.org/TR/html-aria/#allowed-aria-roles-states-and-properties

docs/content/components/box.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ Use `Box-row--focus-gray` or `Box-row--focus-blue` when using along-side `naviga
287287

288288
### Box row unread
289289

290-
Use `.Box-row-unread` to apply a blue vertical line highlight for indicating a row contains unread items.
290+
Use `.Box-row--unread` to apply a blue vertical line highlight for indicating a row contains unread items.
291291

292292
```html live
293293
<div class="Box">

docs/content/components/header.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ source: 'https://github.com/primer/css/tree/master/src/header'
66
bundle: header
77
---
88

9-
Use the Header component to create a header that has all of it's items aligned vertically with consistent horizontal spacing.
10-
11-
## Table of Contents
9+
Use the Header component to create a header that has all of its items aligned vertically with consistent horizontal spacing.
1210

1311
## Header
1412

15-
The `.Header` class is the wrapping class that aligns all the items properly and gives the header it's dark background. Each direct child of the `.Header` component is expected to be a `.Header-item` component. The component utilizes flexbox CSS to align all these items properly and applies spacing scale margin.
13+
The `.Header` class is the wrapping class that aligns all the items properly and gives the header its dark background. Each direct child of the `.Header` component is expected to be a `.Header-item` component. The component utilizes flexbox CSS to align all these items properly and applies spacing scale margin.
1614

1715
```html live
1816
<div class="Header">

docs/content/components/labels.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ source: 'https://github.com/primer/css/tree/master/src/labels'
77
bundle: labels
88
---
99

10-
Labels add metatdata or indicate status of items and navigational elements. Three different types of labels are available: [Labels](#default-label-styles) for adding metadata, [States](#states) for indicating status, and [Counters](#counters) for showing the count for a number of items.
10+
Labels add metadata or indicate status of items and navigational elements. Three different types of labels are available: [Labels](#default-label-styles) for adding metadata, [States](#states) for indicating status, and [Counters](#counters) for showing the count for a number of items.
1111

1212
## Labels
1313

@@ -21,7 +21,7 @@ The base `Label` style does not apply a background color and only uses the defau
2121
<span class="Label" title="Label: design">design</span>
2222
```
2323

24-
**Note:** Be sure to include a title attribute on labels, it's helpful for people using screen-readers to differentiate a label from other text. I.e. without the title attribute, the following example would read as _"New select component design"_, rather than identifying `design` as a label.
24+
**Note:** Be sure to include a title attribute on labels, as it's helpful for people using screen-readers to differentiate a label from other text. For example, without the title attribute, the following case would read as _"New select component design"_, rather than identifying `design` as a label.
2525

2626
```html live
2727
<!-- Don't do this -->
@@ -60,9 +60,9 @@ Labels come in a few different themes. Use a theme that helps communicate the co
6060

6161
Note: Avoid using `Label--orange` next to `Label--red` since most people will find it hard to tell the difference.
6262

63-
## Issue Labels
63+
## Issue labels
6464

65-
Issue Labels are used for adding labels to issues and pull requests. They also come with emoji support.
65+
Issue labels are used for adding labels to issues and pull requests. They also come with emoji support.
6666

6767
```html live
6868
<span class="IssueLabel bg-blue text-white mr-1" title="Label: Primer">Primer</span>
@@ -71,7 +71,7 @@ Issue Labels are used for adding labels to issues and pull requests. They also c
7171
<span class="IssueLabel bg-yellow text-gray-dark mr-1" title="Label: deploy: train">🚂 deploy: train</span>
7272
```
7373

74-
If an Issue Label needs to be bigger, add the `.IssueLabel--big` modifier.
74+
If an issue label needs to be bigger, add the `.IssueLabel--big` modifier.
7575

7676
```html live
7777
<span class="IssueLabel IssueLabel--big bg-blue text-white mr-1" title="Label: Primer">Primer</span>
@@ -133,7 +133,7 @@ Use `State--small` for a state label with reduced padding a smaller font size. T
133133

134134
## Counters
135135

136-
Use the `Counter` component to add a count to navigational elements and buttons. Counters come in 3 variations: the default `Counter` with a light gray background, the `Counter--gray-light` with a lighter text color, and `Counter--gray` with a dark-gray background and inverse white text. When a counter is empty, it's visibility will be hidden.
136+
Use the `Counter` component to add a count to navigational elements and buttons. Counters come in 3 variations: the default `Counter` with a light gray background, the `Counter--gray-light` with a lighter text color, and `Counter--gray` with a dark-gray background and inverse white text. When a counter is empty, its visibility will be hidden.
137137

138138
```html live
139139
<span class="Counter mr-1">1</span>
@@ -194,7 +194,7 @@ Diffstats show how many deletions or additions a diff has. It's typically a row
194194
</span>
195195
```
196196

197-
Use the `text-green` and `text-red` utilities to add addtitional information about the size of the diff.
197+
Use the `text-green` and `text-red` utilities to add additional information about the size of the diff.
198198

199199
```html live
200200
<span class="diffstat">

docs/content/support/breakpoints.md

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,50 @@ source: 'https://github.com/primer/css/blob/master/src/support/variables/layout.
66
bundle: support
77
---
88

9-
Our breakpoints are based on screen widths where our content starts to break. Since most of GitHub is currently a fixed-width with we use pixel widths to make it easy for us to match page widths for responsive and non-responsive pages. **Our breakpoints may change as we move more of the product into responsive layouts.**
9+
Our breakpoints are based on screen widths where our content starts to break. **Our breakpoints may change as we move more of the product into responsive layouts.**
1010

11-
We use abbreviations for each breakpoint to keep the class names concise. This abbreviated syntax is used consistently across responsive styles. Responsive styles allow you to change the styles properties at each breakpoint. For example, when using column widths for grid layouts, you can change specify that the width is 12 columns wide at the small breakpoint, and 6 columns wide from the large breakpoint: `<div class="col-sm-12 col-lg-6">...</div>`
11+
We use abbreviations for each breakpoint to keep the class names concise. This abbreviated syntax is used consistently across responsive styles. Responsive styles allow you to change the styles properties at each breakpoint. For example, when using column widths for grid layouts, you can specify that the width is 12 columns wide by default, 8 columns from the medium breakpoint, and 4 columns wide from the extra large breakpoint: `<div class="col-12 col-md-8 col-xl-4">...</div>`.
1212

13-
| Breakpoint | Syntax | Description |
14-
| ----------- | ------ | ----------------- |
15-
| Small | sm | min-width: 544px |
16-
| Medium | md | min-width: 768px |
17-
| Large | lg | min-width: 1012px |
18-
| Extra-large | xl | min-width: 1280px |
13+
| Breakpoint | Syntax | Breaks at |
14+
| ----------- | ------ | ----------|
15+
| Small | sm | `544px` |
16+
| Medium | md | `768px` |
17+
| Large | lg | `1012px` |
18+
| Extra-large | xl | `1280px` |
1919

20-
**Note:** The `lg` breakpoint matches our current page width of `980px` including left and right padding of `16px` (`$spacer-3`). This is so that content doesn't touch the edges of the window when resized.
20+
Responsive styles are available for [margin](/utilities/margin#responsive-margins), [padding](/utilities/padding#responsive-padding), [layout](/utilities/layout), [flexbox](/utilities/flexbox#responsive-flex-utilities), the [grid](/objects/grid#responsive-grids) system, and many more.
2121

22-
Responsive styles are available for [margin](/utilities/margin#responsive-margins), [padding](/utilities/padding#responsive-padding), [layout](/utilities/layout), [flexbox](/utilities/flexbox#responsive-flex-utilities), and the [grid](/objects/grid#responsive-grids) system.
22+
## Breakpoint and up... 🛫
23+
24+
In most cases, breakpoints get used with the `min-width` media query. This means that when using a responsive utility class, the class becomes "enabled" from the breakpoint on upwards. Or from the browser's perspective, when the browser's width **is** the breakpoint or **wider**.
25+
26+
| Breakpoint | Syntax | Is enabled... |
27+
| ----------- | ------ | -------------------------|
28+
| None | | from `0px` upwards -> |
29+
| Small | sm | from `544px` upwards -> |
30+
| Medium | md | from `768px` upwards -> |
31+
| Large | lg | from `1012px` upwards -> |
32+
| Extra-large | xl | from `1280px` upwards -> |
33+
34+
A responsive utility class stays enabled **unless** it gets overridden with another responsive utility class that has a higher breakpoint. Here the example from above `<div class="col-12 col-md-8 col-xl-4">...</div>` visualized:
35+
36+
```
37+
| 0px ->
38+
| 544px ->
39+
| sm
40+
| 768px ->
41+
| md
42+
| 1012px ->
43+
| lg
44+
| 1280px ->
45+
| xl
46+
47+
| col-12 ---------> | col-md-8 ----------> | col-xl-4 ->
48+
```
49+
50+
Using breakpoints with the `min-width` media query works great for "mobile first". Design for mobile devices as a default, then if needed, tweak it for wider desktop screens using responsive utility classes.
51+
52+
Note: The [responsive hide](/utilities/layout#responsive-hide) utilities are an exception and use a range between two breakpoints. They also go the other direction "breakpoint and down... 🛬". For example `.hide-md` hides an element if the browser's width is between `sm <-> md` (`544px - 767px`).
2353

2454
## Breakpoint variables
2555

@@ -49,7 +79,7 @@ $breakpoints: (
4979

5080
Use media query mixins when you want to change CSS properties at a particular breakpoint. The media query mixin works by passing in a breakpoint value, such as `breakpoint(md)`.
5181

52-
Media queries are scoped from each breakpoint and upwards. In the example below, the font size is `28px` until the viewport size meets the `lg` breakpoint, from there upwards—including through the `xl` breakpoint—the font size will be `32px`.
82+
Media queries are scoped from each breakpoint and upwards. In the example below, the font size is `28px` until the viewport size meets the `md` breakpoint, from there upwards—including through the `xl` breakpoint—the font size will be `32px`.
5383

5484
```scss
5585
.styles {

docs/content/support/color-system.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
title: Color system
33
description: 'Sass variables, mixins, and functions for use in our components.'
44
status: Stable
5-
status_issue: 'https://github.com/github/design-systems/issues/301'
5+
source: 'https://github.com/primer/css/blob/master/src/support/variables/color-system.scss'
6+
bundle: support
67
---
78

89
import colors from 'primer-colors'

docs/content/support/spacing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ We aim for whole numbers, however, GitHub's body font-size is 14px which is diff
4141
| `$em-spacer-5` | 1/2 | .5 | 35 | 40 |
4242
| `$em-spacer-6` | 3/4 | .75 | 42 | 48 |
4343

44-
The variables listed above are preferred for use within components and custom CSS. To calculate values with other font-sizes or em values, we suggest using [Formula](http://jxnblk.com/formula).
44+
The variables listed above are preferred for use within components and custom CSS. To calculate values with other font-sizes or em values, we suggest using [Formula](https://jxnblk.github.io/formula/).

docs/content/utilities/borders.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import {PaletteTable, PaletteCell, PaletteValue} from '../../src/color-system'
1212

1313
Utilities for borders, border radius, and box shadows.
1414

15-
## Table of Contents
16-
1715
## Default border
1816

1917
The default border utility applies a solid, 1px border, with a default gray color.

0 commit comments

Comments
 (0)