Commit cbf20eaa authored by Nikolay Gromov's avatar Nikolay Gromov

Группа полей и большая унификация стилей полей

parent 22403526
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
"tabs": [], "tabs": [],
"object-fit-polyfill": [], "object-fit-polyfill": [],
"embed-responsive": [], "embed-responsive": [],
"pie-chart": [] "pie-chart": [],
"fields-group": []
}, },
"addCssBefore": [ "addCssBefore": [
"./src/scss/variables.scss", "./src/scss/variables.scss",
......
...@@ -996,13 +996,65 @@ ...@@ -996,13 +996,65 @@
</section> </section>
<section class="blocks-library__item blocks-library__item--menusep" id="fields-group" data-name=".fields-group">
<h2 class="blocks-library__item-title">Группа полей</h2>
<form action="https://httpbin.org/post" class="form" method="post">
<div class="fields-group">
<label class="field-text">
<span class="field-text__input-wrap">
<input class="field-text__input" type="text" placeholder="input[type=text]">
</span>
</label>
<div class="field-actions">
<button class="btn">Отправить</button>
</div>
</div>
<div class="fields-group">
<label class="field-text">
<span class="field-text__input-wrap">
<input class="field-text__input" type="text" placeholder="input[type=text]">
<span class="field-text__help-text">Помощь</span>
</span>
</label>
<label class="field-text">
<span class="field-text__input-wrap">
<input class="field-text__input" type="text" placeholder="input[type=text]">
<span class="field-text__help-text">Помощь</span>
</span>
</label>
<div class="field-actions">
<button class="btn">Отправить</button>
</div>
</div>
</form>
<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>&lt;form action="https://httpbin.org/post" class="form" method="post"></code>
<code> &lt;legend>Название формы&lt;/legend></code>
<code> &lt;label class="field-text">...&lt;/label></code>
<code> &lt;div class="field-actions">...&lt;/div></code>
<code>&lt;/form></code> -->
</pre>
</div>
</div>
</section>
<section class="blocks-library__item blocks-library__item--menusep" id="form" data-name=".form"> <section class="blocks-library__item blocks-library__item--menusep" id="form" data-name=".form">
<h2 class="blocks-library__item-title">Форма</h2> <h2 class="blocks-library__item-title">Форма</h2>
<form action="https://httpbin.org/post" class="form" method="post"> <form action="https://httpbin.org/post" class="form" method="post">
<fieldset> <fieldset class="form__fieldset">
<legend>Название формы</legend> <legend class="form__legend">Легенда</legend>
<label class="field-text"> <label class="field-text">
<span class="field-text__name">Текстовое поле</span> <span class="field-text__name">Текстовое поле</span>
<span class="field-text__input-wrap"> <span class="field-text__input-wrap">
......
...@@ -20,9 +20,7 @@ $border-radius: 3px !default; ...@@ -20,9 +20,7 @@ $border-radius: 3px !default;
margin-bottom: ($line-height / 2); margin-bottom: ($line-height / 2);
&__name { &__name {
font-weight: 700; @include field-name;
display: block;
margin-bottom: 0.4em;
} }
&__input-wrap { &__input-wrap {
......
...@@ -17,10 +17,7 @@ $border-radius: 3px !default; ...@@ -17,10 +17,7 @@ $border-radius: 3px !default;
margin-bottom: ($line-height / 2); margin-bottom: ($line-height / 2);
&__name { &__name {
font-weight: 700; @include field-name;
display: block;
margin-bottom: 0.4em;
line-height: $line-height;
} }
&__input-wrap { &__input-wrap {
......
...@@ -17,9 +17,7 @@ $border-radius: 3px !default; ...@@ -17,9 +17,7 @@ $border-radius: 3px !default;
margin-bottom: ($line-height / 2); margin-bottom: ($line-height / 2);
&__name { &__name {
font-weight: 700; @include field-name;
display: block;
margin-bottom: 0.4em;
} }
&__input-wrap {} &__input-wrap {}
......
...@@ -22,10 +22,7 @@ $border-radius: 3px !default; ...@@ -22,10 +22,7 @@ $border-radius: 3px !default;
margin-bottom: ($line-height / 2); margin-bottom: ($line-height / 2);
&__name { &__name {
display: block; @include field-name;
margin-bottom: 0.4em;
line-height: $line-height;
font-weight: 700;
} }
&__input-wrap { &__input-wrap {
......
...@@ -15,10 +15,7 @@ $line-height: 1.375em !default; ...@@ -15,10 +15,7 @@ $line-height: 1.375em !default;
margin-bottom: ($line-height / 2); margin-bottom: ($line-height / 2);
&__title { &__title {
display: block; @include field-name;
font-weight: 700;
line-height: $line-height;
margin-bottom: 0.4em;
} }
&__input-wrap { &__input-wrap {
......
...@@ -12,11 +12,7 @@ $line-height: 1.375em !default; ...@@ -12,11 +12,7 @@ $line-height: 1.375em !default;
$block-name: &; // #{$block-name}__element $block-name: &; // #{$block-name}__element
&:not(:last-child) { &__fieldset {
margin-bottom: $line-height;
}
fieldset {
min-width: 0; min-width: 0;
padding: 0; padding: 0;
margin: 0; margin: 0;
...@@ -27,7 +23,7 @@ $line-height: 1.375em !default; ...@@ -27,7 +23,7 @@ $line-height: 1.375em !default;
} }
} }
legend { &__legend {
display: block; display: block;
width: 100%; width: 100%;
margin-top: $line-height; margin-top: $line-height;
......
...@@ -21,3 +21,13 @@ ...@@ -21,3 +21,13 @@
outline: 0; outline: 0;
box-shadow: 0 0 0 2px rgba($color-main, $opacity); box-shadow: 0 0 0 2px rgba($color-main, $opacity);
} }
@mixin field-name {
$line-height: 1.375em !default;
display: block;
margin-bottom: 0.4em;
line-height: $line-height;
font-weight: 700;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment