Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
K
kpp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Veselov
kpp
Commits
50cec550
Commit
50cec550
authored
Dec 04, 2017
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Допиливаю блоки
parent
e347b722
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
24 deletions
+57
-24
projectConfig.json
projectConfig.json
+1
-1
blocks-library.pug
src/blocks-library.pug
+9
-0
comment.pug
src/blocks/comment/comment.pug
+35
-0
comment.scss
src/blocks/comment/comment.scss
+10
-3
readme.md
src/blocks/comment/readme.md
+0
-0
media.html
src/blocks/media/media.html
+0
-20
mixins.pug
src/pug/mixins.pug
+2
-0
No files found.
projectConfig.json
View file @
50cec550
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
"off-canvas"
:
[],
"off-canvas"
:
[],
"burger"
:
[],
"burger"
:
[],
"progress"
:
[],
"progress"
:
[],
"
media
"
:
[],
"
comment
"
:
[],
"modal"
:
[],
"modal"
:
[],
"close"
:
[],
"close"
:
[],
"tabs"
:
[],
"tabs"
:
[],
...
...
src/blocks-library.pug
View file @
50cec550
...
@@ -562,6 +562,15 @@ block content
...
@@ -562,6 +562,15 @@ block content
+block-lib-code()
+block-lib-code()
include:show-code(first-line="//- Pug-файл этого блока:") blocks/pie-chart/pie-chart.pug
include:show-code(first-line="//- Pug-файл этого блока:") blocks/pie-chart/pie-chart.pug
+block-lib('comment', 'Комментарий', false)
include:markdown-it(linkify html='true' typographer='true' quotes='«»') blocks/comment/readme.md
+comment('Джокер', 'img/joker.jpg')
p Аватар — не ссылка
+comment('Джокер', 'img/joker.jpg', '/', 'admin')
p Аватар — ссылка
+block-lib-code()
include:show-code(first-line="//- Pug-файл этого блока:") blocks/comment/comment.pug
.burger.blocks-library__menu-toggler(data-toggle="off-canvas")
.burger.blocks-library__menu-toggler(data-toggle="off-canvas")
...
...
src/blocks/comment/comment.pug
0 → 100644
View file @
50cec550
//- Все примеси в этом файле должны начинаться c имени блока (comment)
mixin comment(username, avatarURL, authorURL, mods)
//- Принимает:
//- username {string} - имя пользователя
//- avatarURL {string} - адрес изображения с аватаром
//- authorURL {string} - адрес изображения с аватаром
//- mods {string} - список модификаторов
//- Вызов:
+comment('Джокер', 'img/joker.jpg')
p Текст
+comment('Джокер', 'img/joker.jpg', '/joker', 'admin')
p Текст
-
// список модификаторов
var allMods = '';
if(typeof(mods) !== 'undefined' && mods) {
var modsList = mods.split(',');
for (var i = 0; i < modsList.length; i++) {
allMods = allMods + ' comment--' + modsList[i].trim();
}
}
article.comment(class=allMods)&attributes(attributes)
if(typeof(authorURL) !== 'undefined' && authorURL)
a.comment__avatar-wrap(href=authorURL)
img(src=avatarURL, alt=username)
else
span.comment__avatar-wrap
img(src=avatarURL, alt=username)
.comment__body
b.comment__author= username
block
src/blocks/
media/media
.scss
→
src/blocks/
comment/comment
.scss
View file @
50cec550
// В этом файле должны быть стили для БЭМ-блока
media
, его элементов,
// В этом файле должны быть стили для БЭМ-блока
comment
, его элементов,
// модификаторов, псевдоселекторов, псевдоэлементов, @media-условий...
// модификаторов, псевдоселекторов, псевдоэлементов, @media-условий...
// Очередность: http://nicothin.github.io/idiomatic-pre-CSS/#priority
// Очередность: http://nicothin.github.io/idiomatic-pre-CSS/#priority
.
media
{
.
comment
{
$block-name
:
&
;
// #{$block-name}__element
$block-name
:
&
;
// #{$block-name}__element
...
@@ -10,9 +10,16 @@
...
@@ -10,9 +10,16 @@
margin-top
:
$line-height
;
margin-top
:
$line-height
;
margin-bottom
:
$line-height
;
margin-bottom
:
$line-height
;
&
__
picture
{
&
__
avatar-wrap
{
flex-shrink
:
0
;
flex-shrink
:
0
;
margin-right
:
1em
;
margin-right
:
1em
;
img
{
display
:
block
;
width
:
60px
;
height
:
60px
;
object-fit
:
cover
;
}
}
}
&
__body
{
&
__body
{
...
...
src/blocks/comment/readme.md
0 → 100644
View file @
50cec550
src/blocks/media/media.html
deleted
100644 → 0
View file @
e347b722
<!--DEV
Для использования этого файла как шаблона:
@ @include('blocks/media/media.html')
(Нужно убрать пробел между символами @)
Подробнее: https://www.npmjs.com/package/gulp-file-include
<article class="media">
<div class="media__picture">
<img class="thumb" src="img/joker.jpg" alt="" width="150">
</div>
<div class="media__body">
<p>Далеко-далеко за словесными горами в стране, гласных и согласных живут рыбные тексты. Запятой если рыбного всемогущая выйти за но, то щеке, одна свое снова сбить вопроса? Семь свой, его это. Силуэт!</p>
</div>
</article>
-->
src/pug/mixins.pug
View file @
50cec550
...
@@ -26,3 +26,5 @@ include ../blocks/pagination/pagination.pug
...
@@ -26,3 +26,5 @@ include ../blocks/pagination/pagination.pug
include ../blocks/breadcrumbs/breadcrumbs.pug
include ../blocks/breadcrumbs/breadcrumbs.pug
include ../blocks/progress/progress.pug
include ../blocks/progress/progress.pug
include ../blocks/pie-chart/pie-chart.pug
include ../blocks/pie-chart/pie-chart.pug
include ../blocks/comment/comment.pug
//- include ../blocks/comments/comments.pug
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment