Skip to content

Commit 5d58b2a

Browse files
committed
Core: Fab Extended + Fab Labels
1 parent 59f151f commit 5d58b2a

4 files changed

Lines changed: 98 additions & 4 deletions

File tree

kitchen-sink/core/pages/fab.html

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,18 @@
3131
<i class="icon material-icons md-only">close</i>
3232
</a>
3333
<div class="fab-buttons fab-buttons-top">
34-
<a href="">1</a>
35-
<a href="">2</a>
36-
<a href="">3</a>
34+
<a href="" class="fab-label-button">
35+
<span>1</span>
36+
<span class="fab-label">Action 1</span>
37+
</a>
38+
<a href="" class="fab-label-button">
39+
<span>2</span>
40+
<span class="fab-label">Action 2</span>
41+
</a>
42+
<a href="" class="fab-label-button">
43+
<span>3</span>
44+
<span class="fab-label">Third Action</span>
45+
</a>
3746
</div>
3847
</div>
3948
<div class="fab fab-left-bottom">
@@ -43,7 +52,7 @@
4352
<i class="icon material-icons md-only">add</i>
4453
<i class="icon material-icons md-only">close</i>
4554
</a>
46-
<div class="fab-buttons fab-buttons-right">
55+
<div class="fab-buttons fab-buttons-top">
4756
<a href="">1</a>
4857
<a href="">2</a>
4958
<a href="">3</a>
@@ -76,6 +85,13 @@
7685
<a href="">4</a>
7786
</div>
7887
</div>
88+
<div class="fab fab-extended fab-center-bottom">
89+
<a href="#">
90+
<i class="icon f7-icons ios-only">add</i>
91+
<i class="icon material-icons md-only">add</i>
92+
<div class="fab-text">Create</div>
93+
</a>
94+
</div>
7995
<div class="page-content">
8096
<div class="block">
8197
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quia, quo rem beatae, delectus eligendi est saepe molestias perferendis suscipit, commodi labore ipsa non quasi eum magnam neque ducimus! Quasi, numquam.</p>

src/core/components/fab/fab-ios.less

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@
5555
}
5656
}
5757

58+
// Extended
59+
.fab-extended {
60+
min-width: 50px;
61+
> a {
62+
width: 100%;
63+
height: 50px;
64+
i {
65+
left: 50px / 2;
66+
}
67+
}
68+
i ~ .fab-text {
69+
padding-left: 50px;
70+
}
71+
}
72+
.fab-label {
73+
box-shadow: 0px 1px 2px rgba(0,0,0,0.4);
74+
}
75+
5876
.color-theme-loop({
5977
.color-theme-@{colorThemeName} {
6078
.fab > a, .fab-buttons a, &.fab > a, &.fab-buttons a {

src/core/components/fab/fab-md.less

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@
8181
background: none !important;
8282
}
8383
}
84+
// Extended
85+
.fab-extended {
86+
min-width: 48px;
87+
> a {
88+
height: 48px;
89+
i {
90+
left: 48px / 2;
91+
}
92+
}
93+
i ~ .fab-text {
94+
padding-left: 48px;
95+
}
96+
}
97+
// Labels
98+
.fab-label {
99+
.elevation(3);
100+
}
101+
84102
.color-theme-loop({
85103
.color-theme-@{colorThemeName} {
86104
.fab > a, .fab-buttons a, &.fab > a, &.fab-buttons a {

src/core/components/fab/fab.less

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,48 @@
201201
display: none;
202202
}
203203

204+
// Extended
205+
.fab-extended {
206+
width: auto;
207+
> a {
208+
width: 100% !important;
209+
}
210+
}
211+
.fab-text {
212+
padding-left: 20px;
213+
padding-right: 20px;
214+
box-sizing: border-box;
215+
font-size: 14px;
216+
text-transform: uppercase;
217+
}
218+
// Labels
219+
.fab-label-button {
220+
overflow: visible !important;
221+
}
222+
.fab-label {
223+
position: absolute;
224+
top: 50%;
225+
padding: 4px 8px;
226+
border-radius: 4px;
227+
background: #fff;
228+
color: #666;
229+
white-space: nowrap;
230+
transform: translateY(-50%);
231+
pointer-events: none;
232+
}
233+
.fab[class*="fab-right-"] {
234+
.fab-label {
235+
right: 100%;
236+
margin-right: 8px;
237+
}
238+
}
239+
.fab[class*="fab-left-"] {
240+
.fab-label {
241+
left: 100%;
242+
margin-left: 8px;
243+
}
244+
}
245+
204246
& when (@includeIosTheme) {
205247
@import url('./fab-ios.less');
206248
}

0 commit comments

Comments
 (0)