Skip to content

Commit e3d988a

Browse files
authored
Merge pull request #1120 from primer/release-15.0.0
Primer CSS 15.0.0
2 parents fd94efd + 662504f commit e3d988a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1683
-838
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
## 15.0.0
2+
3+
### :rocket: Enhancements
4+
- [#1116](https://github.com/primer/css/pull/1116) Improve accessibility
5+
- [#1083](https://github.com/primer/css/pull/1083) Make sure autocomplete resets button styles
6+
- [#1074](https://github.com/primer/css/pull/1074) Update pagination
7+
- [#1071](https://github.com/primer/css/pull/1071) Update flash alert
8+
- [#1064](https://github.com/primer/css/pull/1064) Update SelectMenu
9+
- [#1040](https://github.com/primer/css/pull/1040) Update box-shadow and borders
10+
- [#1038](https://github.com/primer/css/pull/1038) Update navigation
11+
- [#1034](https://github.com/primer/css/pull/1034) Update labels
12+
- [#1029](https://github.com/primer/css/pull/1029) Update inputs
13+
- [#1027](https://github.com/primer/css/pull/1027) Update buttons
14+
- [#1022](https://github.com/primer/css/pull/1022) Update border radius
15+
16+
### :nail_care: Polish
17+
- [#1109](https://github.com/primer/css/pull/1109) Polish 9
18+
- [#1090](https://github.com/primer/css/pull/1090) Polish 8
19+
- [#1077](https://github.com/primer/css/pull/1077) Polish 7
20+
- [#1055](https://github.com/primer/css/pull/1055) Polish 3
21+
- [#1047](https://github.com/primer/css/pull/1047) Polish 2
22+
- [#1045](https://github.com/primer/css/pull/1045) Polish 1
23+
- [#1041](https://github.com/primer/css/pull/1041) Polish
24+
25+
### Committers
26+
- [@muan](https://github.com/muan)
27+
- [@simurai](https://github.com/simurai)
28+
129
## 14.4.0
230

331
### :rocket: Enhancements

deprecations.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,38 @@
44
* array and a "message" string.
55
*/
66
const versionDeprecations = {
7+
'15.0.0': [
8+
{
9+
selectors: [
10+
'.btn-outline:active .Counter',
11+
'.btn-outline.selected .Counter',
12+
'.btn-outline[aria-selected=true] .Counter',
13+
'.tabnav .Counter',
14+
'.SideNav-item:hover::before',
15+
'.SideNav-item:focus::before',
16+
'.UnderlineNav-item:hover .UnderlineNav-octicon',
17+
'.UnderlineNav-item:focus .UnderlineNav-octicon',
18+
'.UnderlineNav--right .UnderlineNav-item',
19+
'.pagination::before',
20+
'.pagination::after',
21+
'.pagination a:first-child',
22+
'.pagination span:first-child',
23+
'.pagination em:first-child',
24+
'.pagination a:last-child',
25+
'.pagination span:last-child',
26+
'.pagination em:last-child',
27+
'.pagination .selected',
28+
'.IssueLabel--big .g-emoji',
29+
'.IssueLabel--big:hover',
30+
'.SelectMenu-item[aria-checked="true"]',
31+
'.SelectMenu-item[aria-checked="true"] .SelectMenu-icon--check',
32+
'.SelectMenu-tab:not([aria-checked="true"]):hover',
33+
'.SelectMenu-tab:not([aria-checked="true"]):active',
34+
'.SelectMenu-tab:not([aria-selected="true"]):hover'
35+
],
36+
message: `This selector is not available in Primer CSS 15.0.0. Please refer to the documentation.`
37+
}
38+
],
739
'14.4.0': [
840
{
941
selectors: [

docs/content/components/alerts.md

Lines changed: 83 additions & 28 deletions
Large diffs are not rendered by default.

docs/content/components/avatars.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,30 @@ Add `.avatar` to any `<img>` element to make it an avatar. This resets some key
1515
Be sure to set `width` and `height` attributes for maximum browser performance.
1616

1717
```html live
18-
<img class="avatar" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=144" width="72" height="72" />
18+
<img class="avatar" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=96" width="48" height="48" />
1919
```
2020

2121
### Small avatars
2222

23-
We occasionally use smaller avatars. Anything less than `48px` wide should include the `.avatar-small` modifier class to reset the `border-radius` to a more appropriate level.
23+
We occasionally use smaller avatars. Anything less than `24px` wide should include the `.avatar-small` modifier class to reset the `border-radius` to a more appropriate level.
2424

2525
```html live
26-
<img class="avatar avatar-small" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=64" width="32" height="32" />
26+
<img class="avatar avatar-small" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=40" width="20" height="20" />
27+
```
28+
29+
### Avatar sizes
30+
31+
Instead of using the `width` and `height` attribute, you can also use a class like `.avatar-[1-8]`. The sizes go from `16px` up to `64px`. Note: Avatar stacks are only suppurted for the `20px` avatar size.
32+
33+
```html live
34+
<img class="avatar avatar-1 mr-2" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=32" />
35+
<img class="avatar avatar-2 mr-2" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=40" />
36+
<img class="avatar avatar-3 mr-2" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=48" />
37+
<img class="avatar avatar-4 mr-2" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=56" />
38+
<img class="avatar avatar-5 mr-2" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=64" />
39+
<img class="avatar avatar-6 mr-2" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=80" />
40+
<img class="avatar avatar-7 mr-2" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=96" />
41+
<img class="avatar avatar-8 mr-2" alt="jonrohan" src="https://github.com/jonrohan.png?v=3&s=128" />
2742
```
2843

2944
### Parent-child avatars

docs/content/components/buttons.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Icon-only buttons that turn blue on hover. Use `.btn-octicon-danger` to turn an
147147
<svg class="octicon octicon-trashcan" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"></path></svg>
148148
</button>
149149

150-
<button class="btn-octicon" type="button" aria-label="Trashcan icon">
150+
<button class="btn-octicon" type="button" aria-label="Kebab icon">
151151
<!-- <%= octicon "kebab-horizontal" %> -->
152152
<svg class="octicon octicon-kebab-horizontal" viewBox="0 0 13 16" version="1.1" width="13" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M1.5 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm5 0a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM13 7.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z"></path></svg>
153153
</button>
@@ -166,6 +166,42 @@ When using the `octicon-x` icon for a close button, add `.close-button` to remov
166166
</button>
167167
```
168168

169+
## Button with icons
170+
171+
Icons can be added to any button.
172+
173+
```html live
174+
<button class="btn mr-2" type="button">
175+
<!-- <%= octicon "search" %> -->
176+
<svg class="octicon octicon-search" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M15.7 13.3l-3.81-3.83A5.93 5.93 0 0013 6c0-3.31-2.69-6-6-6S1 2.69 1 6s2.69 6 6 6c1.3 0 2.48-.41 3.47-1.11l3.83 3.81c.19.2.45.3.7.3.25 0 .52-.09.7-.3a.996.996 0 000-1.41v.01zM7 10.7c-2.59 0-4.7-2.11-4.7-4.7 0-2.59 2.11-4.7 4.7-4.7 2.59 0 4.7 2.11 4.7 4.7 0 2.59-2.11 4.7-4.7 4.7z"></path></svg>
177+
<span>Find file</span>
178+
</button>
179+
180+
<button class="btn btn-primary mr-2" type="button">
181+
<!-- <%= octicon "cloud-download" %> -->
182+
<svg class="octicon octicon-cloud-download" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M9 12h2l-3 3-3-3h2V7h2v5zm3-8c0-.44-.91-3-4.5-3C5.08 1 3 2.92 3 5 1.02 5 0 6.52 0 8c0 1.53 1 3 3 3h3V9.7H3C1.38 9.7 1.3 8.28 1.3 8c0-.17.05-1.7 1.7-1.7h1.3V5c0-1.39 1.56-2.7 3.2-2.7 2.55 0 3.13 1.55 3.2 1.8v1.2H12c.81 0 2.7.22 2.7 2.2 0 2.09-2.25 2.2-2.7 2.2h-2V11h2c2.08 0 4-1.16 4-3.5C16 5.06 14.08 4 12 4z"></path></svg>
183+
<span>Clone</span>
184+
<span class="dropdown-caret"></span>
185+
</button>
186+
187+
<button class="btn btn-danger mr-2" type="button">
188+
<!-- <%= octicon "trashcan" %> -->
189+
<svg class="octicon octicon-trashcan" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"></path></svg>
190+
<span>Delete</span>
191+
</button>
192+
193+
<button class="btn btn-outline mr-2" type="button">
194+
<!-- <%= octicon "device-desktop" %> -->
195+
<svg class="octicon octicon-device-desktop" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M15 2H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2H15c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 9H1V3h14v8z"></path></svg>
196+
<span>Open in Desktop</span>
197+
</button>
198+
199+
<button class="btn" type="button" aria-label="Pencil icon">
200+
<!-- <%= octicon "pencil" %> -->
201+
<svg class="octicon octicon-pencil" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 011.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z"></path></svg>
202+
</button>
203+
```
204+
169205
## Button with counts
170206

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

docs/content/components/forms.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ All our inputs and buttons side-by-side for easy testing of sizing and alignment
2222
```html live
2323
<p>
2424
<button class="btn" type="button">Button</button>
25-
<button class="btn select-menu-button" type="button" aria-expanded="false" aria-haspopup="true">
25+
<button class="btn" type="button" aria-expanded="false" aria-haspopup="true">
2626
Select menu
27+
<span class="dropdown-caret">
2728
</button>
2829
<input class="form-control" type="text" placeholder="Standard input" aria-label="Repository description" />
2930
<input class="form-control input-monospace" type="text" placeholder="Monospace input" aria-label="SHA" />
@@ -35,8 +36,9 @@ All our inputs and buttons side-by-side for easy testing of sizing and alignment
3536

3637
<p>
3738
<button class="btn btn-sm" type="button">Small button</button>
38-
<button class="btn btn-sm select-menu-button" type="button" aria-expanded="false" aria-haspopup="true">
39+
<button class="btn btn-sm" type="button" aria-expanded="false" aria-haspopup="true">
3940
Select menu
41+
<span class="dropdown-caret">
4042
</button>
4143
<input class="form-control input-sm" type="text" placeholder="Small input" aria-label="Repository description" />
4244
<select class="form-select select-sm" aria-label="Important decision">
@@ -74,12 +76,17 @@ Textual form controls have a white background by default. You can change this to
7476
```html live
7577
<form>
7678
<input class="form-control" type="text" placeholder="Default input" aria-label="Default input" />
77-
<input
78-
class="form-control input-contrast"
79-
type="text"
80-
placeholder="Input with contrast"
81-
aria-label="Input with contrast"
82-
/>
79+
<input class="form-control input-contrast" type="text" placeholder="Input with contrast" aria-label="Input with contrast" />
80+
</form>
81+
```
82+
83+
#### Disabled state
84+
85+
Add the `disabled` attribute to make a `.form-control` appear disabled.
86+
87+
```html live
88+
<form>
89+
<input class="form-control" type="text" placeholder="Disabled input" aria-label="Disabled input" disabled />
8390
</form>
8491
```
8592

@@ -168,15 +175,7 @@ Use the `.select-sm` class to resize both default and custom `<select>`s to matc
168175
<option>Battlestar Galactica</option>
169176
</select>
170177

171-
<select class="form-select select-sm" aria-label="Preference">
172-
<option>Choose an option</option>
173-
<option>Git</option>
174-
<option>Subversion</option>
175-
<option>Social Coding</option>
176-
<option>Beets</option>
177-
<option>Bears</option>
178-
<option>Battlestar Galactica</option>
179-
</select>
178+
<button class="btn btn-sm ml-1"> Small button</button>
180179
```
181180

182181
#### Form groups

0 commit comments

Comments
 (0)