mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
added missing component
This commit is contained in:
parent
4f784a7628
commit
43fbb5bc96
56
styleguide/src/system/components/typography/Icon/Icon.vue
Normal file
56
styleguide/src/system/components/typography/Icon/Icon.vue
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<template>
|
||||||
|
<component
|
||||||
|
:is="tag"
|
||||||
|
:aria-label="ariaLabel"
|
||||||
|
class="ds-icon"
|
||||||
|
>
|
||||||
|
<component
|
||||||
|
v-if="svgComponent"
|
||||||
|
:is="svgComponent"
|
||||||
|
class="ds-icon-svg"/>
|
||||||
|
</component>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import icons from '@@/icons'
|
||||||
|
/**
|
||||||
|
* Icons are used to add meaning and improve accessibility.
|
||||||
|
* @version 1.0.0
|
||||||
|
*/
|
||||||
|
export default {
|
||||||
|
name: 'DsIcon',
|
||||||
|
props: {
|
||||||
|
/**
|
||||||
|
* The name of the icon.
|
||||||
|
*/
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* Descriptive text to be read to screenreaders.
|
||||||
|
*/
|
||||||
|
ariaLabel: {
|
||||||
|
type: String,
|
||||||
|
default: 'icon'
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* The html element name used for the icon.
|
||||||
|
*/
|
||||||
|
tag: {
|
||||||
|
type: String,
|
||||||
|
default: 'span'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
svgComponent() {
|
||||||
|
return icons[this.name]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" src="./style.scss">
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<docs src="./demo.md"></docs>
|
||||||
16
styleguide/src/system/components/typography/Icon/demo.md
Normal file
16
styleguide/src/system/components/typography/Icon/demo.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
## Basic usage
|
||||||
|
|
||||||
|
Simply provide the name for the icon.
|
||||||
|
|
||||||
|
```
|
||||||
|
<ds-icon name="plus"></ds-icon>
|
||||||
|
<ds-icon name="user"></ds-icon>
|
||||||
|
<ds-icon name="comments"></ds-icon>
|
||||||
|
<ds-icon name="ban"></ds-icon>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Icon list
|
||||||
|
|
||||||
|
Below is a list of all available icons. If you want to change these icons or want to add new ones, put them in `system/icons/svg`.
|
||||||
|
|
||||||
|
<icon-list></icon-list>
|
||||||
20
styleguide/src/system/components/typography/Icon/style.scss
Normal file
20
styleguide/src/system/components/typography/Icon/style.scss
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
.ds-icon {
|
||||||
|
@include reset;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
height: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ds-icon-svg {
|
||||||
|
line-height: 1;
|
||||||
|
height: 1.2em;
|
||||||
|
// Use this if the icons are build with strokes
|
||||||
|
// stroke: currentColor;
|
||||||
|
// stroke-width: 2.5px;
|
||||||
|
// stroke-linejoin: miter;
|
||||||
|
// stroke-linecap: miter;
|
||||||
|
// overflow: visible;
|
||||||
|
// Use this if the icons are build with solids
|
||||||
|
fill: currentColor
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user