Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 01a354e

Browse filesBrowse files
committed
fix: give 'size' prop precedens over height and width attributes
- add 'custom' as a valid value of 'size' prop
1 parent aba556b commit 01a354e
Copy full SHA for 01a354e

File tree

1 file changed

+5
-4
lines changed
Filter options

1 file changed

+5
-4
lines changed

‎src/CIconRaw.vue

Copy file name to clipboardExpand all lines: src/CIconRaw.vue
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default {
2323
size: {
2424
type: String,
2525
validator: size => [
26-
'custom-size', 'sm', 'lg', 'xl',
26+
'custom', 'custom-size', 'sm', 'lg', 'xl',
2727
'2xl', '3xl', '4xl', '5xl', '6xl', '7xl', '8xl', '9xl'
2828
].includes(size)
2929
},
@@ -56,11 +56,12 @@ export default {
5656
return this.$attrs.viewBox || `0 0 ${this.scale}`
5757
},
5858
computedSize () {
59-
return this.$attrs.width || this.$attrs.height ? 'custom-size' : this.size
59+
const addCustom = !this.size && (this.$attrs.width || this.$attrs.height)
60+
return this.size === 'custom' || addCustom ? 'custom-size' : this.size
6061
},
6162
computedClasses () {
62-
return this.customClasses ||
63-
['c-icon', { [`c-icon-${this.computedSize}`]: this.computedSize }]
63+
const size = this.computedSize
64+
return this.customClasses || ['c-icon', { [`c-icon-${size}`]: size }]
6465
}
6566
},
6667
methods: {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.