-
Couldn't load subscription status.
- Fork 0
Style Guide
Kevin Parra edited this page Nov 2, 2023
·
1 revision
- Keep it simple and reuse as much as possible.
- Code that looks like it was written by one person.
- Write for scalability.

- We use BEM as a code creation methodology.
- File names in plural (Example: buttons.scss)
- Classes in singular and lowercase (Example: .gallery__button)
- Name images relative to their block. (Example: hero_background.png)
- Space after the selector and before {}
- Spaces for indentation.
- Space after the :
- CSS blocks separated by 2 lines
- Avoid nesting abuse. Limit 1 level
- Mixins for size, styles, and numerical font values.
Properties and selectors should be sorted as follows:
- Box model properties (display, width, height, margin, etc)
- Positioning (position, left, top, right, etc)
- Typography (text-transform, text-decoration)
- Decoration (background-image, color, etc)
- Variables
- Mixins
.button {
padding: 20px 30px;
display: block;
position: relative;
width: 220px;
height: 40px;
text-transform: uppercase;
font-weight: $semibold;
color: #ffff;
background-color: #333333;
@include font-size(13px);
}