-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new component: Info and improve styles
- Create Info boxes (messages with icons) - Multiples types: (default), Warning, Help
- Loading branch information
Showing
6 changed files
with
96 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<div class="info-text mt-3 mb-3 px-3" :class="'is-' + type"> | ||
<fa-icon :icon="icon" class="info-icon mt-1 ml-1" /> | ||
<div class="info-content"> | ||
<slot /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
type: { | ||
type: String, | ||
default: 'info', | ||
}, | ||
}, | ||
data() { | ||
return { | ||
icons: { | ||
info: 'info-circle', | ||
warning: 'exclamation-circle', | ||
help: 'question-circle', | ||
}, | ||
}; | ||
}, | ||
computed: { | ||
icon() { | ||
return this.icons[this.type]; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@import '@/assets/sass/variables.scss'; | ||
.info-text { | ||
font-size: 0.85em; | ||
} | ||
.is-info { | ||
color: $primary; | ||
} | ||
.is-warning { | ||
color: $red; | ||
} | ||
.is-help { | ||
background: $grey-lightest; | ||
color: $grey-dark; | ||
border-radius: 4px; | ||
padding: 0.75rem; | ||
margin-bottom: 1.5rem !important; | ||
} | ||
.info-icon { | ||
float: left; | ||
} | ||
.info-content { | ||
margin-left: 2rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters