Skip to content

Commit 8fb6c66

Browse files
committed
feat(MdButton): add md-fab position classes
1 parent 968e68e commit 8fb6c66

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

docs/app/pages/Components/App/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
{
109109
name: 'md-mode',
110110
type: 'String',
111-
description: 'Set the toolbar mode. See above the detailed description of each mode.',
111+
description: 'Set the toolbar mode. See below the detailed description of each mode.',
112112
defaults: 'null'
113113
},
114114
{

docs/app/pages/Components/Button/Button.vue

+21
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<div class="page-container-section">
4242
<h2>Floating Action Buttons</h2>
4343
<p>A floating action button represents the primary action in an application and is used for a promoted action. FAB buttons can have it regular size or mini, with an accent color by default. This type of buttons can only have icons, so it should be used along with <code>&lt;md-icon&gt;</code>.</p>
44+
<note-block tip>Use only one FAB per page and only if the purpose of the button is to fire the main action of the screen. Otherwise use <code>md-icon-button</code>.</note-block>
4445

4546
<code-example title="FAB" :component="examples['floating-buttons']" />
4647

@@ -159,6 +160,26 @@
159160
{
160161
name: 'md-dense',
161162
description: 'An alias for "md-mini"'
163+
},
164+
{
165+
name: 'md-fab-top-right',
166+
description: 'Position the FAB on the top right of the nearest relative parent'
167+
},
168+
{
169+
name: 'md-fab-top-left',
170+
description: 'Position the FAB on the top left of the nearest relative parent'
171+
},
172+
{
173+
name: 'md-fab-bottom-right',
174+
description: 'Position the FAB on the bottom right of the nearest relative parent'
175+
},
176+
{
177+
name: 'md-fab-bottom-left',
178+
description: 'Position the FAB on the bottom left of the nearest relative parent'
179+
},
180+
{
181+
name: 'md-fixed',
182+
description: 'Apply position: fixed to FAB. Better used with the 4 position coordinates above'
162183
}
163184
]
164185
}

src/components/MdButton/MdButton.vue

+26
Original file line numberDiff line numberDiff line change
@@ -279,5 +279,31 @@
279279
width: $md-button-fab-size-mini;
280280
height: $md-button-fab-size-mini;
281281
}
282+
283+
&.md-fab-top-right,
284+
&.md-fab-top-left {
285+
position: absolute;
286+
top: 24px;
287+
}
288+
289+
&.md-fab-top-right,
290+
&.md-fab-top-left {
291+
position: absolute;
292+
bottom: 24px;
293+
}
294+
295+
&.md-fab-top-right,
296+
&.md-fab-bottom-right {
297+
right: 24px;
298+
}
299+
300+
&.md-fab-top-left,
301+
&.md-fab-bottom-left {
302+
left: 24px;
303+
}
304+
305+
&.md-fixed {
306+
position: fixed;
307+
}
282308
}
283309
</style>

0 commit comments

Comments
 (0)