add github icon

This commit is contained in:
Philipp Kühn
2020-04-18 22:35:29 +02:00
parent 53d20a454a
commit 10fd993f44
7 changed files with 179 additions and 35 deletions

View File

@@ -0,0 +1,38 @@
<script>
export default {
name: 'Icon',
props: {
name: {
type: String,
default: '',
},
size: {
type: String,
default: 'normal',
},
},
render(createElement) {
let svgHTML = ''
try {
svgHTML = require(`!html-loader!@/assets/icons/${this.name}.svg`)
} catch (e) {
// eslint-disable-next-line
console.warn(`Unable to load "${this.name}.svg" icon. Verify it exists in the icons directory.`, e)
}
return createElement(
'div',
{
class: `icon icon--${this.size}`,
domProps: {
innerHTML: svgHTML,
},
},
)
},
}
</script>
<style lang="scss" src="./style.scss" scoped></style>

View File

@@ -0,0 +1,15 @@
.icon {
display: inline-flex;
width: 1.3rem;
height: 1.3rem;
&::v-deep > svg {
width: 100%;
height: 100%;
fill: currentColor;
* {
fill: inherit;
}
}
}