summaryrefslogtreecommitdiff
path: root/src/components/Field.module.scss
diff options
context:
space:
mode:
authorHaishan <[email protected]>2021-06-06 00:32:24 +0800
committerHaishan <[email protected]>2021-06-06 00:33:22 +0800
commit5ff2f89afb71fd2976c487692ec73085241e09c7 (patch)
treefe7a53d8839b1406e4ff31a2fa8a543669c7693f /src/components/Field.module.scss
parent25dbe5eff483bfdceec677b13ad4ec905c5fe566 (diff)
Stop use postcss-nested postcss-extend-rule
Diffstat (limited to 'src/components/Field.module.scss')
-rw-r--r--src/components/Field.module.scss43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/components/Field.module.scss b/src/components/Field.module.scss
new file mode 100644
index 0000000..9a5f1e4
--- /dev/null
+++ b/src/components/Field.module.scss
@@ -0,0 +1,43 @@
+.root {
+ position: relative;
+ padding: 10px 0;
+ input {
+ -webkit-appearance: none;
+ background-color: transparent;
+ background-image: none;
+ border: none;
+ border-radius: 0;
+ border-bottom: 1px solid var(--color-input-border);
+ box-sizing: border-box;
+ color: #c1c1c1;
+ display: inline-block;
+ font-size: inherit;
+ height: 40px;
+ outline: none;
+ padding: 0 4px;
+ transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
+ width: 100%;
+ &:focus {
+ border-color: var(--color-focus-blue);
+ }
+ }
+
+ label {
+ position: absolute;
+ left: 5px;
+ bottom: 22px;
+ transition: transform 150ms ease-in-out;
+ transform-origin: 0 0;
+ font-size: 0.9em;
+ &.floatAbove {
+ transform: scale(0.75) translateY(-25px);
+ }
+ }
+
+ input {
+ &:focus + label {
+ color: var(--color-focus-blue);
+ transform: scale(0.75) translateY(-25px);
+ }
+ }
+}