Skip to content

Commit 8f14e54

Browse files
committed
chore: init coreui-icons-vue repository
0 parents  commit 8f14e54

14 files changed

+16023
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
.git
3+
node_modules

CIcon.vue

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
:viewBox="viewBox"
5+
:class="computedClasses"
6+
v-html="icon.svgContent"
7+
></svg>
8+
</template>
9+
10+
<script>
11+
export default {
12+
name: 'CIcon',
13+
//This object contains icons added before component registration
14+
icons: {},
15+
props: {
16+
name: String,
17+
content: [String, Array],
18+
// fill: String,
19+
// background: String,
20+
size: {
21+
type: String,
22+
validator: size => ['sm', 'lg', 'xl', 'custom-size'].includes(size)
23+
},
24+
customClasses: [String, Array, Object]
25+
},
26+
computed: {
27+
iconName () {
28+
const iconNameIsKebabCase = this.name && this.name.includes('-')
29+
return iconNameIsKebabCase ? this.toCamelCase(this.name) : this.name
30+
},
31+
code () {
32+
return this.content || this.$options.icons[this.iconName]
33+
},
34+
icon () {
35+
if (Array.isArray(this.code)) {
36+
const coordinates = this.code.length > 1 ? this.code[0] : '64 64'
37+
const svgContent = this.code.length > 1 ? this.code[1] : this.code[0]
38+
return { coordinates, svgContent }
39+
}
40+
return { coordinates: '64 64', svgContent: this.code }
41+
},
42+
viewBox () {
43+
return this.$attrs.viewBox || `0 0 ${ this.icon.coordinates }`
44+
},
45+
// style () {
46+
// return {
47+
// fill: this.fill || 'currentColor',
48+
// background: this.background
49+
// }
50+
// },
51+
computedSize () {
52+
return this.$attrs.width || this.$attrs.height ? 'custom-size' : this.size
53+
},
54+
computedClasses () {
55+
return this.customClasses ||
56+
['c-icon', { [`c-icon-${this.computedSize}`]: this.computedSize }]
57+
}
58+
},
59+
methods: {
60+
toCamelCase (str) {
61+
return str.replace(/([-_][a-z0-9])/ig, ($1) => {
62+
return $1.toUpperCase().replace('-', '')
63+
})
64+
}
65+
}
66+
}
67+
</script>

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# CoreUI Icons - Simply beautiful open source icons
2+
3+
An open source icon set with marks in SVG, webfont and raster formats. Ready-to-use fonts and stylesheets that work with your favorite frameworks..
4+
5+
6+
## Preview & Docs
7+
8+
[https://coreui.io/icons/](https://coreui.io/icons/)
9+
10+
11+
## Installation
12+
13+
### CDN
14+
15+
```html
16+
<link rel="stylesheet" href="https://unpkg.com/@coreui/icons/css/coreui-icons.min.css">
17+
```
18+
19+
### NPM
20+
21+
```shell
22+
npm install @coreui/icons --save
23+
24+
```
25+
26+
Or, you can also clone or [download this repository](https://github.com/coreui/coreui-icons/archive/master.zip) as zip.
27+
28+
29+
## Basic Use
30+
You can place CoreUI Icons just about anywhere using a CSS style prefix and the icon’s name. CoreUI Icons are designed to be used with inline elements ex. `<i>` or `<span>`.
31+
32+
```html
33+
<i class="cui-energy"></i>
34+
```
35+
36+
## License
37+
38+
CoreUI Icons Free is free, open source, and GPL friendly. You can use it for
39+
commercial projects, open source projects, or really almost whatever you want.
40+
41+
- Icons — CC BY 4.0 License
42+
- In the CoreUI Icons Free download, the CC BY 4.0 license applies to all icons packaged as .svg and .js files types.
43+
- Fonts — SIL OFL 1.1 License
44+
- In the CoreUI Icons Free download, the SIL OLF license applies to all icons packaged as web and desktop font files.
45+
- Code — MIT License
46+
- In the CoreUI Icons Free download, the MIT license applies to all non-font and non-icon files.

babel.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
presets: [
3+
["@vue/app", {
4+
"modules": false
5+
}]
6+
]
7+
}

0 commit comments

Comments
 (0)