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
ad837c52
Commit
ad837c52
authored
Dec 07, 2017
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Закрытие для алертов
parent
79bfecf8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
8 deletions
+49
-8
blocks-demo.pug
src/blocks-demo.pug
+3
-0
alert.pug
src/blocks/alert/alert.pug
+8
-5
alert.scss
src/blocks/alert/alert.scss
+7
-1
close.pug
src/blocks/close/close.pug
+13
-2
close.scss
src/blocks/close/close.scss
+18
-0
No files found.
src/blocks-demo.pug
View file @
ad837c52
...
@@ -144,6 +144,7 @@ block content
...
@@ -144,6 +144,7 @@ block content
include:markdown-it(linkify, html='true', typographer='true', quotes='«»') blocks/close/readme.md
include:markdown-it(linkify, html='true', typographer='true', quotes='«»') blocks/close/readme.md
div
div
+close('Закрыть')
+close('Закрыть')
+close('Закрыть', 'sm')
+block-lib-code()
+block-lib-code()
include:show-code(first-line='//- Pug-файл этого блока:') blocks/close/close.pug
include:show-code(first-line='//- Pug-файл этого блока:') blocks/close/close.pug
...
@@ -171,8 +172,10 @@ block content
...
@@ -171,8 +172,10 @@ block content
include:markdown-it(linkify, html='true', typographer='true', quotes='«»') blocks/alert/readme.md
include:markdown-it(linkify, html='true', typographer='true', quotes='«»') blocks/alert/readme.md
+alert()
+alert()
p Обычное сообщение
p Обычное сообщение
+close('Закрыть', 'sm')(class='alert__close')
+alert('Заголовок', 'warning, some-mod-name')
+alert('Заголовок', 'warning, some-mod-name')
p Блок сообщения с модификаторами.
p Блок сообщения с модификаторами.
+close('Закрыть', 'sm')(class='alert__close')
+block-lib-code()
+block-lib-code()
include:show-code(first-line='//- Pug-файл этого блока:') blocks/alert/alert.pug
include:show-code(first-line='//- Pug-файл этого блока:') blocks/alert/alert.pug
...
...
src/blocks/alert/alert.pug
View file @
ad837c52
...
@@ -7,13 +7,16 @@ mixin alert(title, mods)
...
@@ -7,13 +7,16 @@ mixin alert(title, mods)
//- mods {string} - стилевые модификаторы
//- mods {string} - стилевые модификаторы
//- Вызов:
//- Вызов:
+alert()
+alert()
p Успех
+alert('Внимание!', 'warning, some-mod-name')
p Текст
p Текст
+alert()
+alert('Внимание', 'warning, some-mod-name')
p Сообщение без модификаторов
p Предупреждение
+alert('Заголовok', 'danger')
+close('Закрыть', 'sm')(class='alert__close')
+alert('Внимание', 'danger')
p Проблема
p Проблема
+close('Закрыть', 'sm')(class='alert__close')
+alert('Внимание', 'success')
p Успех
+close('Закрыть', 'sm')(class='alert__close')
-
-
//- список модификаторов
//- список модификаторов
...
...
src/blocks/alert/alert.scss
View file @
ad837c52
...
@@ -15,7 +15,7 @@ $border-radius: 3px !default;
...
@@ -15,7 +15,7 @@ $border-radius: 3px !default;
$block-name
:
&
;
// #{$block-name}__element
$block-name
:
&
;
// #{$block-name}__element
position
:
relative
;
position
:
relative
;
padding
:
0
.7em
1em
;
padding
:
0
.7em
1
.5em
0
.7em
1
em
;
margin-top
:
1em
;
margin-top
:
1em
;
margin-bottom
:
1em
;
margin-bottom
:
1em
;
border
:
1px
solid
$gray-lighter
;
border
:
1px
solid
$gray-lighter
;
...
@@ -44,6 +44,12 @@ $border-radius: 3px !default;
...
@@ -44,6 +44,12 @@ $border-radius: 3px !default;
color
:
inherit
;
color
:
inherit
;
}
}
&
__close
{
position
:
absolute
;
top
:
0
;
right
:
0
;
}
&
--warning
{
&
--warning
{
...
...
src/blocks/close/close.pug
View file @
ad837c52
//- Все примеси в этом файле должны начинаться c имени блока (close)
//- Все примеси в этом файле должны начинаться c имени блока (close)
mixin close(label)
mixin close(label
, mods
)
//- Принимает:
//- Принимает:
//- label {string} - описание, значение атрибута aria-label
//- label {string} - описание, значение атрибута aria-label
//- Вызов:
//- Вызов:
+close('Закрыть')
+close('Закрыть')
+close('Закрыть', 'sm')
button.close(aria-label=label)&attributes(attributes)
-
// список модификаторов
var allMods = '';
if(typeof(mods) !== 'undefined' && mods) {
var modsList = mods.split(',');
for (var i = 0; i < modsList.length; i++) {
allMods = allMods + ' close--' + modsList[i].trim();
}
}
button.close(class=allMods, aria-label=label)&attributes(attributes)
span= label
span= label
src/blocks/close/close.scss
View file @
ad837c52
...
@@ -50,4 +50,22 @@ $toggler-part-bg-color: #000 !default;
...
@@ -50,4 +50,22 @@ $toggler-part-bg-color: #000 !default;
transform
:
rotate3d
(
0
,
0
,
1
,
-45deg
);
transform
:
rotate3d
(
0
,
0
,
1
,
-45deg
);
}
}
}
}
&
--sm
{
$toggler-part-height
:
1px
;
width
:
20px
;
line-height
:
20px
;
>
span
{
width
:
60%
;
&
:before
,
&
:after
{
height
:
$toggler-part-height
;
background
:
$toggler-part-bg-color
;
}
}
}
}
}
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