Skip to content

Commit

Permalink
Merge pull request #181 from gofynd/fix-disabled-issue
Browse files Browse the repository at this point in the history
Fix input and dropdown disabled css
  • Loading branch information
paullobofynd authored Oct 4, 2024
2 parents 4ba33ab + 995e17f commit a2c025c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 17 deletions.
2 changes: 2 additions & 0 deletions src/base/variable.less
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
@SemanticWarningHover:#7D4F12;
@SemanticWarningLight:#E8D0B2;
@SemanticWarningBG:#FFEBD6;
@disableBG: #EDEDED;
@disableText:#9C9CAA;


.disableBtn(){
Expand Down
3 changes: 2 additions & 1 deletion src/components/NChips/NChips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ export default {
height: 39px;
padding: 0 12px;
margin: 0 8px 0 0;
display: inline-block;
display: inline-flex;
align-items: center;
cursor: default;
border-radius: 39px;
border: 1px solid @BorderColor;
Expand Down
18 changes: 13 additions & 5 deletions src/components/NDropdown/NDropdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,23 @@
}
// Disabled
.nitrozen-select.disabled {
.disable(@HoverColor);
.disable(@disableBG);
opacity: 1;
}
.nitrozen-select.disabled .nitrozen-select__trigger {
color: @TypographyPrimaryColor;
.disable(@HoverColor);
color: @disableText;
.disable(@disableBG);
opacity: 1;

}
.nitrozen-select.disabled .nitrozen-select__trigger .nitrozen-dropdown-arrow {
background: @HoverColor;
.nitrozen-inline-svg {
svg {
path {
fill: @GreyColor; // or use a specific color value
}
}
}
}

// Arrow
Expand Down Expand Up @@ -178,7 +186,7 @@
color: @LabelColor;
font-family: @PrimaryFont;
font-size: 12px;
font-weight: 500;
font-weight: 400;
line-height: 21px;
}

Expand Down
3 changes: 1 addition & 2 deletions src/components/NDropdown/NDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
v-model="searchInput"
@search="searchInputChange"
v-on:keyup="searchInputChange"
v-on:keydown="searchInputChange"
:placeholder="searchInputPlaceholder"
/>
</span>
Expand Down Expand Up @@ -323,7 +322,7 @@ export default {
}
});
tmp = [...new Set(tmp)];
return `${tmp.join(", ")}`;
return `${tmp.length}` + ' Selected';
} else if (this.label) {
return this.placeholder || `Select ${this.label.toLowerCase()}`;
}
Expand Down
8 changes: 7 additions & 1 deletion src/components/NInline/NInline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ export default {

<style lang="less">
.nitrozen-inline-svg{
height: 10px;
display: flex;
align-items: center;
svg{
flex-shrink: 0;
}
}
</style>
13 changes: 5 additions & 8 deletions src/components/NInput/NInput.less
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@
}

.n-input:disabled {
background: @HoverColor;
background: @disableBG;
color: @disableText;
pointer-events: none;
cursor: not-allowed;
opacity: 0.5;
}

.n-input:disabled + .n-input-label {
opacity: 0.5;
}

.nitrozen-form-input {
Expand All @@ -57,8 +56,6 @@
}

.n-input-maxlength {
// display: block;
// float: right;
display: flex;
justify-content: flex-end;
position: relative;
Expand All @@ -70,20 +67,20 @@

::-webkit-input-placeholder {
/* Edge */
color: @PlaceholderColor;
color: @LabelColor;
font-size: 12px;
font-family: @PrimaryFont;
}

:-ms-input-placeholder {
/* Internet Explorer 10-11 */
color: @PlaceholderColor;
color: @LabelColor;
font-size: 12px;
font-family: @PrimaryFont;
}

::placeholder {
color: @PlaceholderColor;
color: @LabelColor;
font-size: 12px;
font-family: @PrimaryFont;
}
Expand Down

0 comments on commit a2c025c

Please sign in to comment.