$input-height: 50px; $anim-timing: 150ms ease-out; .editable-field-wrapper { display: inline-block; position: relative; width: 100%; .vitamui-input-errors { padding: 4px 25px; overflow: hidden; } } .editable-field { display: inline-flex; align-items: center; justify-content: space-between; position: relative; min-height: $input-height; width: 100%; border-radius: $input-height / 2; border: 1px solid var(--vitamui-grey-400); background-color: $white; padding: 7px 45px 7px 25px; transition: border-color $anim-timing; vertical-align: top; cursor: pointer; outline: none; &.squarish { border-radius: 10px; } i.edit-icon { color: var(--vitamui-primary); opacity: 0; transition: opacity $anim-timing; position: absolute; right: 20px; pointer-events: none; } &:hover:not(.edit-mode), &:focus:not(.edit-mode) { @include elevation-1; i.edit-icon { opacity: 1; } } } .editable-field-content { display: flex; flex-direction: column; align-items: stretch; flex-grow: 1; position: relative; max-width: 100%; .editable-field-label { position: absolute; font-size: 12px; color: var(--vitamui-grey-400); letter-spacing: 0.4px; line-height: 16px; transform-origin: left; transition: transform $anim-timing; white-space: nowrap; } .editable-field-text-content { margin-top: 16px; width: 100%; line-height: 24px; color: var(--vitamui-grey-900); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .editable-field-control { display: none; height: 100%; } .editable-field-control > input { border: none!important; margin-top: 5px; &:focus { outline: none; } } .editable-field-control > textarea { border: none!important; &:focus { outline: none; } } } .editable-field.edit-mode { border-color: var(--vitamui-primary); padding: 15px 10px 5px 20px; .editable-field-content { .editable-field-label { transform: scale((11 / 13)) translateY(-14px); } .editable-field-text-content { display: none; } .editable-field-control { display: flex; } } } .editable-field-actions { width: 85px; height: $input-height; border-radius: $input-height / 2; padding: 10px; background-color: white; box-shadow: 0 0 20px 0 rgba(169, 169, 169, 0.3); z-index: 1; margin: 10px 0 10px 10px; display: flex; justify-content: space-between; button { @include elevation-1; background: none; border: none; color: white; height: $input-height - 20px; width: $input-height - 20px; padding: 0; border-radius: ($input-height - 10px) / 2; transition: opacity 200ms ease-out, background-color 200ms ease-out; &:disabled { opacity: 0.4; } > i { font-size: 18px; } &.editable-field-confirm { background-color: #74c41c; &:hover, &:active, &:focus { background-color: lighten(#74c41c, 15%); } } &.editable-field-cancel { background-color: #ea0101; &:hover, &:active, &:focus { background-color: lighten(#ea0101, 15%); } } } } .editable-field-square .editable-field { border-radius: 10px; } .squarish { border-radius: 10px!important; }