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

Styleguide Polish #481

Merged
merged 21 commits into from
May 8, 2018
10 changes: 5 additions & 5 deletions modules/primer-box/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Use `Box--danger` to apply a red border to the outside of the box. This theme is
</div>
```

`Box-danger` is often paired with a red heading. See the [subhead](/styleguide/css/styles/product/components/subhead) docs for more information.
`Box-danger` is often paired with a red heading. See the [subhead](../subhead) docs for more information.

```html
<div class="Subhead border-bottom-0">
Expand Down Expand Up @@ -356,7 +356,7 @@ Use the `border-dashed` utility to apply a dashed border to a box.
## Boxes with flash alerts
Use `flash-full` for flash alert inside a box to remove the rounded corners. Place the flash alert above the `Box-body` and underneath the `Box-header`.

Flash alerts come in three different colors and can be used with icons and buttons, see the [alert documentation](/alerts) for more information.
Flash alerts come in three different colors and can be used with icons and buttons, see the [alert documentation](../alerts) for more information.

```html
<div class="Box">
Expand Down Expand Up @@ -455,7 +455,7 @@ Use `Counter--gray-dark` for a counter with a dark gray background and white tex
## Form elements and buttons in boxes
To achieve different layouts when adding buttons or form elements to boxes we suggest you use utilities to achieve the layout you want. Here's some common examples:

Use [flexbox utilities](../utilities/flexbox) to center align items, and avoid using floats by using `flex-auto` to have the text fill the remaining space so that the button rests on the far right.
Use [flexbox utilities](../../utilities/flexbox) to center align items, and avoid using floats by using `flex-auto` to have the text fill the remaining space so that the button rests on the far right.

```html
<div class="Box Box--condensed">
Expand Down Expand Up @@ -561,7 +561,7 @@ You can put forms in boxes. Often form submission buttons are aligned to the bot
</div>
```

When a box is all by itself centered on a page you can use [column widths](/grid) to control the width of the box. If needed, break the mold a little and use [typography utilities](../utilities/typography) instead of the built in box title styles.
When a box is all by itself centered on a page you can use [column widths](../../objects/grid) to control the width of the box. If needed, break the mold a little and use [typography utilities](../../utilities/typography) instead of the built in box title styles.

```html
<div class="Box Box--spacious col-6 mx-auto text-center">
Expand All @@ -582,7 +582,7 @@ When a box is all by itself centered on a page you can use [column widths](/grid
</div>
```

Box patterns can also be made with, and modified with [border utilities](../utilities/borders).
Box patterns can also be made with, and modified with [border utilities](../../utilities/borders).

<!-- %enddocs -->

Expand Down
2 changes: 1 addition & 1 deletion modules/primer-buttons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ You can easily append a count to a **small button**. Add the `.with-count` class
</div>
```

You can also use the [counter](../../product/components/labels) component within buttons:
You can also use the [counter](../labels#counters) component within buttons:

```html
<button class="btn" type="button">
Expand Down
2 changes: 1 addition & 1 deletion modules/primer-forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Primer adds light `height` and `vertical-align` styles to `<select>`s for all br

##### Small

Use the `.select-sm` class to resize both default and custom `<select>`s to match the size of [our small buttons](/buttons/#default-buttons).
Use the `.select-sm` class to resize both default and custom `<select>`s to match the size of [our small buttons](../buttons/#default-buttons).

```html
<select class="form-select select-sm" aria-label="Preference">
Expand Down
4 changes: 2 additions & 2 deletions modules/primer-labels/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Use the `Counter` component to add a count to navigational elements and buttons.
<span class="Counter Counter--gray-light">64</span>
```

Use the `Counter` in navigation to indicate the number of items without the user having to click through or count the items, such as open issues in a GitHub repo. See more options in [navigation](../../core/components/navigation).
Use the `Counter` in navigation to indicate the number of items without the user having to click through or count the items, such as open issues in a GitHub repo. See more options in [navigation](../navigation).

```html title="Counter in tabs"
<div class="tabnav">
Expand All @@ -148,7 +148,7 @@ Use the `Counter` in navigation to indicate the number of items without the user
</div>
```

Counters can also be used in `Box` headers to indicate the number of items in a list. See more on the [box component](../../core/components/box).
Counters can also be used in `Box` headers to indicate the number of items in a list. See more on the [box component](../box).

```html title="Counter in Box headers"
<div class="Box">
Expand Down
2 changes: 1 addition & 1 deletion modules/primer-layout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ In practice, your columns will look like the example below.

##### Centered

Columns can be [centered](/utilities/#centering-content) by adding `.centered` to the `.column` class.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this link since it seemed like we don't have a section about centering content anymore? cc @broccolini

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it could go to /objects/layout/, but that's deprecated, so...? 😬

Columns can be centered by adding `.centered` to the `.column` class.

```html title="Grid centered"
<div class="columns">
Expand Down
8 changes: 4 additions & 4 deletions modules/primer-layout/docs/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Column widths can be used with any other block or inline-block elements to add p

## Offset columns

Using column offset classes can push a div over X number of columns. They work responsively using the [breakpoints outlined below](/styleguide/css/modules/grid#responsive-grids).
Using column offset classes can push a div over X number of columns. They work responsively using the [breakpoints outlined below](../grid#responsive-grids).

```html title="Offset columns"
<div class="clearfix">
Expand Down Expand Up @@ -188,7 +188,7 @@ You can use column widths and other utilities on elements such as lists to creat


## Display table grids
Using [display table utilities](/styleguide/css/utilities/layout#display) with columns gives you some alternative layout options.
Using [display table utilities](../../utilities/layout#display) with columns gives you some alternative layout options.

A useful example is being able to keep the height of the container equal across a row when the length of content may differ.

Expand All @@ -205,7 +205,7 @@ A useful example is being able to keep the height of the container equal across
</div>
</div>
```
You can also create an alternative [media object](/styleguide/css/utilities/layout#the-media-object) layout with `.display-table` and column widths.
You can also create an alternative [media object](../../utilities/layout#the-media-object) layout with `.display-table` and column widths.

```html title="Table grid alternative"
<div class="d-table col-12">
Expand Down Expand Up @@ -238,7 +238,7 @@ Note that table cells will fill the width of their container even when the total

## Flexbox grids

You can use [flex utilities](/styleguide/css/utilities/flexbox) on the container and columns to create a flexbox grid.
You can use [flex utilities](../../utilities/flexbox) on the container and columns to create a flexbox grid.

This can be useful for keeping columns the same height, justifying content and vertically aligning items. The flexbox grid is also great for working with responsive layouts.

Expand Down
2 changes: 1 addition & 1 deletion modules/primer-marketing-support/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Starting where the `primer-core` spacing scale ends at spacer 6, the marketing s
| 11 | 112 |
| 12 | 128 |

See [primer-marketing-utilities](../primer-marketing-utilities) for related spacing utilities.
See [primer-marketing-support](../../support/marketing-variables/) for the extended spacing scale used for marketing needs and the related y-axis spacing utilities for [margin](../../utilities/marketing-margin) and [padding](../../utilities/marketing-padding).

<!-- %enddocs -->

Expand Down
2 changes: 1 addition & 1 deletion modules/primer-marketing-utilities/docs/borders.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Top, right, bottom, and left border utilities are can be used responsively to ad

### White border with alpha transparency

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).
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).

```html
<div class="bg-gray-dark text-white p-3 mb-2">
Expand Down
2 changes: 1 addition & 1 deletion modules/primer-marketing-utilities/docs/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Layout
status: New release
---

Marketing layout utilities build on top of [primer-core utilities](/layout/#position), adding the option of responsive positioning.
Marketing layout utilities build on top of [primer-core utilities](../../utilities/layout/#position), adding the option of responsive positioning.

{:toc}

Expand Down
5 changes: 3 additions & 2 deletions modules/primer-marketing-utilities/docs/margin.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ status: New release
status_issue: https://github.com/github/design-systems/issues/378
---

Marketing margin utilities extend [core margin utilities](../../primer-marketing-support/docs/spacing) across the y-axis only. The [marketing scale](../../primer-marketing-support) starts from spacer 7 up to 12, and steps first by `8px` for spacer 7 and continues in increments of `16px` for spacer 8 to 12.
Marketing margin utilities extend [core margin utilities](../../support/spacing) across the y-axis only. The [marketing scale](../../support/marketing-variables/#extended-spacing-scale) starts from spacer 7 up to 12, and steps first by `8px` for spacer 7 and continues in increments of `16px` for spacer 8 to 12.


## Y-axis margin utilities

Expand All @@ -24,7 +25,7 @@ Use marketing margin utilities to apply margin to top, bottom, or both y-axis of

## Responsive y-axis margin utilities

All marketing margin utilities can be adjusted per [breakpoint](/styleguide/css/modules/grid#breakpoints) using the following formula: `m[y-direction]-[breakpoint]-[spacer]`. Each responsive style is applied to the specified breakpoint and up.
All marketing margin utilities can be adjusted per [breakpoint](../../objects/grid#breakpoints) using the following formula: `m[y-direction]-[breakpoint]-[spacer]`. Each responsive style is applied to the specified breakpoint and up.

```html
<div class="d-inline-block margin-orange">
Expand Down
4 changes: 2 additions & 2 deletions modules/primer-marketing-utilities/docs/padding.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ status: New release
status_issue: https://github.com/github/design-systems/issues/378
---

Marketing padding utilities extend [core margin utilities](../../primer-marketing-support/docs/spacing) across the y-axis only. The [marketing scale](../../primer-marketing-support) starts from spacer 7 up to 12, and steps first by `8px` for spacer 7 and continues in increments of `16px` for spacer 8 to 12.
Marketing padding utilities extend [core margin utilities](../../support/spacing) across the y-axis only. The [marketing scale](../../support/marketing-variables/#extended-spacing-scale) starts from spacer 7 up to 12, and steps first by `8px` for spacer 7 and continues in increments of `16px` for spacer 8 to 12.

## Y-axis padding utilities

Expand All @@ -24,7 +24,7 @@ Use marketing padding utilities to apply padding to top, bottom, or both y-axis

## Responsive y-axis padding utilities

All marketing padding utilities can be adjusted per [breakpoint](/styleguide/css/modules/grid#breakpoints) using the following formula: `p[y-direction]-[breakpoint]-[spacer]`. Each responsive style is applied to the specified breakpoint and up.
All marketing padding utilities can be adjusted per [breakpoint](../../objects/grid#breakpoints) using the following formula: `p[y-direction]-[breakpoint]-[spacer]`. Each responsive style is applied to the specified breakpoint and up.

```html
<div class="d-inline-block margin-orange">
Expand Down
2 changes: 1 addition & 1 deletion modules/primer-support/docs/breakpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We use abbreviations for each breakpoint to keep the class names concise. This a

<small>**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.</small>

Responsive styles are available for [margin](./utilities/margin#responsive-margin), [padding](./utilities/padding#responsive-padding), [layout](./utilities/layout), [flexbox](.utilities/flexbox#responsive-flex-utilities), and the [grid](./objects/grid#responsive-grids) system.
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.

## Breakpoint variables

Expand Down
4 changes: 2 additions & 2 deletions modules/primer-support/docs/spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ The spacing scale is a **base-8** scale. We chose a base-8 scale because eight i
| $spacer-1 | 5 | 32px |
| $spacer-1 | 6 | 40px |

These variables are encouraged to be used within components and custom CSS. The spacing scale is also used for [margin](./utilities/margin) and [padding](./utilities/padding) utilities.
These variables are encouraged to be used within components and custom CSS. The spacing scale is also used for [margin](../../utilities/margin) and [padding](../../utilities/padding) utilities.

See [primer-marketing-support](../primer-marketing-support) for the extended spacing scale used for marketing needs and the related y-axis spacing utilities for [margin](../primer-marketing-utilities/docs/margin.md) and [padding](../primer-marketing-utilities/docs/padding.md).
See [primer-marketing-support](../../support/marketing-variables/) for the extended spacing scale used for marketing needs and the related y-axis spacing utilities for [margin](../../utilities/marketing-margin) and [padding](../../utilities/marketing-padding).

## Em-based spacing
Ems are used for spacing within components such as buttons and form elements. We stick to common fractions for em values (and powers of 2 where possible) so that , in combination with typography and line-height, the total height lands on sensible numbers.
Expand Down
6 changes: 3 additions & 3 deletions modules/primer-support/docs/typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source: https://github.com/primer/primer/blob/master/modules/primer-support/lib/

The typography scale is designed to work for GitHub's product UI and marketing sites. Font sizes are designed to work in combination with line-height values so as to result in more sensible numbers wherever possible.

Font sizes are smaller on mobile and scale up at the `md` [breakpoint](#breakpoints) to be larger on desktop.
Font sizes are smaller on mobile and scale up at the `md` [breakpoint](./../breakpoints) to be larger on desktop.

| Scale | Font size: mobile | Font size: desktop | 1.25 line height | 1.5 line height |
| --- | --- | --- | --- | --- |
Expand All @@ -24,7 +24,7 @@ Font sizes are smaller on mobile and scale up at the `md` [breakpoint](#breakpoi
| 5 | 14px | 14px | 17.5 | 21 |
| 6 | 12px | 12px | 15 | 18 |

The typography scale is used to create [typography utilities](./utilities/typography).
The typography scale is used to create [typography utilities](../../utilities/typography).

## Typography variables

Expand Down Expand Up @@ -63,7 +63,7 @@ $lh-default: 1.5 !default;
```

## Typography Mixins
Typography mixins are available for heading styles and for our type scale. They can be used within components or custom CSS. The same styles are also available as [utilities](./utilities/typography#heading-utilities) which requires no additional CSS.
Typography mixins are available for heading styles and for our type scale. They can be used within components or custom CSS. The same styles are also available as [utilities](../../utilities/typography/#heading-utilities). which requires no additional CSS.

Heading mixins are available for `h1` through to `h6`, this includes the font-size and font-weight. Example:

Expand Down
6 changes: 3 additions & 3 deletions modules/primer-utilities/docs/colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Use color utilities to apply color to the background of elements, text, and bord

## Background colors

Background colors are most commonly used for filling large blocks of content or areas with a color. When selecting a background color, make sure the foreground color contrast passes a minimum WCAG accessibility rating of [level AA](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html). Meeting these standards ensures that content is accessible by everyone, regardless of disability or user device. You can [check your color combination with this demo site](http://jxnblk.com/colorable/demos/text/). For more information, read our [accessibility standards](/styleguide/css/principles/accessibility).
Background colors are most commonly used for filling large blocks of content or areas with a color. When selecting a background color, make sure the foreground color contrast passes a minimum WCAG accessibility rating of [level AA](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html). Meeting these standards ensures that content is accessible by everyone, regardless of disability or user device. You can [check your color combination with this demo site](http://jxnblk.com/colorable/demos/text/). For more information, read our [accessibility standards](/primer/principles/accessibility).

### Gray

Expand Down Expand Up @@ -127,7 +127,7 @@ Background colors are most commonly used for filling large blocks of content or

## Text colors

Use text color utilities to set text or [octicons](/styleguide/css/styles/core/components/octicons) to a specific color. Color contrast must pass a minimum WCAG accessibility rating of [level AA](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html). This ensures that viewers who cannot see the full color spectrum are able to read the text. To customize outside of the suggested combinations below, we recommend using this [color contrast testing tool](http://jxnblk.com/colorable/demos/text/). For more information, read our [accessibility standards](/styleguide/css/principles/accessibility).
Use text color utilities to set text or [octicons](/styleguide/css/styles/core/components/octicons) to a specific color. Color contrast must pass a minimum WCAG accessibility rating of [level AA](https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html). This ensures that viewers who cannot see the full color spectrum are able to read the text. To customize outside of the suggested combinations below, we recommend using this [color contrast testing tool](http://jxnblk.com/colorable/demos/text/). For more information, read our [accessibility standards](/primer/principles/accessibility).

These are our most common text with background color combinations. They don't all pass accessibility standards currently, but will be updated in the future. **Any of the combinations with a warning icon must be used with caution**.

Expand Down Expand Up @@ -229,4 +229,4 @@ Use `link-hover-blue` to make any text color used with links to turn blue on hov

## Border colors

Border colors are documented on the [border utilities page](/styleguide/css/styles/core/utilities/borders#border-width-style-and-color-utilities).
Border colors are documented on the [border utilities page](../..//utilities/borders#border-width-style-and-color-utilities).
2 changes: 1 addition & 1 deletion modules/primer-utilities/docs/flexbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ Use these classes to adjust the alignment of an individual flex item on the cros

## Responsive flex utilities

All flexbox utilities can be adjust per [breakpoint](/styleguide/css/modules/grid#breakpoints) using the following formulas:
All flexbox utilities can be adjust per [breakpoint](../../objects/grid#breakpoints) using the following formulas:

- `d-[breakpoint]-[property]` for `display`
- `flex-[breakpoint]-[property]-[behavior]` for various flex properties
Expand Down
Loading