From 2e8161e68e65987afe8e5c5db2ff7f4ce202979b Mon Sep 17 00:00:00 2001 From: Leopoldthecoder Date: Fri, 27 Oct 2017 17:31:03 +0800 Subject: [PATCH] Fix checkbox-button and radio-button gap --- CHANGELOG.en-US.md | 2 +- CHANGELOG.zh-CN.md | 4 ++-- examples/components/theme-picker.vue | 17 +++++++++++++++++ package.json | 2 +- packages/theme-chalk/src/checkbox.scss | 5 +++++ packages/theme-chalk/src/input-number.scss | 5 +++-- packages/theme-chalk/src/radio-group.scss | 1 + packages/theme-chalk/src/radio.scss | 1 + 8 files changed, 31 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 2bb90d2b0..037073116 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -1,6 +1,6 @@ ## Changelog -### 2.0.0 +### 2.0.0 Carbon *2017-10-27* diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index a50ebe439..06ad5ad8a 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -1,6 +1,6 @@ ## 更新日志 -### 2.0.0 +### 2.0.0 Carbon *2017-10-27* @@ -137,7 +137,7 @@ - 移除 `theme-default` - 最低兼容 Vue 2.5.2 和 IE 10 - 表单组件的 `change` 事件和 Pagination 的 `current-change` 事件现在仅响应用户交互 - - Button 和表单组件的 `size` 属性不再接受 `large` 值,可接受 `medium`、`small` 和 `mini` + - Button 和表单组件的 `size` 属性现在可接受 `medium`、`small` 和 `mini` - 为了方便使用第三方图标,Button 的 `icon` 属性、Input 的 `prefix-icon` 和 `suffix-icon` 属性、Steps 的 `icon` 属性现在需要传入完整的图标类名 - Dialog - 移除 `size` 属性。现在 Dialog 的尺寸由 `width` 和 `fullscreen` 控制 diff --git a/examples/components/theme-picker.vue b/examples/components/theme-picker.vue index fb0aa833c..c6c4b5005 100644 --- a/examples/components/theme-picker.vue +++ b/examples/components/theme-picker.vue @@ -128,10 +128,27 @@ } }; + const shadeColor = (color, shade) => { + let red = parseInt(color.slice(0, 2), 16); + let green = parseInt(color.slice(2, 4), 16); + let blue = parseInt(color.slice(4, 6), 16); + + red = Math.round((1 - shade) * red); + green = Math.round((1 - shade) * green); + blue = Math.round((1 - shade) * blue); + + red = red.toString(16); + green = green.toString(16); + blue = blue.toString(16); + + return `#${ red }${ green }${ blue }`; + }; + const clusters = [theme]; for (let i = 0; i <= 9; i++) { clusters.push(tintColor(theme, Number((i / 10).toFixed(2)))); } + clusters.push(shadeColor(theme, 0.1)); return clusters; } } diff --git a/package.json b/package.json index 986103490..273b2497f 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "throttle-debounce": "^1.0.1" }, "peerDependencies": { - "vue": "^2.3.0" + "vue": "^2.5.2" }, "devDependencies": { "algoliasearch": "^3.24.5", diff --git a/packages/theme-chalk/src/checkbox.scss b/packages/theme-chalk/src/checkbox.scss index 48c6d83cc..e2d174bdf 100644 --- a/packages/theme-chalk/src/checkbox.scss +++ b/packages/theme-chalk/src/checkbox.scss @@ -6,6 +6,7 @@ @include b(checkbox) { color: $--checkbox-color; font-weight: $--checkbox-font-weight; + font-size: $--font-size-base; position: relative; cursor: pointer; display: inline-block; @@ -339,3 +340,7 @@ } } } + +@include b(checkbox-group) { + font-size: 0; +} diff --git a/packages/theme-chalk/src/input-number.scss b/packages/theme-chalk/src/input-number.scss index ce5ec66f8..4e5109cb8 100644 --- a/packages/theme-chalk/src/input-number.scss +++ b/packages/theme-chalk/src/input-number.scss @@ -124,14 +124,15 @@ @include when(without-controls) { .el-input__inner { + padding-left: 15px; padding-right: 15px; } } @include when(controls-right) { .el-input__inner { - padding-left: 15px; - padding-right: #{$--input-height + 10}; + padding-left: 15px; + padding-right: #{$--input-height + 10}; } @include e((increase, decrease)) { diff --git a/packages/theme-chalk/src/radio-group.scss b/packages/theme-chalk/src/radio-group.scss index 0b56c8641..2ee95a792 100644 --- a/packages/theme-chalk/src/radio-group.scss +++ b/packages/theme-chalk/src/radio-group.scss @@ -5,4 +5,5 @@ display: inline-block; line-height: 1; vertical-align: middle; + font-size: 0; } diff --git a/packages/theme-chalk/src/radio.scss b/packages/theme-chalk/src/radio.scss index c1e2a6048..a3d0791da 100644 --- a/packages/theme-chalk/src/radio.scss +++ b/packages/theme-chalk/src/radio.scss @@ -12,6 +12,7 @@ display: inline-block; white-space: nowrap; outline: none; + font-size: $--font-size-base; @include utils-user-select(none); @include when(bordered) {