UNPKG

react-input-ui

Version:
206 lines (174 loc) 5.31 kB
:root { --i-yokoUI-activeTextColor: #f2f2f2; --i-yokoUI-focusColor: #2196f3; --i-yokoUI-hoverColor: #252525; --i-yokoUI-mainColor: #727272; } .i-yokoUI { border: none; padding: 0; position: relative; } .i-yokoUI__input { -o-transition: color .6s linear, box-shadow .3s linear; -webkit-appearance: none; -webkit-box-shadow: none; -webkit-box-sizing: border-box; -webkit-transition: color .6s linear, box-shadow .3s linear; background: transparent; border-bottom: 1px solid var(--i-yokoUI-mainColor); border-left: none; border-radius: 0; border-right: none; border-top: none; box-shadow: none; box-sizing: border-box; color: var(--i-yokoUI-mainColor); cursor: text; outline: none; padding: .7em; position: relative; transition: color .6s linear, box-shadow .3s linear; width: 100%; z-index: 1; } .i-yokoUI__input:hover { border-bottom-color: var(--i-yokoUI-hoverColor); color: var(--i-yokoUI-hoverColor); } .i-yokoUI__input:focus { border-bottom-color: var(--i-yokoUI-focusColor); color: var(--i-yokoUI-activeTextColor); } /*Label*/ .i-yokoUI__label { -khtml-user-select: none; -moz-osx-font-smoothing: grayscale; -moz-user-select: none; -ms-user-select: none; -o-transition: all .3s; -o-transition-property: bottom, font-size, color; -webkit-font-smoothing: antialiased; -webkit-touch-callout: none; -webkit-transition: all .3s; -webkit-transition-property: bottom, font-size, color; -webkit-user-select: none; bottom: 5px; color: var(--i-yokoUI-mainColor); left: 0; pointer-events: none; position: absolute; transition: all .3s; transition-property: bottom, font-size, color; user-select: none; width: 100%; } .i-yokoUI__input:hover ~ .i-yokoUI__label { color: var(--i-yokoUI-hoverColor); } .i-yokoUI__input:focus ~ .i-yokoUI__label { color: var(--i-yokoUI-focusColor); } .i-yokoUI__input:focus ~ .i-yokoUI__label, .i-yokoUI__input:not([value=""]) ~ .i-yokoUI__label { bottom: 110%; font-size: small; } /*Underline*/ .i-yokoUI__underline { -webkit-transition: all .3s cubic-bezier(0.77, 0, 0.175, 1); -o-transition: all .3s cubic-bezier(0.77, 0, 0.175, 1); transition: all .3s cubic-bezier(0.77, 0, 0.175, 1); -webkit-transition-property: height, left, top, width, -webkit-transition-delay; -o-transition-property: height, left, top, width, -o-transition-delay; transition-property: height, left, top, transition-delay, width, -webkit-transition-delay, -o-transition-delay; } .i-yokoUI__underline:before, .i-yokoUI__underline:after { -o-transition: inherit; -webkit-transition: inherit; content: ''; position: absolute; transition: inherit; z-index: 0; } .i-yokoUI__underline:before { border-bottom: 2px solid var(--i-yokoUI-focusColor); border-left: none; border-right: none; border-top: 2px solid var(--i-yokoUI-focusColor); height: 100%; left: 50%; top: -2px; width: 0; } .i-yokoUI__underline:after { background: var(--i-yokoUI-focusColor); bottom: 0; height: 0; left: 0; width: 100%; } .i-yokoUI__input:focus ~ .i-yokoUI__underline:before { left: 0; width: 100%; } .i-yokoUI__input:focus ~ .i-yokoUI__underline:after { -o-transition-delay: .4s; -webkit-transition-delay: .4s; height: 100%; top: 0; transition-delay: .4s; } /*Placeholder*/ .i-yokoUI__input::-webkit-input-placeholder { -webkit-transition: color .3s ease-in-out; -o-transition: color .3s ease-in-out; transition: color .3s ease-in-out; } .i-yokoUI__input:-ms-input-placeholder { -webkit-transition: color .3s ease-in-out; -o-transition: color .3s ease-in-out; transition: color .3s ease-in-out; } .i-yokoUI__input::-ms-input-placeholder { -webkit-transition: color .3s ease-in-out; -o-transition: color .3s ease-in-out; transition: color .3s ease-in-out; } .i-yokoUI__input::placeholder { -webkit-transition: color .3s ease-in-out; -o-transition: color .3s ease-in-out; transition: color .3s ease-in-out; } .i-yokoUI__input::-webkit-input-placeholder { -webkit-transition: color .3s ease-in-out; -o-transition: color .3s ease-in-out; transition: color .3s ease-in-out; } .i-yokoUI__input::-ms-input-placeholder { -webkit-transition: color .3s ease-in-out; -o-transition: color .3s ease-in-out; transition: color .3s ease-in-out; } .i-yokoUI__input:not(:focus)::-webkit-input-placeholder { color: transparent; } .i-yokoUI__input:not(:focus):-ms-input-placeholder { color: transparent; } .i-yokoUI__input:not(:focus)::-ms-input-placeholder { color: transparent; } .i-yokoUI__input:not(:focus)::placeholder { color: transparent; } .i-yokoUI__input:not(:focus)::-webkit-input-placeholder { color: transparent; } .i-yokoUI__input:not(:focus)::-ms-input-placeholder { color: transparent; } .i-yokoUI__input:not(:focus)::-moz-placeholder { color: transparent; }