Skip to content

Commit 21c5ebc

Browse files
authored
Colors V2 docs (#1603)
* Add v18 migration guide * Update colors.mdx * Move theming to support * Delete color-system.mdx * Update nav.yml * Fix color imports in the docs * Create small-papayas-prove.md * Update theming.md * Update colors.mdx * Replace V1 with V2 classes * More docs updates
1 parent 53e78d1 commit 21c5ebc

33 files changed

+641
-875
lines changed

.changeset/small-papayas-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": minor
3+
---
4+
5+
Update docs with V2 colors

docs/content/components/avatars.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,16 @@ Use `AvatarStack--right` to right-align the avatar stack. Remember to switch the
210210
<a class="CircleBadge CircleBadge--small float-left mr-2" href="#small">
211211
<img src="https://github.com/travis-ci.png" class="CircleBadge-icon" alt="">
212212
</a>
213-
<a class="CircleBadge CircleBadge--small color-bg-warning-inverse" href="#small">
214-
<!-- <%= octicon "zap", class: "CircleBadge-icon color-text-primary" %> -->
215-
<svg class="CircleBadge-icon color-text-primary octicon octicon-zap" viewBox="0 0 10 16" version="1.1" width="10" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M10 7H6l3-7-9 9h4l-3 7 9-9z"></path></svg>
213+
<a class="CircleBadge CircleBadge--small color-bg-done-muted" href="#small">
214+
<!-- <%= octicon "zap", class: "CircleBadge-icon color-fg-default" %> -->
215+
<svg class="CircleBadge-icon color-fg-default octicon octicon-zap" viewBox="0 0 10 16" version="1.1" width="10" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M10 7H6l3-7-9 9h4l-3 7 9-9z"></path></svg>
216216
</a>
217217
```
218218

219219
### Medium
220220

221221
```html live
222-
<div class="CircleBadge CircleBadge--medium color-bg-tertiary">
222+
<div class="CircleBadge CircleBadge--medium color-bg-subtle">
223223
<img src="https://github.com/travis-ci.png" alt="Travis CI" class="CircleBadge-icon" />
224224
</div>
225225
```

docs/content/components/box.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ A similar approach can be used for buttons with multiple lines of text within a
472472
<div class="Box-row d-flex flex-items-center">
473473
<div class="flex-auto">
474474
<strong>Row title</strong>
475-
<div class="text-small color-text-tertiary">
475+
<div class="text-small color-fg-subtle">
476476
Description
477477
</div>
478478
</div>
@@ -481,7 +481,7 @@ A similar approach can be used for buttons with multiple lines of text within a
481481
<div class="Box-row d-flex flex-items-center">
482482
<div class="flex-auto">
483483
<strong>Row title</strong>
484-
<div class="text-small color-text-tertiary">
484+
<div class="text-small color-fg-subtle">
485485
Description
486486
</div>
487487
</div>
@@ -490,7 +490,7 @@ A similar approach can be used for buttons with multiple lines of text within a
490490
<div class="Box-row d-flex flex-items-center">
491491
<div class="flex-auto">
492492
<strong>Row title</strong>
493-
<div class="text-small color-text-tertiary">
493+
<div class="text-small color-fg-subtle">
494494
Description
495495
</div>
496496
</div>

docs/content/components/buttons.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ status: Stable
55
source: 'https://github.com/primer/css/tree/main/src/buttons'
66
bundle: buttons
77
---
8-
<Note>
9-
Please note Primer v16 has changed the naming of these color classes. Check the <a href="/css/support/v16-migration">migration guide</a> to make sure your app is up to date.
10-
</Note>
118

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

docs/content/components/dropdown.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ title: Dropdown
33
status: Beta
44
---
55

6-
<Note>
7-
Please note Primer v16 has changed the naming of these color classes. Check the <a href="/css/support/v16-migration">migration guide</a> to make sure your app is up to date.
8-
</Note>
9-
106
Dropdowns are lightweight context menus for housing navigation and actions. They're great for instances where you don't need the full power (and code) of the select menu.
117

128
## Basic examples
@@ -37,7 +33,7 @@ Using a button customized with additional utilities:
3733
```html live
3834
<div style="margin-bottom: 100px">
3935
<details class="dropdown details-reset details-overlay d-inline-block">
40-
<summary class="color-text-secondary p-2 d-inline" aria-haspopup="true">
36+
<summary class="color-fg-muted p-2 d-inline" aria-haspopup="true">
4137
Dropdown
4238
<div class="dropdown-caret"></div>
4339
</summary>

docs/content/components/forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ Content that is hidden by default should only be done so if it is non-essential
369369
<span class="form-checkbox-details text-normal">
370370
<span class="d-block mb-1">Available hours per week</span>
371371
<input type="text" name="" class="form-control input-contrast" size="3" />
372-
<span class="text-small color-text-secondary pl-2">hours per week</span>
372+
<span class="text-small color-fg-muted pl-2">hours per week</span>
373373
</span>
374374
</label>
375375
</div>

docs/content/components/labels.md

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

10-
<Note>
11-
Please note Primer v16 has changed the naming of these color classes. Check the <a href="/css/support/v16-migration">migration guide</a> to make sure your app is up to date.
12-
</Note>
13-
1410
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.
1511

1612
## Labels
@@ -78,19 +74,19 @@ Sometimes when adding a label the line-height can be incrased. Or the parent ele
7874
Issue labels are used for adding labels to issues and pull requests. They also come with emoji support.
7975

8076
```html live
81-
<span class="IssueLabel color-bg-info-inverse color-text-white mr-1">Primer</span>
82-
<span class="IssueLabel color-bg-danger-inverse color-text-white mr-1">bug 🐛</span>
83-
<span class="IssueLabel color-bg-success-inverse color-text-white mr-1">help wanted</span>
84-
<span class="IssueLabel color-bg-warning-inverse color-text-primary mr-1">🚂 deploy: train</span>
77+
<span class="IssueLabel color-bg-accent-emphasis color-fg-on-emphasis mr-1">Primer</span>
78+
<span class="IssueLabel color-bg-danger-emphasis color-fg-on-emphasis mr-1">bug 🐛</span>
79+
<span class="IssueLabel color-bg-success-emphasis color-fg-on-emphasis mr-1">help wanted</span>
80+
<span class="IssueLabel color-bg-attention-emphasis color-fg-on-emphasis mr-1">🚂 deploy: train</span>
8581
```
8682

8783
If an issue label needs to be bigger, add the `.IssueLabel--big` modifier.
8884

8985
```html live
90-
<span class="IssueLabel IssueLabel--big color-bg-info-inverse color-text-white mr-1">Primer</span>
91-
<span class="IssueLabel IssueLabel--big color-bg-danger-inverse color-text-white mr-1">bug 🐛</span>
92-
<span class="IssueLabel IssueLabel--big color-bg-success-inverse color-text-white mr-1">help wanted</span>
93-
<span class="IssueLabel IssueLabel--big color-bg-warning-inverse color-text-primary mr-1">🚂 deploy: train</span>
86+
<span class="IssueLabel IssueLabel--big color-bg-accent-emphasis color-fg-on-emphasis mr-1">Primer</span>
87+
<span class="IssueLabel IssueLabel--big color-bg-danger-emphasis color-fg-on-emphasis mr-1">bug 🐛</span>
88+
<span class="IssueLabel IssueLabel--big color-bg-success-emphasis color-fg-on-emphasis mr-1">help wanted</span>
89+
<span class="IssueLabel IssueLabel--big color-bg-attention-emphasis color-fg-on-emphasis mr-1">🚂 deploy: train</span>
9490
```
9591

9692
## States
@@ -180,9 +176,9 @@ You can also have icons and emoji in counters. Or use utilities for counters wit
180176
10
181177
</span>
182178
<span class="Counter mr-1">👍 2</span>
183-
<span class="Counter mr-1 color-bg-success-inverse color-text-white">22</span>
184-
<span class="Counter mr-1 color-bg-danger-inverse color-text-white">22</span>
185-
<span class="Counter mr-1 color-bg-info-inverse color-text-white">22</span>
179+
<span class="Counter mr-1 color-bg-success-emphasis color-fg-on-emphasis">22</span>
180+
<span class="Counter mr-1 color-bg-danger-emphasis color-fg-on-emphasis">22</span>
181+
<span class="Counter mr-1 color-bg-accent-emphasis color-fg-on-emphasis">22</span>
186182
```
187183

188184
## Diffstat
@@ -196,12 +192,12 @@ Diffstats show how many deletions or additions a diff has. It's typically a row
196192
</span>
197193
```
198194

199-
Use the `color-text-success` and `color-text-danger` utilities to add additional information about the size of the diff.
195+
Use the `color-fg-success` and `color-fg-danger` utilities to add additional information about the size of the diff.
200196

201197
```html live
202198
<span class="diffstat">
203-
<span class="color-text-success">+7</span>
204-
<span class="color-text-danger">−2</span>
199+
<span class="color-fg-success">+7</span>
200+
<span class="color-fg-danger">−2</span>
205201
<span class="tooltipped tooltipped-e" aria-label="9 lines changed">
206202
<span class="diffstat-block-added"></span><span class="diffstat-block-added"></span><span class="diffstat-block-added"></span><span class="diffstat-block-deleted"></span><span class="diffstat-block-neutral"></span>
207203
</span>

docs/content/components/layout.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Flowing as row:
7676
<div class="Layout">
7777
<div class="Layout-main border">
7878
<div class="Layout-main-centered-md">
79-
<div class="container-md border color-border-info">
79+
<div class="container-md border color-border-accent">
8080
centered md
8181
</div>
8282
</div>
@@ -86,7 +86,7 @@ Flowing as row:
8686
<div class="Layout">
8787
<div class="Layout-main border">
8888
<div class="Layout-main-centered-lg">
89-
<div class="container-lg border color-border-info">
89+
<div class="container-lg border color-border-accent">
9090
centered lg
9191
</div>
9292
</div>
@@ -96,7 +96,7 @@ Flowing as row:
9696
<div class="Layout">
9797
<div class="Layout-main border">
9898
<div class="Layout-main-centered-xl">
99-
<div class="container-xl border color-border-info">
99+
<div class="container-xl border color-border-accent">
100100
centered xl
101101
</div>
102102
</div>

docs/content/components/links.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ source: 'https://github.com/primer/css/tree/main/src/links'
66
bundle: links
77
---
88

9-
<Note>
10-
Please note Primer v16 has changed the naming of these color classes. Check the <a href="/css/support/v16-migration">migration guide</a> to make sure your app is up to date.
11-
</Note>
12-
139
By default `<a>` elements already use the right link color and apply an underline on hover. So in most cases the `.Link` class is not really needed.
1410

1511
```html live
@@ -24,7 +20,7 @@ If you like to override the default link styles you can do so with the following
2420
Use `.Link--primary` to turn the link color to blue only on hover.
2521

2622
```html live
27-
<p class="color-text-secondary">Some text with a <a class="Link--primary" href="#url">Link--primary</a></p>
23+
<p class="color-fg-muted">Some text with a <a class="Link--primary" href="#url">Link--primary</a></p>
2824
```
2925

3026
## Secondary link
@@ -49,7 +45,7 @@ Use `.Link--muted` also removes the underline on hover. Tip: You can also use th
4945
Use `.Link--onHover` to make any text color used with links to turn blue on hover. This is useful when you want only part of a link to turn blue on hover.
5046

5147
```html live
52-
<a class="color-text-secondary no-underline" href="#url">
48+
<a class="color-fg-muted no-underline" href="#url">
5349
A link with a partial <span class="Link--onHover">Link--onHover</span>
5450
</a>
5551
```
@@ -59,7 +55,7 @@ Use `.Link--onHover` to make any text color used with links to turn blue on hove
5955
The `.Link` class can be nested inside an `<a>` element if only part of it should be styled like a link.
6056

6157
```html live
62-
<a class="color-text-primary no-underline" href="#url">
58+
<a class="color-fg-default no-underline" href="#url">
6359
A nested <span class="Link">Link</span>
6460
</a>
6561
```
@@ -70,8 +66,8 @@ Link classes in combination with [color utilities](../utilities/colors) lets you
7066

7167
```html live
7268
<a class="Link--primary text-bold" href="#url">
73-
<svg class="octicon octicon-flame color-text-danger" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg>
69+
<svg class="octicon octicon-flame color-fg-danger" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg>
7470
Hot
75-
<span class="color-text-secondary">potato</span>
71+
<span class="color-fg-muted">potato</span>
7672
</a>
7773
```

docs/content/components/navigation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ Different kind of content can be added inside a Side Nav item. Use utility class
271271
The `.SideNav-subItem` is an alternative, more lightweight version without borders and more condensed. It can be used stand-alone.
272272

273273
```html live
274-
<aside class="color-bg-secondary border p-3" style="max-width: 360px">
275-
<h5 class="color-text-secondary mb-2 pb-1 border-bottom">Menu</h5>
274+
<aside class="color-bg-subtle border p-3" style="max-width: 360px">
275+
<h5 class="color-fg-muted mb-2 pb-1 border-bottom">Menu</h5>
276276
<nav class="SideNav">
277277
<a class="SideNav-subItem" href="#url">Account</a>
278278
<a class="SideNav-subItem" href="#url" aria-current="page">Profile</a>
@@ -296,7 +296,7 @@ Or also appear nested, as a sub navigation. Use margin/padding utility classes t
296296
<svg class="octicon octicon-octoface SideNav-icon" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"> <path fill-rule="evenodd" d="M14.7 5.34c.13-.32.55-1.59-.13-3.31 0 0-1.05-.33-3.44 1.3-1-.28-2.07-.32-3.13-.32s-2.13.04-3.13.32c-2.39-1.64-3.44-1.3-3.44-1.3-.68 1.72-.26 2.99-.13 3.31C.49 6.21 0 7.33 0 8.69 0 13.84 3.33 15 7.98 15S16 13.84 16 8.69c0-1.36-.49-2.48-1.3-3.35zM8 14.02c-3.3 0-5.98-.15-5.98-3.35 0-.76.38-1.48 1.02-2.07 1.07-.98 2.9-.46 4.96-.46 2.07 0 3.88-.52 4.96.46.65.59 1.02 1.3 1.02 2.07 0 3.19-2.68 3.35-5.98 3.35zM5.49 9.01c-.66 0-1.2.8-1.2 1.78s.54 1.79 1.2 1.79c.66 0 1.2-.8 1.2-1.79s-.54-1.78-1.2-1.78zm5.02 0c-.66 0-1.2.79-1.2 1.78s.54 1.79 1.2 1.79c.66 0 1.2-.8 1.2-1.79s-.53-1.78-1.2-1.78z" /> </svg>
297297
<span>Profile</span>
298298
</a>
299-
<nav class="SideNav color-bg-primary border-top py-3" style="padding-left: 44px">
299+
<nav class="SideNav color-bg-default border-top py-3" style="padding-left: 44px">
300300
<a class="SideNav-subItem" href="#url" aria-current="page">Sub item 1</a>
301301
<a class="SideNav-subItem" href="#url">Sub item 2</a>
302302
<a class="SideNav-subItem" href="#url">Sub item 3</a>

0 commit comments

Comments
 (0)