Skip to content

Commit 19fd820

Browse files
committed
Merge pull request #151 from primer/v3
Primer 3
2 parents 9c2daa5 + e0128e1 commit 19fd820

20 files changed

+560
-582
lines changed

css/.primer-stats.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [primer-css]( http://primercss.io )
22

3-
**Version:** `2.7.0`
3+
**Version:** `3.0.0`
44

55
> Primer is the CSS toolkit that powers GitHub's front-end design. It's purposefully limited to common components to provide our developers with the most flexibility, and to keep GitHub uniquely *GitHubby*. It's built with SCSS and available via Bower, so it's easy to include all or part of it within your own project.
66
@@ -11,17 +11,17 @@
1111
### css/primer.css
1212

1313
- **Total Stylesheets:** 1
14-
- **Total Stylesheet Size:** 32804
14+
- **Total Stylesheet Size:** 31700
1515
- **Total Media Queries:** 1
16-
- **Total Rules:** 468
17-
- **Selectors Per Rule:** 1.4294871794871795
18-
- **Total Selectors:** 669
19-
- **Identifiers Per Selector:** 2.007473841554559
20-
- **Specificity Per Selector:** 15.681614349775785
21-
- **Top Selector Specificity:** 43
22-
- **Top Selector Specificity Selector:** dl.form.warn dd.warning::after
16+
- **Total Rules:** 462
17+
- **Selectors Per Rule:** 1.3484848484848484
18+
- **Total Selectors:** 623
19+
- **Identifiers Per Selector:** 1.768860353130016
20+
- **Specificity Per Selector:** 15.296950240770466
21+
- **Top Selector Specificity:** 41
22+
- **Top Selector Specificity Selector:** .form-group.warn .warning::after
2323
- **Total Id Selectors:** 0
24-
- **Total Identifiers:** 1343
25-
- **Total Declarations:** 1036
26-
- **Total Unique Colors:** 82
27-
- **Total Important Keywords:** 156
24+
- **Total Identifiers:** 1102
25+
- **Total Declarations:** 1029
26+
- **Total Unique Colors:** 73
27+
- **Total Important Keywords:** 157

css/primer.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ <h2>Build tools</h2>
7878

7979
<script src="{{ site.baseurl }}/js/anchor.min.js"></script>
8080
<script>
81-
var selector = '.markdown-body h2, .markdown-body h3';
81+
var selector = '.markdown-body > h2, .markdown-body > h3';
8282
anchors.options = {
8383
placement: 'left',
8484
class: 'anchor-link'

docs/blankslate.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ Wrap some content in the outer `.blankslate` wrapper to give it the blankslate a
2323

2424
## With Octicons
2525

26-
When it helps the message, include `.mega-octicon`s as the first elements in the blank slate. Be sure to use relevant icons.
26+
When it helps the message, include (relevant) icons in your blank slate. Add `.blankslate-icon` to any `.mega-octicon`s as the first elements in the blankslate, like so.
2727

2828
{% example html %}
2929
<div class="blankslate">
30-
<span class="mega-octicon octicon-git-commit"></span>
31-
<span class="mega-octicon octicon-tag"></span>
32-
<span class="mega-octicon octicon-git-branch"></span>
30+
<span class="mega-octicon octicon-git-commit blankslate-icon"></span>
31+
<span class="mega-octicon octicon-tag blankslate-icon"></span>
32+
<span class="mega-octicon octicon-git-branch blankslate-icon"></span>
3333
<h3>This is a blank slate</h3>
3434
<p>Use it to provide information when no dynamic content exists.</p>
3535
</div>
@@ -44,7 +44,7 @@ Add an additional optional class to the `.blankslate` to change its appearance.
4444
Narrows the blankslate container to not occupy the entire available width.
4545

4646
{% example html %}
47-
<div class="blankslate has-fixed-width">
47+
<div class="blankslate blankslate-fixed-width">
4848
<h3>This is a blank slate</h3>
4949
<p>Use it to provide information when no dynamic content exists.</p>
5050
</div>
@@ -55,7 +55,7 @@ Narrows the blankslate container to not occupy the entire available width.
5555
Removes the `border-radius` on the top corners.
5656

5757
{% example html %}
58-
<div class="blankslate capped">
58+
<div class="blankslate blankslate-capped">
5959
<h3>This is a blank slate</h3>
6060
<p>Use it to provide information when no dynamic content exists.</p>
6161
</div>
@@ -66,7 +66,18 @@ Removes the `border-radius` on the top corners.
6666
Significantly increases the vertical padding.
6767

6868
{% example html %}
69-
<div class="blankslate spacious">
69+
<div class="blankslate blankslate-spacious">
70+
<h3>This is a blank slate</h3>
71+
<p>Use it to provide information when no dynamic content exists.</p>
72+
</div>
73+
{% endexample %}
74+
75+
### Large
76+
77+
Increases the size of the text in the blankslate
78+
79+
{% example html %}
80+
<div class="blankslate blankslate-large">
7081
<h3>This is a blank slate</h3>
7182
<p>Use it to provide information when no dynamic content exists.</p>
7283
</div>
@@ -77,7 +88,7 @@ Significantly increases the vertical padding.
7788
Removes the `background-color` and `border`.
7889

7990
{% example html %}
80-
<div class="blankslate clean-background">
91+
<div class="blankslate blankslate-clean-background">
8192
<h3>This is a blank slate</h3>
8293
<p>Use it to provide information when no dynamic content exists.</p>
8394
</div>

docs/buttons.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,11 @@ Have a hankering for a series of buttons that are attached to one another? Wrap
154154
</div>
155155
{% endexample %}
156156

157-
Add `.button_to` to `<form>`s within `.btn-group`s for proper spacing and rounded corners.
158-
159-
**Heads up!** This class name is inconsistent and will change in the next major version.
157+
Add `.btn-group-form` to `<form>`s within `.btn-group`s for proper spacing and rounded corners.
160158

161159
{% example html %}
162160
<div class="btn-group">
163-
<form class="button_to">
161+
<form class="btn-group-form">
164162
<button class="btn" type="button">Button in a form</button>
165163
</form>
166164
<button class="btn" type="button">Button</button>
@@ -174,7 +172,7 @@ Use `.hidden-text-expander` to indicate and toggle hidden text.
174172

175173
{% example html %}
176174
<span class="hidden-text-expander">
177-
<a href="#">&hellip;</a>
175+
<button type="button" class="ellipsis-expander">&hellip;</button>
178176
</span>
179177
{% endexample %}
180178

docs/docs.scss

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ body {
242242
// Examples
243243
//
244244

245+
.highlight {
246+
margin: 0;
247+
}
248+
245249
.docs-example {
246250
position: relative;
247251
padding: 15px;
@@ -250,6 +254,13 @@ body {
250254
border: 1px solid #e5e5e5;
251255
border-radius: .25rem .25rem 0 0;
252256

257+
// Undo `.markdown-body`
258+
p,
259+
h1, h2, h3, h4, h5, h6 {
260+
margin-top: 0;
261+
margin-bottom: 0;
262+
}
263+
253264
+ .highlight {
254265
margin-top: -1px;
255266
border: 1px solid #e5e5e5;
@@ -288,12 +299,12 @@ body {
288299
// Override Markdown styles to restore values from `_type.scss`
289300
ul,
290301
ol {
291-
padding: 0;
302+
padding-left: 0;
292303
margin-top: 0;
293304
margin-bottom: 0;
294305
}
295306

296-
dl.form {
307+
.form-group {
297308
margin: 15px 0;
298309

299310
&:first-child {

docs/forms.md

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ Form controls in Primer currently have no basic layout specified (this is by des
2828
{% example html %}
2929
<form>
3030
<label for="name">Name</label>
31-
<input type="text" id="name">
31+
<input class="form-control" type="text" id="name">
3232

3333
<label for="email">Email address</label>
34-
<input type="email" id="email">
34+
<input class="form-control" type="email" id="email">
3535

3636
<label>
3737
<input type="checkbox"> Remember me
@@ -54,36 +54,36 @@ Textual form controls have a white background by default. You can change this to
5454

5555
{% example html %}
5656
<form>
57-
<input type="text" placeholder="Default input">
58-
<input class="input-contrast" type="text" placeholder="Input with contrast">
57+
<input class="form-control" type="text" placeholder="Default input">
58+
<input class="form-control input-contrast" type="text" placeholder="Input with contrast">
5959
</form>
6060
{% endexample %}
6161

6262
## Sizing
6363

6464
Make inputs smaller, larger, or full-width with an additional class.
6565

66-
### Mini
66+
### Small
6767

6868
{% example html %}
6969
<form>
70-
<input class="input-mini" type="text" placeholder="Mini input">
70+
<input class="form-control input-sm" type="text" placeholder="Small input">
7171
</form>
7272
{% endexample %}
7373

7474
### Large
7575

7676
{% example html %}
7777
<form>
78-
<input class="input-large" type="text" placeholder="Large input">
78+
<input class="form-control input-lg" type="text" placeholder="Large input">
7979
</form>
8080
{% endexample %}
8181

8282
### Block
8383

8484
{% example html %}
8585
<form>
86-
<input class="input-block" type="text" placeholder="Full-width input">
86+
<input class="form-control input-block" type="text" placeholder="Full-width input">
8787
</form>
8888
{% endexample %}
8989

@@ -93,25 +93,7 @@ Primer adds light `height` and `vertical-align` styles to `<select>`s for all br
9393

9494
{% example html %}
9595
<form>
96-
<select>
97-
<option>Choose an option</option>
98-
<option>Git</option>
99-
<option>Subversion</option>
100-
<option>Social Coding</option>
101-
<option>Beets</option>
102-
<option>Bears</option>
103-
<option>Battlestar Galactica</option>
104-
</select>
105-
</form>
106-
{% endexample %}
107-
108-
### Custom
109-
110-
Custom `<select>`s are also available—just add `.select`. **Only available in latest WebKit, Firefox, and IE browsers.**
111-
112-
{% example html %}
113-
<form>
114-
<select class="select">
96+
<select class="form-select">
11597
<option>Choose an option</option>
11698
<option>Git</option>
11799
<option>Subversion</option>
@@ -128,7 +110,7 @@ Custom `<select>`s are also available—just add `.select`. **Only available in
128110
Use the `.select-sm` class to resize both default and custom `<select>`s to match the size of [our small buttons](/buttons/#default-buttons).
129111

130112
{% example html %}
131-
<select class="select-sm">
113+
<select class="form-select select-sm">
132114
<option>Choose an option</option>
133115
<option>Git</option>
134116
<option>Subversion</option>
@@ -138,7 +120,7 @@ Use the `.select-sm` class to resize both default and custom `<select>`s to matc
138120
<option>Battlestar Galactica</option>
139121
</select>
140122

141-
<select class="select select-sm">
123+
<select class="form-select select-sm">
142124
<option>Choose an option</option>
143125
<option>Git</option>
144126
<option>Subversion</option>
@@ -153,15 +135,15 @@ Use the `.select-sm` class to resize both default and custom `<select>`s to matc
153135

154136
{% example html %}
155137
<form>
156-
<dl class="form">
138+
<dl class="form-group">
157139
<dt><label>Example Text</label></dt>
158-
<dd><input type="text" value="Example Value"></dd>
140+
<dd><input class="form-control" type="text" value="Example Value"></dd>
159141
</dl>
160142

161-
<dl class="form">
162-
<dt><label>Example Label</label></dt>
143+
<dl class="form-group">
144+
<dt><label>Example Select</label></dt>
163145
<dd>
164-
<select class="select">
146+
<select class="form-select">
165147
<option>Choose an option</option>
166148
<option>Git</option>
167149
<option>Subversion</option>
@@ -172,24 +154,31 @@ Use the `.select-sm` class to resize both default and custom `<select>`s to matc
172154
</select>
173155
</dd>
174156
</dl>
157+
158+
<dl class="form-group">
159+
<dt><label>Example Textarea</label></dt>
160+
<dd>
161+
<textarea class="form-control"></textarea>
162+
</dd>
163+
</dl>
175164
</form>
176165
{% endexample %}
177166

178167
## Form group validation
179168

180-
Convey errors and warnings for form groups. Add the appropriate class—either `.errored` or `.warn`—to the `<dl class="form">` to start. Then, house your error messaging in an additional `<dd>` with either `.error` or `.warning`.
169+
Convey errors and warnings for form groups. Add the appropriate class—either `.errored` or `.warn`—to the `<dl class="form-group">` to start. Then, house your error messaging in an additional `<dd>` with either `.error` or `.warning`.
181170

182171
{% example html %}
183172
<form>
184-
<dl class="form errored">
173+
<dl class="form-group errored">
185174
<dt><label>Example Text</label></dt>
186-
<dd><input type="text" value="Example Value"></dd>
175+
<dd><input class="form-control" type="text" value="Example Value"></dd>
187176
<dd class="error">This example input has an error.</dd>
188177
</dl>
189178
<br>
190-
<dl class="form warn">
179+
<dl class="form-group warn">
191180
<dt><label>Example Text</label></dt>
192-
<dd><input type="text" value="Example Value"></dd>
181+
<dd><input class="form-control" type="text" value="Example Value"></dd>
193182
<dd class="warning">This example input has a warning.</dd>
194183
</dl>
195184
</form>
@@ -233,7 +222,7 @@ Attached an input and button to one another.
233222
{% example html %}
234223
<form>
235224
<div class="input-group">
236-
<input type="text" placeholder="Username">
225+
<input class="form-control" type="text" placeholder="Username">
237226
<span class="input-group-button">
238227
<button class="btn">
239228
<span class="octicon octicon-clippy"></span>

scss/_alerts.scss

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
padding: 15px;
55
font-size: 14px;
66
line-height: 1.5;
7-
color: #246;
8-
background-color: #e2eef9;
9-
border: 1px solid #bac6d3;
7+
color: $flash-text-blue;
8+
background-color: $flash-bg-blue;
9+
border: 1px solid $flash-border-blue;
1010
border-radius: 3px;
1111

1212
p:last-child {
@@ -53,15 +53,15 @@
5353
//
5454

5555
.flash-warn {
56-
color: #4c4a42;
57-
background-color: #fff9ea;
58-
border-color: #dfd8c2;
56+
color: $flash-text-yellow;
57+
background-color: $flash-bg-yellow;
58+
border-color: $flash-border-yellow;
5959
}
6060

6161
.flash-error {
62-
color: #911;
63-
background-color: #fcdede;
64-
border-color: #d2b2b2;
62+
color: $flash-text-red;
63+
background-color: $flash-bg-red;
64+
border-color: $flash-border-red;
6565
}
6666

6767
.flash-full {

0 commit comments

Comments
 (0)