Skip to content

Commit e0ec24c

Browse files
committed
Adjust styles for example component
1 parent 57a8684 commit e0ec24c

File tree

2 files changed

+54
-46
lines changed

2 files changed

+54
-46
lines changed

src/components/SimpleInput.vue

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,20 @@
22
<div>
33
<simple :user-name="userName" :user-gender="userGender" :photo-count="photoCount" class="demo" />
44

5-
<div class="p-fluid p-py-3">
6-
<div class="p-field p-grid">
7-
<label for="userName" class="p-col-12 p-mb-2 p-md-2 p-mb-md-0">$userName</label>
8-
<div class="p-col-12 p-md-10">
9-
<p-input v-model="userName" id="userName" />
10-
</div>
5+
<div>
6+
<div class="group">
7+
<input v-model="userName" type="text" id="userName" />
8+
<label for="userName">$userName</label>
119
</div>
12-
<div class="p-field p-grid">
13-
<label for="userGender" class="p-col-12 p-mb-2 p-md-2 p-mb-md-0">$userGender</label>
14-
<div class="p-col-12 p-md-10">
15-
<p-dropdown v-model="userGender" id="userGender" :options="genderOptions" append-to='self' />
16-
</div>
10+
<div class="group">
11+
<select v-model="userGender" id="userGender">
12+
<option v-for="gender in genderOptions" :key="gender" :value="gender">{{ gender }}</option>
13+
</select>
14+
<label for="userGender">$userGender</label>
1715
</div>
18-
<div class="p-field p-grid">
19-
<label for="photoCount" class="form-label">$photoCount</label>
20-
<input
21-
v-model.number="photoCount"
22-
type="range"
23-
min="1"
24-
max="5"
25-
class="
26-
form-range
27-
appearance-none
28-
w-full
29-
h-6
30-
p-0
31-
bg-transparent
32-
focus:outline-none focus:ring-0 focus:shadow-none
33-
"
34-
id="photoCount"
35-
/>
16+
<div class="group">
17+
<input v-model.number="photoCount" type="range" min="1" max="5" id="photoCount" />
18+
<label for="photoCount">$photoCount</label>
3619
</div>
3720
</div>
3821
</div>
@@ -54,20 +37,46 @@
5437
]
5538
</script>
5639

57-
<style>
58-
dl {
59-
display: flex;
60-
flex-direction: row;
61-
align-items: center;
62-
}
63-
64-
dt {
65-
width: 100px;
66-
}
67-
40+
<style scoped>
6841
.demo {
6942
padding: 1rem 1.5rem;
7043
border: 1px solid #ddd;
7144
border-radius: 4px;
7245
}
46+
47+
.group {
48+
position: relative;
49+
margin-top: 30px;
50+
}
51+
52+
label {
53+
color: #c6c6c6;
54+
font-size: 16px;
55+
font-weight: normal;
56+
position: absolute;
57+
left: 5px;
58+
top: 10px;
59+
}
60+
61+
input, select {
62+
background: none;
63+
color: white;
64+
font-size: 18px;
65+
padding: 10px 10px 10px 5px;
66+
display: block;
67+
width: 320px;
68+
border: none;
69+
border-radius: 0;
70+
border-bottom: 1px solid var(--vp-c-text-2);
71+
}
72+
73+
input:focus {
74+
outline: none;
75+
}
76+
77+
input ~ label, select ~ label {
78+
top: -14px;
79+
font-size: 12px;
80+
color: var(--vp-c-text-2);
81+
}
7382
</style>

src/introduction.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ Fluent keeps simple things simple and makes complex things possible. The syntax
88

99
## Example
1010

11-
::: info Example
12-
13-
<simple-input />
14-
15-
:::
16-
1711
<<< @/components/Simple.vue#snippet
1812

1913
<script setup>
2014
import SimpleInput from './components/SimpleInput.vue'
2115
</script>
16+
17+
18+
::: info Example
19+
<simple-input />
20+
:::

0 commit comments

Comments
 (0)