Skip to content

Commit 2310a0e

Browse files
committed
refactor: change icon descriptions, fix header, add card icon styles
1 parent 2226c3b commit 2310a0e

File tree

6 files changed

+41
-17
lines changed

6 files changed

+41
-17
lines changed

src/assets/scss/style.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,12 @@
66

77
// If you want to add something do it here
88
@import "custom";
9+
10+
.card-header .c-icon:first-child {
11+
margin-right: 0.1rem;
12+
margin-top: 0.1rem;
13+
vertical-align: top;
14+
width: 1.2rem;
15+
height: 1.2rem;
16+
font-size: 1.2rem;
17+
}

src/containers/TheHeader.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@
1616
width="97"
1717
height="46"
1818
alt="CoreUI Logo"
19-
:wrappedInLink="{ href: 'https://coreui.io', target: '_blank'}"
2019
/>
2120
<CHeaderNav class="d-md-down-none mr-auto">
22-
<CHeaderNavItem class="px-3" to="/dashboard">
23-
<CHeaderNavLink>
21+
<CHeaderNavItem class="px-3">
22+
<CHeaderNavLink to="/dashboard">
2423
Dashboard
2524
</CHeaderNavLink>
2625
</CHeaderNavItem>
27-
<CHeaderNavItem class="px-3" to="/users" exact>
28-
<CHeaderNavLink>
26+
<CHeaderNavItem class="px-3">
27+
<CHeaderNavLink to="/users" exact>
2928
Users
3029
</CHeaderNavLink>
3130
</CHeaderNavItem>

src/containers/_nav.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ export default [
216216
}
217217
},
218218
{
219-
_name: 'CSidebarNavDivider'
219+
_name: 'CSidebarNavDivider',
220+
_class: 'm-2'
220221
},
221222
{
222223
_name: 'CSidebarNavTitle',

src/views/icons/Brands.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<CCard>
44
<CCardHeader>
5-
<CIcon name="cil-globe-alt"/>Brand icons
5+
<CIcon name="cil-basket"/>Brand icons
66
</CCardHeader>
77
<CCardBody>
88
<CRow class="text-center">
@@ -14,7 +14,7 @@
1414
:key="brandName"
1515
>
1616
<CIcon :height="42" :content="brand"/>
17-
<div>{{brandName}}</div>
17+
<div>{{toKebabCase(brandName)}}</div>
1818
</CCol>
1919
</template>
2020
</CRow>
@@ -27,6 +27,11 @@
2727
import { brandSet as brands } from '@coreui/icons'
2828
export default {
2929
name: 'Brands',
30-
brands
30+
brands,
31+
methods: {
32+
toKebabCase (str) {
33+
return str.replace(/([a-z])([A-Z0-9])/g, '$1-$2').toLowerCase()
34+
}
35+
}
3136
}
3237
</script>

src/views/icons/CoreUIIcons.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<div>
44
<CCard>
55
<CCardHeader>
6-
<CIcon :content="$options.freeSet.pencil"/>CoreUI Icons
6+
<CIcon :content="$options.freeSet.cilHandPointDown"/>
7+
CoreUI Icons
78
<CBadge color="info">New</CBadge>
89
<div class="card-header-actions">
910
<a
@@ -26,7 +27,7 @@
2627
:key="iconName"
2728
>
2829
<CIcon :height="42" :content="icon"/>
29-
<div>{{iconName}}</div>
30+
<div>{{toKebabCase(iconName)}}</div>
3031
</CCol>
3132
</template>
3233
</CRow>
@@ -39,6 +40,12 @@
3940
import { freeSet } from '@coreui/icons'
4041
export default {
4142
name: 'CoreUIIcons',
42-
freeSet
43+
freeSet,
44+
methods: {
45+
toKebabCase (str) {
46+
console.log(this.$options.freeSet, this.$options.freeSet.handPointDown)
47+
return str.replace(/([a-z])([A-Z0-9])/g, '$1-$2').toLowerCase()
48+
}
49+
}
4350
}
4451
</script>

src/views/icons/Flags.vue

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
span. If you want to have a squared version flag then add the class
1414
flag-icon-squared as well. -->
1515
</CCol>
16-
<template v-for="(flag, key) in displayedFlags">
16+
<template v-for="(flag, flagName) in displayedFlags">
1717
<CCol
1818
class="mb-5"
1919
col="3"
2020
sm="2"
21-
:key="key"
21+
:key="flagName"
2222
>
2323
<CIcon :height="42" :content="flag"/>
24-
<div>{{key}}</div>
24+
<div>{{toKebabCase(flagName)}}</div>
2525
</CCol>
2626
</template>
2727
</CRow>
@@ -36,11 +36,14 @@ export default {
3636
name: 'Flags',
3737
flagSet,
3838
computed: {
39-
// Avoid duplication caused by displaying 1x1 and 4x3 formats
40-
// (adding Q to name makes icon quadratic)
4139
displayedFlags () {
4240
return this.$options.flagSet
4341
}
42+
},
43+
methods: {
44+
toKebabCase (str) {
45+
return str.replace(/([a-z])([A-Z0-9])/g, '$1-$2').toLowerCase()
46+
}
4447
}
4548
}
4649
</script>

0 commit comments

Comments
 (0)