accounts-frontend/src/components/ui/form.scss

161 lines
2.6 KiB
SCSS
Raw Normal View History

@import '~components/ui/colors.scss';
@import '~components/ui/fonts.scss';
@mixin form-transition() {
// Анимация фона должна быть быстрее анимации рамки, т.к. визуально фон заполняется медленнее
transition: border-color .25s,
background-color .20s;
}
/**
* Input
*/
.formRow {
position: relative;
height: 50px;
max-width: 100%;
margin: 10px 0;
}
.formIconRow {
composes: formRow;
.textField {
padding-left: 60px;
}
}
.textField {
box-sizing: border-box;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
height: 50px;
width: 100%;
border: 2px solid lighter($black);
background: $black;
font-size: 18px;
color: #aaa;
font-family: $font-family-title;
padding: 0 10px;
transition: border-color .25s;
&::placeholder {
opacity: 1;
color: #444;
}
&:hover {
border-color: #aaa;
~ .formFieldIcon {
border-color: #aaa;
}
}
&:focus {
border-color: $green;
color: #fff;
outline: none;
~ .formFieldIcon {
background: $green;
border-color: $green;
color: #fff;
}
}
}
.formFieldIcon {
box-sizing: border-box;
position: absolute;
left: 0;
top: 0;
height: 50px;
width: 50px;
line-height: 46px;
text-align: center;
border: 2px solid lighter($black);
color: #444;
@include form-transition();
}
/**
* Checkbox
*/
.checkboxRow {
height: 22px;
margin-top: 15px;
}
.checkboxContainer {
display: inline-block;
position: relative;
padding-left: 27px;
font-family: $font-family-title;
font-size: 16px;
line-height: 24px;
color: #fff;
cursor: pointer;
&:hover {
.checkbox {
border-color: $green;
}
}
}
.checkboxPosition {
position: absolute;
box-sizing: border-box;
left: 0;
top: 0;
margin: 0;
width: 22px;
height: 22px;
}
.checkboxInput {
composes: checkboxPosition;
opacity: 0;
&:checked {
+ .checkbox {
background: $green;
border-color: $green;
&:before {
opacity: 1;
}
}
}
}
.checkbox {
composes: checkboxPosition;
composes: checkmark from './icons.scss';
border: 2px #fff solid;
font-size: 10px;
line-height: 18px;
@include form-transition();
&:before {
opacity: 0;
transition: opacity 0.3s;
}
}