Skip to content
This repository was archived by the owner on Apr 25, 2020. It is now read-only.

Commit 1318984

Browse files
committed
Add example to README
1 parent cf24a1f commit 1318984

File tree

3 files changed

+64
-4
lines changed

3 files changed

+64
-4
lines changed

README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,36 @@ Wrap text/email/password input or textarea:
5050

5151
### Examples
5252

53-
Adjust `.vfl-label`, `.vfl-label-on-input` and `.vfl-label-on-focus` to meet
54-
your design requirements:
55-
56-
TODO
53+
Style `.vfl-label`, `.vfl-label-on-input` and `.vfl-label-on-focus`
54+
to meet your design requirements:
55+
56+
![example](https://github.com/bkzl/vue-float-label/blob/master/demo/example.gif)
57+
58+
```css
59+
.vfl-label {
60+
text-transform: uppercase;
61+
}
62+
63+
.vfl-label-on-input {
64+
top: -1em;
65+
}
66+
67+
.vfl-label-on-focus {
68+
color: #ff851b;
69+
}
70+
71+
.vfl-label + input {
72+
padding-left: 0;
73+
font-size: 100%;
74+
border: 0;
75+
border-bottom: 2px solid #aaa;
76+
transition: border 0.2s;
77+
}
78+
79+
.vfl-label-on-focus + input {
80+
border-bottom: 2px solid #ff851b;
81+
}
82+
```
5783

5884
## Development
5985

demo/Demo.vue

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
<float-label>
1717
<textarea placeholder="Comment"></textarea>
1818
</float-label>
19+
20+
<div class="example">
21+
<float-label>
22+
<input type="text" placeholder="Website">
23+
</float-label>
24+
</div>
1925
</div>
2026
</div>
2127
</template>
@@ -38,4 +44,32 @@ textarea {
3844
padding: .4em;
3945
width: 100%;
4046
}
47+
48+
.example {
49+
margin-top: 2em;
50+
}
51+
52+
.example .vfl-label {
53+
text-transform: uppercase;
54+
}
55+
56+
.example .vfl-label-on-input {
57+
top: -1em;
58+
}
59+
60+
.example .vfl-label-on-focus {
61+
color: #ff851b;
62+
}
63+
64+
.example .vfl-label + input {
65+
padding-left: 0;
66+
font-size: 100%;
67+
border: 0;
68+
border-bottom: 2px solid #aaa;
69+
transition: border 0.2s;
70+
}
71+
72+
.example .vfl-label-on-focus + input {
73+
border-bottom: 2px solid #ff851b;
74+
}
4175
</style>

demo/example.gif

30.3 KB
Loading

0 commit comments

Comments
 (0)