Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(comp:select): fix option style #704

Merged
merged 1 commit into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/components/checkbox/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
display: inline-block;
width: 0;
overflow: hidden;
content: "\a0";
content: '\a0';
}

&-input {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/radio/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
display: inline-block;
width: 0;
overflow: hidden;
content: "\a0";
content: '\a0';
}

&-input {
Expand Down
8 changes: 4 additions & 4 deletions packages/components/select/demo/OverlayRender.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ const onChange = (value: string) => {
const onAdd = () => {
const currOptions = options.value
const label = inputValue.value
options.value = [...currOptions, { key: currOptions.length, label, value: label }]
options.value = [...currOptions, { key: label, label, value: label }]
inputValue.value = ''
}

const overlayRender = (children: VNode[]) => {
const divider = h(IxDivider)
const input = h(IxInput, { style: { flex: 'auto' }, value: inputValue.value, onChange: onChange })
const button = h(IxButton, { style: { flex: 'none', marginLeft: '8px' }, icon: 'plus', onClick: onAdd }, () => 'Add')
const addItem = h('div', { style: { display: 'flex', padding: '0 16px 8px' } }, [input, button])
const input = h(IxInput, { style: { width: '100px' }, value: inputValue.value, onChange: onChange })
const button = h(IxButton, { icon: 'plus', onClick: onAdd }, () => 'Add')
const addItem = h('div', { style: { display: 'flex', padding: '0 16px 8px', gap: '8px' } }, [input, button])
return h('div', [children, divider, addItem])
}
</script>
12 changes: 6 additions & 6 deletions packages/components/select/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
}

.@{select-option-prefix} {
.reset-component();
.select-option(@select-option-font-size, @select-option-color);

&-disabled {
Expand All @@ -136,20 +137,19 @@
font-weight: @select-option-selected-font-weight;
}

&-checkbox {
margin-left: @select-option-margin-left;
}

&-label {
margin-left: @select-option-margin-left;
.ellipsis();
}

.@{checkbox-prefix} + &-label {
margin-left: @select-option-label-margin-left;
}

&-group {
.reset-component();
.select-option(@select-option-font-size - 2px, @select-option-disabled-color);

&-label {
margin-left: @select-option-margin-left;
.ellipsis();
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/components/select/style/mixin.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.select-option(@font-size; @text-color) {
display: block;
position: relative;
display: flex;
align-items: center;
height: @select-option-height;
line-height: 1;
padding: @select-option-padding;
font-size: @font-size;
color: @text-color;
Expand Down
4 changes: 2 additions & 2 deletions packages/components/select/style/themes/default.variable.less
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@

@select-option-font-size: @font-size-md;
@select-option-height: @height-md;
@select-option-margin-left: @spacing-md;
@select-option-padding: @spacing-sm;
@select-option-padding: @spacing-sm @spacing-md;
@select-option-color: @text-color;
@select-option-disabled-color: @text-color-disabled;
@select-option-active-background-color: @color-grey-l50;
@select-option-selected-color: @color-primary;
@select-option-selected-background-color: tint(@color-primary, 90%);
@select-option-selected-font-weight: @font-weight-xl;
@select-option-transition: background @transition-duration-base @ease-in-out;
@select-option-label-margin-left: @spacing-sm;

@select-option-group-border: @border-width-sm @border-style @border-color;

Expand Down