Styleguide
This is the Panjiva styleguide. There are many like it but this one's ours. It borrows heavily from Flat UI and Mailchimp's pattern library. The styleguide defines everything in ems and percentages to make a future transition to responsive Panjiva easier.
Example pages:
Grid
Code notes
This code was borrowed from object oriented css. You can use units like 2/3 of 7/8 to make widths span several columns, and nest .line divs inside .line divs. Use .lastUnit
on the last unit to remove right-margin. The units are defined in ems and percentages so feel free to use on non-960 grids.
<div class="line>
<div class="unit size1of2">Half width</div>
<div class="unit size1of4">Quarter width</div>
<div class="unit size1of4 lastUnit">Quarter width</div>
</div>
.alignRight
class to shift something to the right. Unlike float, this preserves order and doesn't break page flow. Code on the right results in:
<div class="line">
<div class="unit size1of2"><h3>Section title</h3></div>
<div class="unit size1of2 lastUnit alignRight">
<a href="">Link1</a>
<a href="">Link2</a>
</div>
</div>
Typography
H0 marketing headline
H1 headline
H2 subheadline
H3 section header
H4 section section header
Xlarge text. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Large text. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Normal text. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Bolded text is in Helvetica Neue Medium. This is a link.
Code notes
Much of the theory of typography comes from The Elements of Typographic Style Applied to the Web.
Our title font is Avenir Heavy and our body fonts are Helvetica Neue Light (normal) and Helvetical Neue Medium (bold). These are defined by $titleFontStack
and $bodyFontStack
.
Use <h1>
, <h2>
, <h3>
, <h4>
, .xlarge
, .large
, and .normal
to keep typography consistent. You can use .h0
for an extra big text as well as any of the headers as classes (.h1
, .h2
, etc). There is a secret .small
class but use it wisely. Smaller text strains people's eyes, especially those of older users.
Use p
tags to wrap non-heading and form text. They have a max-width that keeps text readable.
For all text including headings and buttons, capitalize only the first letter. All caps text is harder to read and looks too formal.
P.S. Letterspacing is a font crime.
Color
#ECF0F1
#BDC3C7
#95A5A6
#7F8C8D
#34495E
#2C3E50
#15BDED
#00A1CF
#2ECC71
#27AE60
#F1C40F
#F39C12
#E67E22
#D35400
#E74C3C
#C0392B
#9B59B6
#8E44AD
Code notes
Tint color by adding white and shade colors by adding black. This keeps our color scheme consistent. With Sass this is done with darken($color, 20%)
and lighter($color, 20%)
. Our main color is $blueLight
and Panjiva blue is $blueDark
. Green (#2ECC71) means success and red (#E74C3C) means danger.
Forms
Code notes
Unfortunately profileV4 overrides many of these styles. That's why there are several !important additions. If this causes you grief, my apologies.
Navigation
<ul class="localNav">
<li class="active"><a href="">Account</a></li>
<li><a href="">Profile</a></li>
<li><a href="">Order History</a></li>
</ul>
Table
Name | |
Sally Sullivan (me) | ssullivan@furniture.com |
Alex Subotnick | asubotnick@furniture.com |
<table>
<thead>
<tr>
<td>Name</td>
<td>Email</td>
</tr>
</thead>
<tr>
<td>Sally Sullivan (me)</td>
<td>ssullivan@furniture.com</td>
</tr>
<tr>
<td>Alex Subotnick</td>
<td>asubotnick@furniture.com</td>
</tr>
<tr class="focus">
<td>
<fieldset>
<label for="inputFirstName">Name</label>
<input type="text" placeholder="" id="inputFirstName">
</fieldset>
</td>
<td>
<fieldset>
<span class="label">It's free!</span><br>
<button>Invite User</button>
</fieldset>
</td>
</tr>
</table>
Icons
.panjiva-icon-shipments-lg .largeIcon
.panjiva-icon-contact-lg .largeIcon
.panjiva-icon-mail-lg .largeIcon
.panjiva-icon-factory-lg .largeIcon
.panjiva-icon-tools-lg .largeIcon
.panjiva-icon-search-lg .largeIcon
.panjiva-icon-company-search-lg .largeIcon
.panjiva-icon-building-lg .largeIcon
Icon block
panjiva-icon-user iconBlock disabled
panjiva-icon-user iconBlock