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

NcSelect: make same height and color as NcTextField #5829

Merged
merged 1 commit into from
Jul 24, 2024
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
4 changes: 4 additions & 0 deletions src/components/NcInputField/NcInputField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ export default {
padding-inline: calc(var(--input-padding-start) + var(--input-border-width-offset)) calc(var(--input-padding-end) + var(--input-border-width-offset));
padding-block: var(--input-border-width-offset);

&::placeholder {
color: var(--color-text-maxcontrast);
}

&:active:not([disabled]),
&:hover:not([disabled]),
&:focus:not([disabled]) {
Expand Down
17 changes: 12 additions & 5 deletions src/components/NcSelect/NcSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1177,15 +1177,16 @@ body {
/* Override default vue-select styles */
min-height: var(--default-clickable-area);
min-width: 260px;
margin: 0;
margin: 0 0 var(--default-grid-baseline);

.select__label {
display: block;
margin-bottom: 2px;
}

.vs__selected {
height: 32px;
height: calc(var(--default-clickable-area) - var(--default-grid-baseline));
margin: calc(var(--default-grid-baseline) / 2);
padding: 0 8px 0 12px;
border-radius: 18px !important;
background: var(--color-primary-element-light);
Expand All @@ -1194,10 +1195,15 @@ body {

.vs__search {
text-overflow: ellipsis;
color: var(--color-main-text);

&::placeholder {
color: var(--color-text-maxcontrast);
}
}

.vs__search, .vs__search:focus {
margin: 2px 0 0;
margin: 0;
}

.vs__dropdown-toggle {
Expand Down Expand Up @@ -1263,12 +1269,13 @@ body {

.vs__selected-options {
// If search is hidden, ensure that the height of the search is the same
GVodyanov marked this conversation as resolved.
Show resolved Hide resolved
min-height: 40px; // 36px search height + 4px search margin
min-height: var(--default-clickable-area);
Copy link
Contributor

@Antreesy Antreesy Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Selector specificity either isn't big enough or scoped enough here (see leaked styles from server and viewer):
image

Not a part of this PR, of course, but something to consider

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is #5883


// Hide search from dom if unused to prevent unneeded flex wrap
.vs__selected ~ .vs__search[readonly] {
position: absolute;
}
padding: 0 5px;
}

&.vs--single {
Expand Down Expand Up @@ -1332,6 +1339,6 @@ body {

// Selected users require slightly different padding
.user-select .vs__selected {
padding: 0 2px !important;
padding: 0 5px !important;
}
</style>
Loading