1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
|
{% extends "base.html" %}
{% block title %}Django Web Styleguide{% endblock %}
{% block body_class %}styleguide{% endblock %}
{% block header %}<p>Style Guide</p>{% endblock %}
{% block content %}
<div class="section">
<h1>Django Web Style Guide</h1>
<h4>Updated December 15, 2014</h4>
<div data-xrayhtml>
<p>
This styleguide is a reference to maintain a design standard on djangoproject.com and related Django websites. It is meant to provide a source of available elements, and give insight into which elements to use where.
</p>
<p>
It is best practice to use elements from this guide to serve any design needs before introducing new elements. If new elements must be introduced to accommodate new content, please be mindful of the guidelines here and take the liberty to update the guide.
</p>
</div>
</div>
<div class="section" id="layout">
<h2>Page Layout</h2>
<h3 id="layout-sidebarleft">Sidebar left</h3>
<p>
A sidebar on the left side of the page is the default layout, and used for most pages. This layout is used when the sidebar is used mainly for navigating.
</p>
<div class="example">
<a class="iframe" href="{% url 'weblog:index' %}" target="_blank">
<iframe src="{% url 'weblog:index' %}"></iframe>
</a>
</div>
<h3 id="layout-sidebarright">Sidebar right</h3>
<p>
A sidebar on the right side of the page should be used to show additional, secondary content.
</p>
<div class="example">
<a class="iframe" href="{% url 'download' %}" target="_blank">
<iframe src="{% url 'download' %}"></iframe>
</a>
</div>
<h3 id="layout-singlecolumn">Single column</h3>
<p>
Single column layout should be used for single-purpose pages, such as marketing pages, landing pages, or other pages where the attention of the user should be intentionally narrowed. The column is purposefully limited to 740px to keep text line-lengths at a nice, readable width.
</p>
<div class="example">
<a class="iframe" href="{% url 'overview' %}" target="_blank">
<iframe src="{% url 'overview' %}"></iframe>
</a>
</div>
<h3 id="layout-responsive">Responsive</h3>
<p>
<em>Djangoproject.com</em> uses responsive styles to scale the above layouts to fit desktop and tablet browsers comfortably. When visited on a mobile device, all layouts are condensed to single-column. Mobile styles are purposefully not loaded on desktop, for example, when the browser window is scaled very small.
</p>
</div>
<div class="section" id="colors">
<h2>Colors</h2>
<h3 id="colors-primarycolors">Primary colors</h3>
<p>
Colors used for main text, links and backgrounds. Hover each swatch to see the corresponding SASS variable name.
</p>
<ul class="swatches">
<li class="text" title="Text"></li>
<li class="green-dark" title="Dark Green"></li>
<li class="green" title="Green"></li>
<li class="green-light" title="Light Green"></li>
<li class="white" title="White"></li>
<li class="red-dark" title="Dark Red"></li>
</ul>
<h3 id="colors-secondarycolor">Secondary colors</h3>
<p>Colors used for hover states, alternate texts, borders, etc. These are mostly slight variations of the primary colors to be paired.</p>
<ul class="swatches">
<li class="green-medium-dark" title="Medium Dark Green"></li>
<li class="green-medium" title="Medium Green"></li>
<li class="green-very-light" title="Very Light Green"></li>
<li class="text-light" title="Text Light"></li>
<li class="gray-line" title="Gray Line"></li>
<li class="red" title="Red"></li>
</ul>
</div>
<div class="section" id="typography">
<h2>Typography</h2>
<p>
The djangoproject.com website is set in <em><a href="https://fonts.google.com/specimen/Roboto">Roboto</a></em>, a sans-serif font. 5 styles of this typeface are provided, <em>Light (300)</em>, <em>Normal (400)</em>, <em>Normal Italic</em>, <em>Bold (700)</em> and <em>Bold Italic</em>. Refrain from using weights and italics that are not loaded.
</p>
<p>
For documentation styles, the monospace font is <em><a href="https://fonts.google.com/specimen/Fira+Mono">Fira Mono</a></em>. <em>Normal (400)</em> and <em>Bold (700)</em> weights are available.
</p>
<h3 id="typography-maincontent">Main content</h3>
<div class="example">
<div class="copy-banner">
<div class="container">
<p>Copy Banner text - 32px Roboto Light</p>
</div>
</div>
<h1>H1 Header - 32px Roboto Normal</h1>
<h2>H2 Header - 24px Roboto Normal</h2>
<h3>H3 Header - 20px Roboto Bold</h3>
<h4>H4 Header - 16px Roboto Bold</h4>
<h5>H5 Header - 16px Roboto Normal</h5>
<p>
Serif paragraph type. Palatino font style should be used for all text copy, except for the documentation and in sidebars.
</p>
<pre>Monospace type. Used exclusively in documentation and code examples.</pre>
</div>
<h3 id="typography-secondarycontent">Secondary content</h3>
<div class="example">
<div role="complementary">
<h1>H1 Header - 28px Roboto Normal</h1>
<h2>H2 Header - 20px Roboto Normal</h2>
<h3>H3 Header - 18px Roboto Normal</h3>
<h4>H4 Header - 16px Roboto Bold</h4>
<p>
Sans-serif paragraph type. Roboto font is used in documentation paragraph text, sidebars, headers, and footers.
</p>
</div>
</div>
</div>
<div class="section" id="icons">
<h2>Icons</h2>
<p><em>Djangoproject.com</em> makes use of <a href="https://fontawesome.com/"><em>Font Awesome</em></a> for any icons throughout the interface. This all-inclusive webfont icon set eliminates the need to design icons for specific purposes, and keeps the icon language consistent throughout.</p>
<div class="example">
<big>
<span class="icon icon-flash"></span>
<span class="icon icon-briefcase"></span>
<span class="icon icon-lock"></span>
<span class="icon icon-cogs"></span>
<span class="icon icon-dashboard"></span>
</big>
<span class="icon icon-link"></span>
<span class="icon icon-file-text-o"></span>
</div>
</div>
<div class="section" id="elements">
<h2>Page Elements</h2>
<h3 id="elements-buttons">
Buttons
</h3>
<p>Call to action buttons are used throughout the site, to focus users' attention on important flows of the site. An outline version is used when the call to action is less important.</p>
<div class="example">
<span class="cta">Call to action</span>
<span class="cta outline">Button outline</span>
</div>
<h3 id="elements-forms">
Forms
</h3>
<h4>General forms</h4>
<div class="example">
<form method="post" action="" class="form-general">
<fieldset>
<input id="id_username" maxlength="30" name="username" type="text" placeholder="Username" />
<input id="id_email" name="email" type="email" placeholder="Email address" />
<input id="id_password1" name="password1" type="password" placeholder="Password" />
</fieldset>
<fieldset>
<select>
<option>Select example</option>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</fieldset>
<fieldset>
<label>
<input type="checkbox" />
Receive newsletter updates
</label>
</fieldset>
<fieldset>
<button type="submit">Submit</button>
</fieldset>
</form>
</div>
<h4>Inline field forms</h4>
<div class="example">
<div class="form-email">
<form class="form-input">
<input type="email" name="email" placeholder="Enter Email">
<button type="submit">
<i class="icon icon-envelope-o"></i>
<span class="visuallyhidden">Subscribe</span>
</button>
</form>
</div>
<form action="#" class="form-input" role="search">
<label class="visuallyhidden" for="news-search">Search:</label>
<input type="text" name="news-search" id="news-search" placeholder="Search" />
<button type="submit">
<i class="icon icon-search"></i>
<span class="visuallyhidden">Search</span>
</button>
</form>
</div>
<h3 id="elements-lists">
Lists
</h3>
<div class="example">
<div role="complementary">
<h2>Contents outline</h2>
<ul class="list-outline">
<li>
<a class="reference internal" href="#">Making queries</a>
<ul>
<li>
<a class="reference internal" href="#creating-objects">Creating objects</a>
</li>
<li>
<a class="reference internal" href="#saving-changes-to-objects">Saving changes to objects</a>
<ul>
<li>
<a class="reference internal" href="#saving-foreignkey-and-manytomanyfield-fields">Saving <tt class="docutils literal"><span class="pre">ForeignKey</span></tt> and <tt class="docutils literal"><span class="pre">ManyToManyField</span></tt> fields</a>
</li>
</ul>
</li>
<li>
<a class="reference internal" href="#retrieving-objects">Retrieving objects</a>
<ul>
<li><a class="reference internal" href="#retrieving-all-objects">Retrieving all objects</a></li>
<li><a class="reference internal" href="#retrieving-specific-objects-with-filters">Retrieving specific objects with filters</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="example">
<div role="complementary">
<h3>List links</h3>
<dl class="list-links">
<dt><a href="#">Karen Tracey joins the DSF board</a></dt>
<dd>
by Russell Keith-Magee on Sep. 20, 2013
</dd>
<dt><a href="#">Karen Tracey joins the DSF board</a></dt>
<dd>
by Russell Keith-Magee on Sep. 20, 2013
</dd>
<dt><a href="#">Karen Tracey joins the DSF board</a></dt>
<dd>
by Russell Keith-Magee on Sep. 20, 2013
</dd>
</dl>
<a href="{% url 'weblog:index' %}" class="link-readmore">See all News</a>
</div>
</div>
<div class="example">
<div role="complementary">
<h3>List links small</h3>
<dl class="list-links-small news-list">
<dt><a href="#">Karen Tracey joins the DSF board</a></dt>
<dd>
by Russell Keith-Magee on Sep. 20, 2013
</dd>
<dt><a href="#">Karen Tracey joins the DSF board</a></dt>
<dd>
by Russell Keith-Magee on Sep. 20, 2013
</dd>
<dt><a href="#">Karen Tracey joins the DSF board</a></dt>
<dd>
by Russell Keith-Magee on Sep. 20, 2013
</dd>
</dl>
<a href="{% url 'weblog:index' %}" class="link-readmore">See all News</a>
</div>
</div>
<div class="example">
<div class="list-collapsing-header">
<h2>List collapsing</h2>
</div>
<ul class="list-collapsing">
<li>
<h2 class="bullet-icon"><i class="icon icon-rss"></i> List section</h2>
<div class="collapsing-content">
<dl class="list-links">
<dt><a href="#">Now it's your turn</a></dt>
<dd>March 29th, 2013 at 4 p.m. by <a href="#">Luke Plant</a></dd>
<dt><a href="#">Mails amb Django - III</a></dt>
<dd>March 28th, 2013 at 12:18 p.m. by <a href="#">Antoni Aloy López</a></dd>
<dt><a href="#">Useful Packages for Django projects (part 1)</a></dt>
<dd>March 28th, 2013 at 11:40 a.m. by <a href="#">Hector Garcia</a></dd>
<dt><a href="#">Overloading Django Form Fields</a></dt>
<dd>March 27th, 2013 at 4 p.m. by <a href="#">pydanny's blog</a></dd>
<dt><a href="#">Django MONTH_CHOICES</a></dt>
<dd>March 26th, 2013 at 4:10 p.m. by <a href="#">Dustin Davis</a></dd>
</dl>
<p class="meta"><a href="#">View more</a> or <a href="#">Add to your feed</a></p>
</div>
</li>
<li>
<h2 class="bullet-icon"><i class="icon icon-rss"></i> List section</h2>
<div class="collapsing-content">
<dl class="list-links">
<dt><a href="#">Now it's your turn</a></dt>
<dd>March 29th, 2013 at 4 p.m. by <a href="#">Luke Plant</a></dd>
<dt><a href="#">Mails amb Django - III</a></dt>
<dd>March 28th, 2013 at 12:18 p.m. by <a href="#">Antoni Aloy López</a></dd>
<dt><a href="#">Useful Packages for Django projects (part 1)</a></dt>
<dd>March 28th, 2013 at 11:40 a.m. by <a href="#">Hector Garcia</a></dd>
<dt><a href="#">Overloading Django Form Fields</a></dt>
<dd>March 27th, 2013 at 4 p.m. by <a href="#">pydanny's blog</a></dd>
<dt><a href="#">Django MONTH_CHOICES</a></dt>
<dd>March 26th, 2013 at 4:10 p.m. by <a href="#">Dustin Davis</a></dd>
</dl>
<p class="meta"><a href="#">View more</a> or <a href="#">Add to your feed</a></p>
</div>
</li>
<li>
<h2 class="bullet-icon"><i class="icon icon-rss"></i> List section</h2>
<div class="collapsing-content">
<dl class="list-links">
<dt><a href="#">Now it's your turn</a></dt>
<dd>March 29th, 2013 at 4 p.m. by <a href="#">Luke Plant</a></dd>
<dt><a href="#">Mails amb Django - III</a></dt>
<dd>March 28th, 2013 at 12:18 p.m. by <a href="#">Antoni Aloy López</a></dd>
<dt><a href="#">Useful Packages for Django projects (part 1)</a></dt>
<dd>March 28th, 2013 at 11:40 a.m. by <a href="#">Hector Garcia</a></dd>
<dt><a href="#">Overloading Django Form Fields</a></dt>
<dd>March 27th, 2013 at 4 p.m. by <a href="#">pydanny's blog</a></dd>
<dt><a href="#">Django MONTH_CHOICES</a></dt>
<dd>March 26th, 2013 at 4:10 p.m. by <a href="#">Dustin Davis</a></dd>
</dl>
<p class="meta"><a href="#">View more</a> or <a href="#">Add to your feed</a></p>
</div>
</li>
</ul>
</div>
</div>
{% endblock content %}
{% block content-related %} {# Always include <h1> label and <div> with aria role. #}
<div role="complementary">
<h2 id="aside-header">Contents</h2>
<ul class="list-outline">
<li><a class="reference internal" href="#">Django Web Style Guide</a>
<ul>
<li>
<a class="reference internal" href="#layout">Page Layout</a>
<ul>
<li><a href="#layout-sidebarleft">Sidebar Left</a></li>
<li><a href="#layout-sidebarright">Sidebar Right</a></li>
<li><a href="#layout-singlecolumn">Single Column</a></li>
<li><a href="#layout-responsive">Responsive</a></li>
</ul>
</li>
<li>
<a class="reference internal" href="#colors">Colors</a>
</li>
<li>
<a class="reference internal" href="#typography">Typography</a>
<ul>
<li><a href="#typography-maincontent">Main content</a></li>
<li><a href="#typography-secondarycontent">Secondary content</a></li>
</ul>
</li>
<li><a class="reference internal" href="#icons">Icons</a></li>
<li><a class="reference internal" href="#elements">Page Elements</a><ul>
<li><a href="#elements-buttons" class="reference internal">Buttons</a></li>
<li><a href="#elements-forms" class="reference internal">Forms</a></li>
<li><a href="#elements-lists" class="reference internal">Lists</a></li>
</ul></li>
</ul>
</li>
</ul>
</div>
{% endblock content-related %}
|