phpvms/resources/sass/now-ui/now-ui-kit/mixins/_inputs.scss

240 lines
6.0 KiB
SCSS
Raw Normal View History

2017-07-28 20:13:52 +08:00
@mixin input-size($padding-vertical, $padding-horizontal){
padding: $padding-vertical $padding-horizontal;
}
@mixin form-control-placeholder($color, $opacity){
.form-control::-moz-placeholder{
color: $color;
@include opacity(1);
}
.form-control:-moz-placeholder{
color: $color;
@include opacity(1);
}
.form-control::-webkit-input-placeholder{
color: $color;
@include opacity(1);
}
.form-control:-ms-input-placeholder{
color: $color;
@include opacity(1);
}
}
2018-04-07 06:10:45 +08:00
@mixin light-form() {
2017-07-28 20:13:52 +08:00
border-radius: 0;
border:0;
padding: 0;
background-color: transparent;
}
2018-04-07 06:10:45 +08:00
@mixin input-sm-padding($padding-vertical, $padding-horizontal) {
.form-group.form-group-no-border.input-sm,
.input-group.form-group-no-border.input-sm {
.input-group-addon {
padding: $padding-vertical 0 $padding-vertical $padding-horizontal;
}
.form-control {
padding: $padding-vertical $padding-horizontal;
& + .input-group-addon {
padding: $padding-vertical $padding-horizontal $padding-vertical 0;
}
}
}
.form-group.input-sm,
.input-group.input-sm {
.form-control {
padding: $padding-vertical - 1 $padding-horizontal - 1;
& + .input-group-addon {
padding: $padding-vertical - 1 $padding-horizontal - 1 $padding-vertical - 1 0;
}
}
.input-group-addon {
padding: $padding-vertical - 1 0 $padding-vertical $padding-horizontal - 1;
& + .form-control {
padding: $padding-vertical $padding-horizontal - 1 $padding-vertical $padding-horizontal - 3;
}
}
}
}
2017-07-28 20:13:52 +08:00
@mixin input-lg-padding($padding-vertical, $padding-horizontal) {
.form-group.form-group-no-border.input-lg,
2018-04-07 06:10:45 +08:00
.input-group.form-group-no-border.input-lg {
2017-07-28 20:13:52 +08:00
.input-group-addon{
padding: $padding-vertical 0 $padding-vertical $padding-horizontal;
}
.form-control{
padding: $padding-vertical $padding-horizontal;
& + .input-group-addon{
padding: $padding-vertical $padding-horizontal $padding-vertical 0;
}
}
}
.form-group.input-lg,
.input-group.input-lg{
.form-control{
padding: $padding-vertical - 1 $padding-horizontal - 1;
& + .input-group-addon{
padding: $padding-vertical - 1 $padding-horizontal - 1 $padding-vertical - 1 0;
}
}
.input-group-addon{
padding: $padding-vertical - 1 0 $padding-vertical $padding-horizontal - 1;
& + .form-control{
padding: $padding-vertical $padding-horizontal - 1 $padding-vertical $padding-horizontal - 3;
}
}
}
}
@mixin input-base-padding($padding-vertical, $padding-horizontal) {
.form-group.form-group-no-border,
.input-group.form-group-no-border{
.form-control{
padding: $padding-vertical $padding-horizontal;
& + .input-group-addon{
padding: $padding-vertical $padding-horizontal $padding-vertical 0;
}
}
.input-group-addon{
padding: $padding-vertical 0 $padding-vertical $padding-horizontal;
}
}
.form-group,
.input-group{
.form-control{
padding: $padding-vertical - 1 $padding-horizontal - 1 $padding-vertical - 1 $padding-horizontal - 1;
& + .input-group-addon{
padding: $padding-vertical - 1 $padding-horizontal - 1 $padding-vertical - 1 0;
}
}
.input-group-addon{
padding: $padding-vertical - 1 0 $padding-vertical - 1 $padding-horizontal - 1;
& + .form-control,
& ~ .form-control{
padding:$padding-vertical - 1 $padding-horizontal $padding-vertical $padding-horizontal - 3;
}
}
}
}
//color1 = $opacity-5
//color2 = $opacity-8
//color3 = $white-color
//color4 = $transparent-bg
//color5 = $opacity-1
//color6 = $opacity-2
@mixin input-coloured-bg($color1, $color2, $color3, $color4, $color5, $color6) {
@include form-control-placeholder(darken($color2, 8%), 1);
.form-control{
border-color: $color1;
color: $color2;
&:focus{
border-color: $color3;
background-color: $color4;
color: $color3;
}
}
.has-success,
.has-danger{
&:after{
color: $color3;
}
}
.has-danger{
.form-control{
background-color: $color4;
}
}
.input-group-addon{
background-color: $color4;
border-color: $color1;
color: $color2;
}
.input-group-focus{
.input-group-addon{
background-color: $color4;
border-color: $color3;
color: $color3;
}
}
.form-group.form-group-no-border,
.input-group.form-group-no-border{
.form-control{
background-color: $color5;
color: $color2;
&:focus,
&:active,
&:active{
background-color: $color6;
color: $color3;
}
}
.form-control + .input-group-addon{
background-color: $color5;
&:focus,
&:active,
&:active{
background-color: $color6;
color: $color3;
}
}
.form-control{
&:focus{
& + .input-group-addon{
background-color: $color6;
color: $color3;
}
}
}
.input-group-addon{
background-color: $color5;
border: none;
color: $color2;
}
&.input-group-focus{
.input-group-addon{
background-color: $color6;
color: $color3;
}
}
}
}