scinote-web/app/assets/stylesheets/partials/_inline_editing.scss
2019-09-11 15:44:38 +02:00

108 lines
1.8 KiB
SCSS

@import "constants";
@import "mixins";
.inline-editing-container {
display: flex;
flex-grow: 1;
max-width: 100%;
position: relative;
.button-container {
height: 32px;
line-height: 32px;
overflow: hidden;
position: absolute;
right: 0;
top: 0;
width: 72px;
span {
color: $color-silver;
cursor: pointer;
display: inline-block;
position: absolute;
text-align: center;
width: 36px;
&:nth-child(1) {left: 0;}
&:nth-child(2) {right: 0;}
}
}
.error-block {
bottom: 3px;
color: $brand-danger;
display: none;
font-size: 11px;
line-height: 11px;
position: absolute;
}
&[data-error="true"] {
.error-block {
display: block;
}
input {
font-size: 16px;
line-height: 20px;
padding-bottom: 10px;
padding-top: 0;
}
}
&:hover input,
&:hover .view-mode {
border: 1px solid $color-silver;
border-radius: 3px;
&:disabled {
border: 1px solid $color-gainsboro;
}
}
.view-mode {
border: 1px solid transparent;
cursor: pointer;
flex-wrap: nowrap;
line-height: 26px;
margin-left: -5px;
overflow: hidden;
padding: 2px 4px;
padding-right: 36px;
text-overflow: ellipsis;
white-space: nowrap;
width: calc(100% - 32px);
}
input {
border: 1px solid $color-silver;
border-radius: $border-radius-small;
cursor: pointer;
line-height: 26px;
margin-left: -5px;
padding: 2px 4px;
padding-right: 36px;
width: calc(100% - 32px);
&:focus {
outline: 0;
}
&:disabled {
background: transparent;
border: 1px solid transparent;
cursor: pointer;
pointer-events: none;
user-select: none;
+ .button-container {
display: none;
}
}
}
}