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
6ea7c44c
Commit
6ea7c44c
authored
Mar 21, 2017
by
Nikolay Gromov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Поле выбора файла, правки для других полей
parent
de18a80f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
3 deletions
+110
-3
package.json
package.json
+1
-0
blocks-demo.html
src/blocks-demo.html
+27
-0
field-checkbox.scss
src/blocks/field-checkbox/field-checkbox.scss
+1
-1
field-file.scss
src/blocks/field-file/field-file.scss
+79
-0
field-radio.scss
src/blocks/field-radio/field-radio.scss
+1
-1
field-text.scss
src/blocks/field-text/field-text.scss
+1
-1
No files found.
package.json
View file @
6ea7c44c
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
"field-text"
:
[],
"field-text"
:
[],
"field-checkbox"
:
[],
"field-checkbox"
:
[],
"field-radio"
:
[],
"field-radio"
:
[],
"field-file"
:
[],
"field-actions"
:
[],
"field-actions"
:
[],
"dropdown"
:
[],
"dropdown"
:
[],
"menu"
:
[]
"menu"
:
[]
...
...
src/blocks-demo.html
View file @
6ea7c44c
...
@@ -963,6 +963,33 @@
...
@@ -963,6 +963,33 @@
</section>
</section>
<section
class=
"blocks-library__item"
id=
"field-file"
data-name=
".field-file"
>
<h2
class=
"blocks-library__item-title"
>
Файл
</h2>
<div
class=
"field-file"
>
<div
class=
"field-file__name"
>
Выбор файлов
</div>
<label
class=
"field-file__input-wrap"
>
<input
class=
"field-file__input"
type=
"file"
data-multiple-caption=
"файлов выбрано: {count}"
multiple
>
<div
class=
"field-file__name-text"
data-button-text=
"Выбрать файл(ы)"
>
Ничего не выбрано
</div>
<div
class=
"field-file__help-text"
>
Отображение выбранного файла(ов) требует Javascript-а. Стилизация — не требует.
</div>
</label>
</div>
<div
class=
"blocks-library__code-wrapper"
>
<span
class=
"blocks-library__code-show-trigger"
title=
"Показать код"
><i
class=
"blocks-library__code-icon"
></i></span>
<div
class=
"blocks-library__code"
>
<pre
class=
"code"
>
<code>
<
div class="field-actions">
</code>
<code>
<
div class="field-actions__text">* — обязательные поля
<
/div>
</code>
<code>
<
button class="btn">Отправить
<
/button>
</code>
<code>
<
/div>
</code>
</pre>
</div>
</div>
</section>
<section
class=
"blocks-library__item"
id=
"field-actions"
data-name=
".field-actions"
>
<section
class=
"blocks-library__item"
id=
"field-actions"
data-name=
".field-actions"
>
<h2
class=
"blocks-library__item-title"
>
Блок отправки формы
</h2>
<h2
class=
"blocks-library__item-title"
>
Блок отправки формы
</h2>
...
...
src/blocks/field-checkbox/field-checkbox.scss
View file @
6ea7c44c
...
@@ -12,7 +12,7 @@ $line-height: 1.375em !default;
...
@@ -12,7 +12,7 @@ $line-height: 1.375em !default;
display
:
block
;
display
:
block
;
font-weight
:
700
;
font-weight
:
700
;
line-height
:
$line-height
;
line-height
:
$line-height
;
margin-bottom
:
round
(
$line-height
/
2
)
;
margin-bottom
:
0
.4em
;
}
}
&
__input-wrap
{
&
__input-wrap
{
...
...
src/blocks/field-file/field-file.
le
ss
→
src/blocks/field-file/field-file.
sc
ss
View file @
6ea7c44c
// Для импорта в диспетчер подключений: @import './src/blocks/field-file/field-file.less';
// В этом файле должны быть стили только для БЭМ-блока field-file, его элементов,
// модификаторов, псевдоселекторов, псевдоэлементов, $media-условий...
// Не пишите здесь другие селекторы.
@import '../../less/variables.less'; // только для удобства обращения к переменным
$gray-lightest
:
hsl
(
0
,
0%
,
90%
);
$border-color
:
hsl
(
0
,
0%
,
60%
)
!
default
;
$line-height
:
1
.375em
!
default
;
$field-padding-vertical
:
0
.3em
!
default
;
$field-padding-horizontal
:
0
.7em
!
default
;
$border-radius
:
3px
!
default
;
.field-file
{
.field-file
{
display
:
block
;
display
:
block
;
margin-bottom: (
@
line-height / 2);
margin-bottom
:
(
$
line-height
/
2
);
&
__name
{
&
__name
{
font-weight
:
700
;
font-weight
:
700
;
display
:
block
;
display
:
block
;
margin-bottom:
round(@line-height / 4, 2)
;
margin-bottom
:
0
.4em
;
}
}
&
__input-wrap
{
&
__input-wrap
{
...
@@ -24,22 +33,20 @@
...
@@ -24,22 +33,20 @@
height
:
1px
;
height
:
1px
;
opacity
:
0
;
opacity
:
0
;
&
:active
~
.field-file__name-text
,
&
:focus
~
.field-file__name-text
{
&
:focus
~
.field-file__name-text
{
.focus()
;
@include
field-focus
;
}
}
}
}
&
__name-text
{
&
__name-text
{
position
:
relative
;
position
:
relative
;
background-color: #fff;
display
:
flex
;
border: 1px solid @border-color;
align-items
:
baseline
;
border-radius: @border-radius;
display: inline-block;
vertical-align: middle;
width
:
100%
;
width
:
100%
;
height: 2.125em; // 16 × 2.125 = 34
background-color
:
#fff
;
line-height: @line-height
;
border
:
1px
solid
$border-color
;
padding-right: @field-padding-horizontal
;
border-radius
:
$border-radius
;
white-space
:
nowrap
;
white-space
:
nowrap
;
overflow
:
hidden
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
...
@@ -47,29 +54,26 @@
...
@@ -47,29 +54,26 @@
&
:before
{
&
:before
{
content
:
attr
(
data-button-text
);
content
:
attr
(
data-button-text
);
display: inline-block;
display
:
block
;
vertical-align: middle;
background-color
:
$gray-lightest
;
background-color: @gray-lighter;
border-right
:
1px
solid
$border-color
;
border: 1px solid @border-color;
margin-right
:
$field-padding-horizontal
;
margin-right: @field-padding-horizontal;
line-height
:
$line-height
;
height: 2.125em;
padding
:
$field-padding-vertical
$field-padding-horizontal
;
line-height: @line-height;
border-top-left-radius
:
$border-radius
;
padding: @field-padding-top @field-padding-horizontal @field-padding-bottom;
border-bottom-left-radius
:
$border-radius
;
transform: translateX(-1px) translateY(-1px);
border-top-left-radius: @border-radius;
border-bottom-left-radius: @border-radius;
}
}
&
:hover
,
&
:hover
,
&
:focus
{
&
:focus
{
&
:before
{
&
:before
{
background-color: darken(
@gray-lighter
, 10%); // как у обычных кнопок
background-color
:
darken
(
$gray-lightest
,
10%
);
// как у обычных кнопок
}
}
}
}
}
}
&
__help-text
{
&
__help-text
{
.help-text()
;
@include
field-help-text
;
}
}
}
}
src/blocks/field-radio/field-radio.scss
View file @
6ea7c44c
...
@@ -12,7 +12,7 @@ $line-height: 1.375em !default;
...
@@ -12,7 +12,7 @@ $line-height: 1.375em !default;
display
:
block
;
display
:
block
;
font-weight
:
700
;
font-weight
:
700
;
line-height
:
$line-height
;
line-height
:
$line-height
;
margin-bottom
:
round
(
$line-height
/
2
)
;
margin-bottom
:
0
.4em
;
}
}
&
__input-wrap
{
&
__input-wrap
{
...
...
src/blocks/field-text/field-text.scss
View file @
6ea7c44c
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
// модификаторов, псевдоселекторов, псевдоэлементов, $media-условий...
// модификаторов, псевдоселекторов, псевдоэлементов, $media-условий...
// Не пишите здесь другие селекторы.
// Не пишите здесь другие селекторы.
$border-color
:
hsl
(
0
,
0%
,
60%
)
!
default
;
$gray-lighter
:
hsl
(
0
,
0%
,
80%
)
!
default
;
$gray-lighter
:
hsl
(
0
,
0%
,
80%
)
!
default
;
$border-color
:
hsl
(
0
,
0%
,
60%
)
!
default
;
$text-color--muted
:
hsl
(
0
,
0%
,
50%
)
!
default
;
$text-color--muted
:
hsl
(
0
,
0%
,
50%
)
!
default
;
...
...
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