Skip to content

Commit

Permalink
Merge pull request #1614 from nextcloud/bugfix/noid/actionbutton-alig…
Browse files Browse the repository at this point in the history
…n-materialdesignicon

Quickfix for action button and material design icon
  • Loading branch information
PVince81 authored Dec 1, 2020
2 parents bfc6339 + 3446414 commit 392a1db
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"vue-eslint-parser": "^7.1.0",
"vue-jest": "^3.0.5",
"vue-loader": "^15.9.1",
"vue-material-design-icons": "^4.11.0",
"vue-styleguidist": "^4.33.9",
"vue-template-compiler": "^2.6.11",
"webpack": "^4.42.1",
Expand Down
10 changes: 10 additions & 0 deletions src/assets/action.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@
background-repeat: no-repeat;
}

.material-design-icon {
width: $clickable-area;
height: $clickable-area;
opacity: $opacity_full;

.material-design-icon__svg {
vertical-align: middle;
}
}

// long text area
p {
width: 185px;
Expand Down
36 changes: 36 additions & 0 deletions src/components/ActionButton/ActionButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,42 @@ If you're using a long text you can specify a title
<ActionButton icon="icon-delete" title="Long button" @click="alert('Delete')">This button is associated with a very long text.\nAnd with new lines too.</ActionButton>
</Actions>
```

You can also use a custom icon, for example from the vue-material-design-icons library:

```vue
<template>
<Actions>
<ActionButton>
<HandLeft
slot="icon"
:size="16"
decorative
title="" />
Raise left hand
</ActionButton>
<ActionButton>
<HandRight
slot="icon"
:size="16"
decorative
title="" />
Raise right hand
</ActionButton>
</Actions>
</template>
<script>
import HandLeft from 'vue-material-design-icons/HandLeft'
import HandRight from 'vue-material-design-icons/HandRight'
export default {
components: {
HandLeft,
HandRight,
},
}
</script>
```
</docs>

<template>
Expand Down

0 comments on commit 392a1db

Please sign in to comment.