You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATING.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,10 @@ If you've installed Primer CSS with npm, you very likely already have `node_modu
60
60
61
61
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.
62
62
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
+
63
67
## Fonts
64
68
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:
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.
12
10
13
11
## Header
14
12
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.
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.
11
11
12
12
## Labels
13
13
@@ -21,7 +21,7 @@ The base `Label` style does not apply a background color and only uses the defau
**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.
25
25
26
26
```html live
27
27
<!-- Don't do this -->
@@ -60,9 +60,9 @@ Labels come in a few different themes. Use a theme that helps communicate the co
60
60
61
61
Note: Avoid using `Label--orange` next to `Label--red` since most people will find it hard to tell the difference.
62
62
63
-
## Issue Labels
63
+
## Issue labels
64
64
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.
@@ -133,7 +133,7 @@ Use `State--small` for a state label with reduced padding a smaller font size. T
133
133
134
134
## Counters
135
135
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.
137
137
138
138
```html live
139
139
<spanclass="Counter mr-1">1</span>
@@ -194,7 +194,7 @@ Diffstats show how many deletions or additions a diff has. It's typically a row
194
194
</span>
195
195
```
196
196
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.
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.**
10
10
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>`.
12
12
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`|
19
19
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.
21
21
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**.
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:
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`).
23
53
24
54
## Breakpoint variables
25
55
@@ -49,7 +79,7 @@ $breakpoints: (
49
79
50
80
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)`.
51
81
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`.
Copy file name to clipboardExpand all lines: docs/content/support/spacing.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -41,4 +41,4 @@ We aim for whole numbers, however, GitHub's body font-size is 14px which is diff
41
41
|`$em-spacer-5`| 1/2 | .5 | 35 | 40 |
42
42
|`$em-spacer-6`| 3/4 | .75 | 42 | 48 |
43
43
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/).
0 commit comments