Skip to content

Commit efe3a29

Browse files
author
Walle Cyril
committed
CSS Stlye Guide
1 parent fe2052c commit efe3a29

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

css/css_style_guide.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# CSS Stlye Guide
2+
3+
## Semantics first
4+
5+
Want to make text look big ? Think about the reason first, maybe it is a title and `<h1-6>` should be used. Maybe it is an important word, use `<strong>`. Once the correct semantic is used, you may have a selector ready.
6+
7+
## Sub-categorize CSS
8+
9+
1. Company CSS (brand, colors, logo, typography)
10+
2. Site CSS (colors, visual design)
11+
3. Site Category CSS (Consistent visual for a site category (news, weather))
12+
4. Page Specific CSS (used only on 1 page)
13+
14+
By putting the most common CSS in company wide css, you get visual consistency for free, and best code reuse. Alternatively with SASS or LESS, one could declare site-wide variables and import those where required.
15+
16+
* 1 Component, 1 CSS
17+
18+
Can be further extended on individual site categories or pages.
19+
20+
## Selectors
21+
22+
Should be as short as possible. Use the element selector only when it makes sense (e.g for site wide styles) . Use descendant, and child selector when the associated markup also follows this hierarchy
23+
24+
25+
## Key-Value Pairs
26+
27+
Put the most important ones first
28+
29+
0. Content
30+
1. Positioning and layout
31+
2. Margin, Border, Padding, Width, Height
32+
3. Font
33+
4. Colors
34+
35+
## Media Queries

0 commit comments

Comments
 (0)