├── .csscomb.json ├── .editorconfig ├── .gitignore ├── .npmrc ├── .yaspellerrc ├── abbreviations.md ├── index.html ├── package.json ├── readme.md └── style.css /.csscomb.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": [ 3 | ".git/**", 4 | "node_modules/**" 5 | ], 6 | "remove-empty-rulesets": true, 7 | "always-semicolon": true, 8 | "block-indent": " ", 9 | "color-case": "lower", 10 | "element-case": "lower", 11 | "color-shorthand": false, 12 | "eof-newline": true, 13 | "leading-zero": true, 14 | "quotes": "double", 15 | "sort-order-fallback": "abc", 16 | "space-before-colon": "", 17 | "space-after-colon": " ", 18 | "space-before-combinator": " ", 19 | "space-after-combinator": " ", 20 | "space-between-declarations": "\n", 21 | "space-before-opening-brace": " ", 22 | "space-after-opening-brace": "\n", 23 | "space-before-selector-delimiter": "", 24 | "space-after-selector-delimiter": "\n", 25 | "space-before-closing-brace": "\n", 26 | "tab-size": 2, 27 | "unitless-zero": true, 28 | "vendor-prefix-align": true, 29 | "strip-spaces": true, 30 | "sort-order": [ 31 | [ 32 | "content", 33 | "position", 34 | "top", 35 | "right", 36 | "bottom", 37 | "left", 38 | "z-index" 39 | ], 40 | [ 41 | "display", 42 | "-webkit-flex", 43 | "-ms-flex", 44 | "flex", 45 | "-webkit-flex-grow", 46 | "flex-grow", 47 | "-webkit-flex-shrink", 48 | "flex-shrink", 49 | "-webkit-flex-basis", 50 | "flex-basis", 51 | "-webkit-flex-flow", 52 | "flex-flow", 53 | "-webkit-flex-direction", 54 | "-ms-flex-direction", 55 | "flex-direction", 56 | "-webkit-flex-wrap", 57 | "flex-wrap", 58 | "-webkit-justify-content", 59 | "justify-content", 60 | "-webkit-align-content", 61 | "align-content", 62 | "-webkit-align-items", 63 | "align-items", 64 | "-webkit-order", 65 | "-ms-flex-order", 66 | "order", 67 | "-webkit-align-self", 68 | "align-self", 69 | "float", 70 | "clear", 71 | "-webkit-box-sizing", 72 | "-moz-box-sizing", 73 | "box-sizing", 74 | "width", 75 | "min-width", 76 | "max-width", 77 | "height", 78 | "min-height", 79 | "max-height", 80 | "margin", 81 | "margin-top", 82 | "margin-right", 83 | "margin-bottom", 84 | "margin-left", 85 | "padding", 86 | "padding-top", 87 | "padding-right", 88 | "padding-bottom", 89 | "padding-left", 90 | "overflow", 91 | "-ms-overflow-x", 92 | "overflow-x", 93 | "-ms-overflow-y", 94 | "overflow-y", 95 | "-webkit-overflow-scrolling" 96 | ], 97 | [ 98 | "list-style", 99 | "list-style-position", 100 | "list-style-type", 101 | "list-style-image", 102 | "border-collapse", 103 | "border-spacing", 104 | "table-layout", 105 | "empty-cells", 106 | "caption-side", 107 | "font", 108 | "font-weight", 109 | "font-size", 110 | "line-height", 111 | "font-family", 112 | "vertical-align", 113 | "text-align", 114 | "direction", 115 | "color", 116 | "text-transform", 117 | "text-decoration", 118 | "font-style", 119 | "font-variant", 120 | "font-size-adjust", 121 | "font-stretch", 122 | "font-effect", 123 | "font-emphasize", 124 | "font-emphasize-position", 125 | "font-emphasize-style", 126 | "font-smooth", 127 | "-webkit-text-align-last", 128 | "-moz-text-align-last", 129 | "-ms-text-align-last", 130 | "text-align-last", 131 | "letter-spacing", 132 | "word-spacing", 133 | "white-space", 134 | "text-emphasis", 135 | "text-emphasis-color", 136 | "text-emphasis-style", 137 | "text-emphasis-position", 138 | "text-indent", 139 | "-ms-text-justify", 140 | "text-justify", 141 | "-ms-writing-mode", 142 | "text-outline", 143 | "text-wrap", 144 | "-ms-text-overflow", 145 | "text-overflow", 146 | "text-overflow-ellipsis", 147 | "text-overflow-mode", 148 | "text-orientation", 149 | "-ms-word-wrap", 150 | "word-wrap", 151 | "-ms-word-break", 152 | "word-break", 153 | "-moz-tab-size", 154 | "-o-tab-size", 155 | "tab-size", 156 | "-webkit-hyphens", 157 | "-moz-hyphens", 158 | "hyphens", 159 | "unicode-bidi", 160 | "columns", 161 | "column-count", 162 | "column-fill", 163 | "column-gap", 164 | "column-rule", 165 | "column-rule-color", 166 | "column-rule-style", 167 | "column-rule-width", 168 | "column-span", 169 | "column-width", 170 | "text-shadow", 171 | "page-break-after", 172 | "page-break-before", 173 | "page-break-inside" 174 | ], 175 | [ 176 | "background", 177 | "background-color", 178 | "background-image", 179 | "background-repeat", 180 | "background-position", 181 | "-ms-background-position-x", 182 | "background-position-x", 183 | "-ms-background-position-y", 184 | "background-position-y", 185 | "-webkit-background-size", 186 | "-moz-background-size", 187 | "-o-background-size", 188 | "background-size", 189 | "-webkit-background-clip", 190 | "-moz-background-clip", 191 | "background-clip", 192 | "background-origin", 193 | "background-attachment", 194 | "box-decoration-break", 195 | "background-blend-mode", 196 | "border", 197 | "border-width", 198 | "border-style", 199 | "border-color", 200 | "border-top", 201 | "border-top-width", 202 | "border-top-style", 203 | "border-top-color", 204 | "border-right", 205 | "border-right-width", 206 | "border-right-style", 207 | "border-right-color", 208 | "border-bottom", 209 | "border-bottom-width", 210 | "border-bottom-style", 211 | "border-bottom-color", 212 | "border-left", 213 | "border-left-width", 214 | "border-left-style", 215 | "border-left-color", 216 | "-webkit-border-radius", 217 | "-moz-border-radius", 218 | "border-radius", 219 | "-webkit-border-top-left-radius", 220 | "-moz-border-radius-topleft", 221 | "border-top-left-radius", 222 | "-webkit-border-top-right-radius", 223 | "-moz-border-radius-topright", 224 | "border-top-right-radius", 225 | "-webkit-border-bottom-right-radius", 226 | "-moz-border-radius-bottomright", 227 | "border-bottom-right-radius", 228 | "-webkit-border-bottom-left-radius", 229 | "-moz-border-radius-bottomleft", 230 | "border-bottom-left-radius", 231 | "-webkit-border-image", 232 | "-moz-border-image", 233 | "-o-border-image", 234 | "border-image", 235 | "-webkit-border-image-source", 236 | "-moz-border-image-source", 237 | "-o-border-image-source", 238 | "border-image-source", 239 | "-webkit-border-image-slice", 240 | "-moz-border-image-slice", 241 | "-o-border-image-slice", 242 | "border-image-slice", 243 | "-webkit-border-image-width", 244 | "-moz-border-image-width", 245 | "-o-border-image-width", 246 | "border-image-width", 247 | "-webkit-border-image-outset", 248 | "-moz-border-image-outset", 249 | "-o-border-image-outset", 250 | "border-image-outset", 251 | "-webkit-border-image-repeat", 252 | "-moz-border-image-repeat", 253 | "-o-border-image-repeat", 254 | "border-image-repeat", 255 | "outline", 256 | "outline-width", 257 | "outline-style", 258 | "outline-color", 259 | "outline-offset", 260 | "-webkit-box-shadow", 261 | "-moz-box-shadow", 262 | "box-shadow", 263 | "-webkit-transform", 264 | "-moz-transform", 265 | "-ms-transform", 266 | "-o-transform", 267 | "transform", 268 | "-webkit-transform-origin", 269 | "-moz-transform-origin", 270 | "-ms-transform-origin", 271 | "-o-transform-origin", 272 | "transform-origin", 273 | "-webkit-backface-visibility", 274 | "-moz-backface-visibility", 275 | "backface-visibility", 276 | "-webkit-perspective", 277 | "-moz-perspective", 278 | "perspective", 279 | "-webkit-perspective-origin", 280 | "-moz-perspective-origin", 281 | "perspective-origin", 282 | "-webkit-transform-style", 283 | "-moz-transform-style", 284 | "transform-style", 285 | "visibility", 286 | "cursor", 287 | "opacity", 288 | "-webkit-filter", 289 | "filter" 290 | ], 291 | [ 292 | "-webkit-transition", 293 | "-moz-transition", 294 | "-ms-transition", 295 | "-o-transition", 296 | "transition", 297 | "-webkit-transition-delay", 298 | "-moz-transition-delay", 299 | "-ms-transition-delay", 300 | "-o-transition-delay", 301 | "transition-delay", 302 | "-webkit-transition-timing-function", 303 | "-moz-transition-timing-function", 304 | "-ms-transition-timing-function", 305 | "-o-transition-timing-function", 306 | "transition-timing-function", 307 | "-webkit-transition-duration", 308 | "-moz-transition-duration", 309 | "-ms-transition-duration", 310 | "-o-transition-duration", 311 | "transition-duration", 312 | "-webkit-transition-property", 313 | "-moz-transition-property", 314 | "-ms-transition-property", 315 | "-o-transition-property", 316 | "transition-property", 317 | "-webkit-animation", 318 | "-moz-animation", 319 | "-ms-animation", 320 | "-o-animation", 321 | "animation", 322 | "-webkit-animation-name", 323 | "-moz-animation-name", 324 | "-ms-animation-name", 325 | "-o-animation-name", 326 | "animation-name", 327 | "-webkit-animation-duration", 328 | "-moz-animation-duration", 329 | "-ms-animation-duration", 330 | "-o-animation-duration", 331 | "animation-duration", 332 | "-webkit-animation-play-state", 333 | "-moz-animation-play-state", 334 | "-ms-animation-play-state", 335 | "-o-animation-play-state", 336 | "animation-play-state", 337 | "-webkit-animation-timing-function", 338 | "-moz-animation-timing-function", 339 | "-ms-animation-timing-function", 340 | "-o-animation-timing-function", 341 | "animation-timing-function", 342 | "-webkit-animation-delay", 343 | "-moz-animation-delay", 344 | "-ms-animation-delay", 345 | "-o-animation-delay", 346 | "animation-delay", 347 | "-webkit-animation-iteration-count", 348 | "-moz-animation-iteration-count", 349 | "-ms-animation-iteration-count", 350 | "-o-animation-iteration-count", 351 | "animation-iteration-count", 352 | "-webkit-animation-direction", 353 | "-moz-animation-direction", 354 | "-ms-animation-direction", 355 | "-o-animation-direction", 356 | "animation-direction" 357 | ], 358 | [ 359 | "quotes", 360 | "counter-reset", 361 | "counter-increment", 362 | "resize", 363 | "-webkit-user-select", 364 | "-moz-user-select", 365 | "-ms-user-select", 366 | "user-select", 367 | "nav-index", 368 | "nav-up", 369 | "nav-right", 370 | "nav-down", 371 | "nav-left", 372 | "pointer-events", 373 | "will-change", 374 | "clip", 375 | "clip-path", 376 | "zoom" 377 | ] 378 | ] 379 | } 380 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Универсальные настройки редактора 2 | # 3 | # https://habrahabr.ru/post/220131/ 4 | # Скачать плагин: http://editorconfig.org/#download 5 | # Sublime Text: https://packagecontrol.io/packages/EditorConfig 6 | # Atom: https://github.com/sindresorhus/atom-editorconfig 7 | 8 | root = true 9 | 10 | [*] 11 | charset = utf-8 12 | indent_style = space 13 | indent_size = 2 14 | end_of_line = lf 15 | trim_trailing_whitespace = true 16 | insert_final_newline = true 17 | 18 | [*.{rb,php}] 19 | indent_size = 4 20 | 21 | [*.md] 22 | trim_trailing_whitespace = false 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Saved/ 2 | _arc/ 3 | bower_components/ 4 | node_modules/ 5 | .vscode/ 6 | .DS_Store 7 | *.log 8 | *.sublime-* 9 | *.rar 10 | *.zip 11 | .idea 12 | .publish 13 | ex_files 14 | Thumbs.db 15 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | loglevel=silent 2 | -------------------------------------------------------------------------------- /.yaspellerrc: -------------------------------------------------------------------------------- 1 | { 2 | "excludeFiles": [ 3 | ".git", 4 | "node_modules" 5 | ], 6 | "lang": "ru", 7 | "fileExtensions": [ 8 | ".md", 9 | ".html", 10 | ".css" 11 | ], 12 | "dictionary": [ 13 | "Кодгайд", 14 | "вендорными", 15 | "вендорный", 16 | "вендорные", 17 | "слэш", 18 | "ричные", 19 | "коммит", 20 | "коммитом", 21 | "коммита", 22 | "коммиту", 23 | "транслит" 24 | ], 25 | "ignoreTags": ["script"], 26 | "ignoreUrls": true, 27 | "findRepeatWords": false 28 | } 29 | -------------------------------------------------------------------------------- /abbreviations.md: -------------------------------------------------------------------------------- 1 | # Словарь допустимых сокращений в именах классов 2 | 3 | Слово | Сокращения 4 | ------------ | ------------- 5 | `button` | `btn` 6 | `dropdown` | `drop` 7 | `wrapper` | `wrap` 8 | `background` | `bg` 9 | `column` | `col` 10 | `image` | `img` 11 | `picture` | `pict` 12 | `extra-small` | `xs` 13 | `small` | `sm` 14 | `medium` | `md` 15 | `large` | `lg` 16 | `extra-large` | `xl` 17 | 18 | Дополнительно: 19 | 20 | - [Слова, часто используемые в CSS-классах](https://github.com/yoksel/common-words) 21 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Руководство по написанию кода 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 |

Руководство по написанию кода

18 |

Стандарты для разработки гибкого, надежного и поддерживаемого кода на HTML и CSS.

19 |
20 |
21 | 22 | 23 | 24 |
25 |

Оглавление

26 |
27 |
28 |
29 |

HTML

30 | 47 |
48 |
49 |

CSS

50 | 76 |
77 |
78 | 79 | 80 | 81 |
82 |
83 |

Золотое правило

84 |

Соблюдайте предложенные здесь соглашения. Если вы нашли ошибку, сообщите об этом. Если у вас есть что дополнить или вы хотите принять участие в разработке этих соглашений, пожалуйста, создайте issue на GitHub.

85 |
86 |
87 |
88 |

Вне зависимости от количества разработчиков, код в любом проекте должен быть написан так, словно его писал один человек.

89 |
90 |
91 |
92 | 93 | 94 | 95 |
96 |

HTML

97 |
98 | 99 |
100 |
101 |

Синтаксис

102 | 110 |
111 |
112 |
113 |       <nav class="main-nav">
114 |         <ul>
115 |           <li><a href="/index.html">Главная</a></li>
116 |           <li><a href="/contacts.html">Контакты</a></li>
117 |         </ul>
118 |       </nav>
119 |       <br>
120 |       <img src="logo.svg" width="50" height="50" alt="Company">
121 |     
122 |
123 |
124 | 125 |
126 |
127 |

Обязательные компоненты разметки

128 | 133 |
134 |
135 |
136 |       <!DOCTYPE html>
137 |       <html lang="ru">
138 |         <head>
139 |           <meta charset="UTF-8">
140 |           <title>Заголовок страницы</title>
141 |         </head>
142 |         <body>
143 |           <img src="logo.svg" width="50" height="50" alt="Company">
144 |           <h1>Привет, мир!</h1>
145 |         </body>
146 |       </html>
147 |     
148 |
149 |
150 | 151 |
152 |
153 |

Подключение CSS и JavaScript

154 |

При подключении CSS и JavaScript файлов не указывайте атрибут type (text/css для стилей и text/javascript для скриптов являются значениями по умолчанию).

155 |

CSS-файлы подключайте в <head>, JavaScript-файлы — перед </body>

156 |
157 |
158 |
159 |       <!-- Внешний CSS -->
160 |       <link rel="stylesheet" href="style.css">
161 |        
162 |       <!-- Внешний JavaScript -->
163 |       <script src="script.js"></script>
164 |     
165 |
166 |
167 | 168 |
169 |
170 |

Порядок атрибутов

171 |

Очередность атрибутов должна быть единообразной.

172 |

Указывайте атрибуты data-*, aria-*, role и логические атрибуты последними.

173 |
174 |
175 |
176 |       <a class="btn" href="#modal-call-me" data-modal="toggle">Перезвоните</a>
177 |        
178 |       <input type="text" class="field-text" disabled>
179 |        
180 |       <img src="logo.svg" width="50" height="50" alt="Company">
181 |     
182 |
183 |
184 | 185 |
186 |
187 |

Разное

188 | 194 |
195 |
196 |
197 |       <header class="page-header">
198 |         <a href="/" class="logo">
199 |           <img src="logo.svg" width="50" height="50" alt="Company">
200 |         </a>
201 |         ...
202 |         <a href="/login" class="login">Войти</a>
203 |         <!-- <a href="/logout" class="login">Выйти</a> -->
204 |       </header>
205 |        
206 |       <section class="catalog">
207 |         ...
208 |       </section>
209 |     
210 |
211 |
212 | 213 | 214 | 215 | 216 | 217 |
218 |

CSS

219 |
220 | 221 |
222 |
223 |

Синтаксис

224 | 242 |
243 |
244 |
245 |       /* Хороший CSS */
246 |       .selector > .some,
247 |       .selector-secondary {
248 |         padding: 15px;
249 |         margin-bottom: 15px;
250 |         line-height: 1;
251 |         background-color: rgba(0,0,0,0.5);
252 |         box-shadow: 0 1px 2px #ccc, inset 0 1px 0 #fff;
253 |       }
254 |        
255 |       /* Плохой CSS */
256 |       .selector>.some ,.selector-secondary{
257 |         padding:15px;
258 |           margin:0 0px 15px;
259 |          line-height :1em;
260 |         background-color: rgba(0, 0, 0, .5);
261 |         box-shadow:0 1px 2px #ccc,inset 0 1px 0 #FFF;}
262 |     
263 |
264 |
265 | 266 |
267 |
268 |

Селекторы

269 | 280 |

Используйте БЭМ-именование, если знакомы с этой методологией.

281 |
282 |
283 |
284 |       /* Хорошие селекторы */
285 |       .page-header { ... }
286 |       .comment { ... }
287 |       .sidebar { ... }
288 |       .gallery { ... }
289 |       .gallery__item { ... }
290 |        
291 |       /* Плохие селекторы */
292 |       .t { ... }
293 |       .root span a { ... }
294 |       .red { ... }
295 |       .my_block { ... }
296 |       .HeaderOfMyBlock { ... }
297 |       .eto-moy-perviy-klass { ... }
298 |     
299 |
300 |
301 | 302 |
303 |
304 |

Порядок объявления

305 |

Объявления логически связанных свойств должны быть сгруппированы в следующем порядке:

306 |
    307 |
  1. Позиционирование
  2. 308 |
  3. Блочная модель и размеры
  4. 309 |
  5. Текстовые свойства
  6. 310 |
  7. Отображение
  8. 311 |
  9. Остальное
  10. 312 |
  11. Плавные переходы, анимация
  12. 313 |
314 |

Позиционирование может удалить элемент из нормального потока документа и переопределить блочную модель связанных стилей, поэтому указывайте его первым. Блочная модель диктует размеры и расположение компонента, пишите ее второй.

315 |

В примере кода группы правил разделены пустыми строками. Делать такие разделители не обязательно.

316 |
317 |
318 |
319 |       .selector {
320 |         position: absolute;
321 |         top: 0;
322 |         right: 0;
323 |         bottom: 0;
324 |         left: 0;
325 |         z-index: 100;
326 |          
327 |         display: block;
328 |         float: right;
329 |         width: 100px;
330 |         height: 100px;
331 |          
332 |         font: 13px/1.5 "Helvetica Neue", sans-serif;
333 |         color: #333;
334 |         text-align: center;
335 |          
336 |         background-color: #f5f5f5;
337 |         border: 1px solid #e5e5e5;
338 |         border-radius: 3px;
339 |         opacity: 1;
340 |          
341 |         transition: all 0.3s;
342 |       }
343 |     
344 |
345 |
346 | 347 |
348 |
349 |

Быстрое чтение

350 |

Оставляте пустую строку перед селектором или группой селекторов.

351 |

Работая с CSS-препроцессорами, оставляйте пустую строку перед любым вложенным селектором и @media.

352 |
353 |
354 |
355 |       /* В CSS-файле: */
356 |       .promo {...}
357 |        
358 |       .gallery {...}
359 |        
360 |       /* В препроцессорном файле: */
361 |       .promo {
362 |         display: block;
363 |        
364 |         &__container {...}
365 |        
366 |         &__item {...}
367 |       }
368 |     
369 |
370 |
371 | 372 |
373 |
374 |

Сокращенная запись

375 |

Избегайте сокращенных объявлений. К примеру, если нужно задать только нижний внешний отступ, пишите margin-bottom: 10px; вместо margin: 0 0 10px;

376 |
377 |
378 |
379 |       /* Хорошо */
380 |       .element {
381 |         margin-bottom: 10px;
382 |         background-color: red;
383 |         background-image: url("image.jpg");
384 |         border-top-left-radius: 3px;
385 |         border-top-right-radius: 3px;
386 |       }
387 |        
388 |       /* Плохо */
389 |       .element {
390 |         margin: 0 0 10px;
391 |         background: red;
392 |         background: url("image.jpg");
393 |         border-radius: 3px 3px 0 0;
394 |       }
395 |     
396 |
397 |
398 | 399 |
400 |
401 |

Не используйте @import

402 |

По сравнению с тегом <link> правило @import работает медленнее и может вызвать иные непредвиденные проблемы. Не используйте @import, используйте альтернативные подходы:

403 | 408 |
409 |
410 |
411 |       <!-- Используйте тег link -->
412 |       <link rel="stylesheet" href="style.css">
413 |        
414 |       <!-- Не используйте @imports -->
415 |       <style>
416 |         @import url("more-styles.css"); /* Плохо! Не надо так! */
417 |       </style>
418 |     
419 |
420 |
421 | 422 |
423 |
424 |

@media

425 |

Помещайте media queries настолько близко к соответствующим наборам правил, насколько это возможно. Не объединяйте их в отдельную таблицу стилей, не помещайте их в конце файла.

426 |

Ставьте пробелы вокруг полукруглых скобок.

427 |

Ставьте пробел перед указанием значения в условии.

428 |
429 |
430 |
431 |       /* В CSS-файле (без препроцессоров): */
432 |       .element {
433 |         display: block;
434 |       }
435 |        
436 |       @media (min-width: 480px) {
437 |         .element {
438 |           display: none;
439 |         }
440 |       }
441 |        
442 |       /* В препроцессорном файле: */
443 |       .element {
444 |         display: block;
445 |        
446 |         @media (min-width: $screen-sm) {
447 |           display: none;
448 |         }
449 |       }
450 |     
451 |
452 |
453 | 454 |
455 |
456 |

Свойства с префиксами

457 |

Оставляйте отступы для каждого свойства так, чтобы значения выстраивались в вертикальную линию.

458 |

Не пишите свойства с вендорными префиксами вручную. Используете Autoprefixer в рамках автоматизации или его он-лайн сервис.

459 |
460 |
461 |
462 |       .selector {
463 |         -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.15);
464 |                 box-shadow: 0 1px 2px rgba(0,0,0,0.15);
465 |       }
466 |     
467 |
468 |
469 | 470 | 475 | 476 | 482 | 483 | 484 | 485 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code_guide", 3 | "version": "1.0.0", 4 | "description": "Руководство по написанию кода", 5 | "scripts": { 6 | "test": "yaspeller -e \".md,.html,.css\" .", 7 | "precommit": "npm test" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git@github.com:epixx/code-guide.git" 12 | }, 13 | "keywords": [], 14 | "author": "Nikolay Gromov", 15 | "license": "MIT", 16 | "bugs": { 17 | "url": "https://github.com/epixx/code-guide/issues" 18 | }, 19 | "homepage": "https://github.com/epixx/code-guide#readme", 20 | "devDependencies": { 21 | "husky": "^0.13.1", 22 | "yaspeller": "^3.0.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Кодгайд Epic Skills для взрослых верстальщиков 2 | 3 | [Смотреть](https://epixx.github.io/code-guide/) 4 | 5 | Автоматизация: проверка орфографии по `npm test` (нужно поставить зависимости: `npm i`). 6 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 1024px) { 6 | html { 7 | font-size: 18px; 8 | } 9 | } 10 | 11 | body { 12 | margin: 0; 13 | font: 1rem/1.5 "PT Sans", sans-serif; 14 | color: #5a5a5a; 15 | } 16 | 17 | a { 18 | color: #08c; 19 | text-decoration: none; 20 | } 21 | 22 | a:hover { 23 | text-decoration: underline; 24 | } 25 | 26 | h1, 27 | h2, 28 | h3, 29 | h4 { 30 | margin: 0 0 0.5rem; 31 | font-weight: 400; 32 | line-height: 1; 33 | color: #2a2a2a; 34 | letter-spacing: -0.05em; 35 | } 36 | 37 | h1 { 38 | font-size: 3rem; 39 | } 40 | 41 | h2 { 42 | font-size: 2.5rem; 43 | } 44 | 45 | h3 { 46 | font-size: 1.75rem; 47 | } 48 | 49 | h4 { 50 | font-size: 1.25rem; 51 | } 52 | 53 | p { 54 | margin: 0 0 1rem; 55 | } 56 | 57 | .lead { 58 | font-size: 1.3rem; 59 | } 60 | 61 | blockquote { 62 | position: relative; 63 | margin: 0 1rem 1rem; 64 | font-style: italic; 65 | color: #7a7a7a; 66 | } 67 | 68 | .highlight pre, 69 | blockquote p { 70 | margin-bottom: 0; 71 | } 72 | 73 | ul li { 74 | margin-bottom: .25rem; 75 | } 76 | 77 | blockquote:last-child, 78 | p:last-child, 79 | ul:last-child { 80 | margin-bottom: 0; 81 | } 82 | 83 | code, 84 | pre { 85 | font-family: "PT Mono", Menlo, "Courier New", monospace; 86 | font-size: 85%; 87 | } 88 | 89 | code { 90 | padding: 2px 4px; 91 | color: #d44950; 92 | background-color: #f7f7f9; 93 | border-radius: 0.2rem; 94 | } 95 | 96 | pre { 97 | display: block; 98 | line-height: 1.4; 99 | margin-bottom: 1em; 100 | counter-reset: code; 101 | white-space: normal; 102 | } 103 | 104 | code[class*=language-] { 105 | display: block; 106 | border-radius: 0; 107 | line-height: 2; 108 | font-size: 1em; 109 | white-space: pre; 110 | -moz-tab-size: 2; 111 | -o-tab-size: 2; 112 | tab-size: 2; 113 | } 114 | 115 | .highlight { 116 | margin: 0; 117 | } 118 | 119 | .highlight+.highlight { 120 | margin-top: 1rem; 121 | } 122 | 123 | .col { 124 | padding: 2rem 1rem; 125 | } 126 | 127 | .col p { 128 | max-width: 40rem; 129 | } 130 | 131 | .col + .col { 132 | border-top: 1px solid #dfe1e8; 133 | background-color: #F8F8F8; 134 | } 135 | 136 | @media (min-width: 1024px) { 137 | .col { 138 | padding: 2rem; 139 | } 140 | } 141 | 142 | @media (min-width: 1024px) { 143 | .section { 144 | display: table; 145 | width: 100%; 146 | table-layout: fixed; 147 | } 148 | .col { 149 | display: table-cell; 150 | padding: 3rem; 151 | vertical-align: top; 152 | } 153 | .col+.col { 154 | border-top: 0; 155 | } 156 | } 157 | 158 | .masthead { 159 | padding: 3rem 1rem; 160 | color: rgba(255,255,255,0.5); 161 | text-align: center; 162 | background-color: #FF6300; 163 | } 164 | 165 | .masthead h1 { 166 | color: #fff; 167 | margin-bottom: 0.25rem; 168 | } 169 | 170 | .masthead .icon { 171 | display: inline-block; 172 | font-size: 3rem; 173 | margin: 0 0.5rem; 174 | } 175 | 176 | .masthead-links { 177 | font-size: 2rem; 178 | } 179 | 180 | .masthead-links a { 181 | color: rgba(255,255,255,0.5); 182 | text-decoration: none; 183 | -webkit-transition: all 0.15s linear; 184 | transition: all 0.15s linear; 185 | } 186 | 187 | .masthead-links a:hover { 188 | color: #fff; 189 | } 190 | 191 | @media (min-width: 1024px) { 192 | .masthead { 193 | padding-top: 4rem; 194 | padding-bottom: 4rem; 195 | } 196 | } 197 | 198 | .heading { 199 | padding: 2rem 1rem 1.5rem; 200 | background-color: #434343; 201 | color: #fff; 202 | } 203 | 204 | .heading * { 205 | color: inherit; 206 | } 207 | 208 | @media (min-width: 1024px) { 209 | .heading { 210 | padding: 3rem 3rem 2.5rem; 211 | } 212 | } 213 | 214 | .section { 215 | border-bottom: 1px solid #dfe1e8; 216 | } 217 | 218 | .footer { 219 | padding: 3rem 1rem; 220 | font-size: 90%; 221 | text-align: center; 222 | } 223 | 224 | .footer p { 225 | margin-bottom: 0.5rem; 226 | } 227 | 228 | code[class*=language-], 229 | pre[class*=language-] { 230 | color: #393a34; 231 | font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; 232 | direction: ltr; 233 | text-align: left; 234 | word-spacing: normal; 235 | word-break: normal; 236 | font-size: 0.95em; 237 | line-height: 1.2em; 238 | -moz-tab-size: 4; 239 | -o-tab-size: 4; 240 | tab-size: 4; 241 | -webkit-hyphens: none; 242 | -ms-hyphens: none; 243 | hyphens: none; 244 | } 245 | 246 | pre[class*=language-] { 247 | padding: 1em; 248 | margin: 0.5em 0; 249 | overflow: auto; 250 | } 251 | 252 | :not(pre)>code[class*=language-] { 253 | padding: 1px 0.2em; 254 | background: #f8f8f8; 255 | border: 1px solid #ddd; 256 | } 257 | 258 | .token.cdata, 259 | .token.comment, 260 | .token.doctype, 261 | .token.prolog { 262 | color: #969896; 263 | } 264 | 265 | .token.namespace { 266 | opacity: 0.7; 267 | } 268 | 269 | .token.attr-value, 270 | .token.string { 271 | color: #183691; 272 | } 273 | 274 | .token.operator, 275 | .token.punctuation { 276 | color: #795da3; 277 | } 278 | 279 | .token.boolean, 280 | .token.constant, 281 | .token.entity, 282 | .token.inserted, 283 | .token.number, 284 | .token.property, 285 | .token.regex, 286 | .token.symbol, 287 | .token.url, 288 | .token.variable { 289 | color: #36acaa; 290 | } 291 | 292 | .language-autohotkey .token.selector, 293 | .token.atrule, 294 | .token.attr-name, 295 | .token.keyword { 296 | color: #795da3; 297 | } 298 | 299 | .language-autohotkey .token.tag, 300 | .token.deleted, 301 | .token.function { 302 | color: #9a050f; 303 | } 304 | 305 | .language-autohotkey .token.keyword, 306 | .token.selector, 307 | .token.tag { 308 | color: #63a35c; 309 | } 310 | 311 | .token.bold, 312 | .token.function, 313 | .token.important { 314 | font-weight: 700; 315 | } 316 | 317 | .token.italic { 318 | font-style: italic; 319 | } 320 | 321 | .github-btn { 322 | display: inline-block; 323 | vertical-align: middle; 324 | border: 0; 325 | } 326 | --------------------------------------------------------------------------------