Skip to content

Commit e1dcb3d

Browse files
authored
fix(space): [space]default spacing for overlay button components (#3816)
* fix(space): [space]default spacing for overlay button components * fix: import to style root file directory
1 parent 19e7e95 commit e1dcb3d

File tree

7 files changed

+44
-2
lines changed

7 files changed

+44
-2
lines changed

examples/sites/demos/mobile-first/app/space/space-size.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<!-- 使用 dynamic direction 值 -->
1717
<tiny-space class="tiny-space" :size="[rowValue, columnValue]" :wrap="true">
18-
<tiny-button style="margin: 0" v-for="n in 15" :key="n">按钮 {{ n }}</tiny-button>
18+
<tiny-button v-for="n in 15" :key="n">按钮 {{ n }}</tiny-button>
1919
</tiny-space>
2020
</div>
2121
</template>

examples/sites/demos/pc/app/space/space-size.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<!-- 使用 dynamic direction 值 -->
1717
<tiny-space class="tiny-space" :size="[rowValue, columnValue]" :wrap="true">
18-
<tiny-button style="margin: 0" v-for="n in 15" :key="n">按钮 {{ n }}</tiny-button>
18+
<tiny-button v-for="n in 15" :key="n">按钮 {{ n }}</tiny-button>
1919
</tiny-space>
2020
</div>
2121
</template>

packages/theme/src/index.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
@import './skeleton-item/index.less';
124124
@import './slide-img/index.less';
125125
@import './slider/index.less';
126+
@import './space/index.less';
126127
@import './split/index.less';
127128
@import './statistic/index.less';
128129
@import './steps/index.less';
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright (c) 2022 - present TinyVue Authors.
3+
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
4+
*
5+
* Use of this source code is governed by an MIT-style license.
6+
*
7+
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
8+
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
9+
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
10+
*
11+
*/
12+
13+
@import '../custom.less';
14+
@import './vars.less';
15+
16+
@space-prefix-cls: ~'@{css-prefix}space';
17+
18+
.@{space-prefix-cls} {
19+
.inject-Space-vars();
20+
// TODO: 需要和 button 组件的间距变量统一(button组件后续大版本变更,需要去除默认间距8px),变更后,再将此代码删除
21+
&& .tiny-button + .tiny-button {
22+
margin-left: var(--tv-Space-margin);
23+
}
24+
}

packages/theme/src/space/vars.less

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Copyright (c) 2022 - present TinyVue Authors.
3+
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
4+
*
5+
* Use of this source code is governed by an MIT-style license.
6+
*
7+
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
8+
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
9+
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
10+
*
11+
*/
12+
13+
.inject-Space-vars() {
14+
--tv-Space-margin: 0px;
15+
}

packages/theme/src/vars.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
@import './slide-bar/vars.less';
5353
@import './tooltip/vars.less';
5454
@import './split/vars.less';
55+
@import './space/vars.less';
5556
@import './steps/vars.less';
5657
@import './switch/vars.less';
5758
@import './tabs/vars.less';

packages/vue/src/space/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
import Space from './src/index'
14+
import '@opentiny/vue-theme/space/index.less'
1415
import { version } from './package.json'
1516

1617
/* istanbul ignore next */

0 commit comments

Comments
 (0)