-
Notifications
You must be signed in to change notification settings - Fork 141
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(pro:textarea): placeholder color for textarea #1512
Conversation
&:placeholder-shown { | ||
text-overflow: ellipsis; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the code review
- The code is properly indented and easy to read.
- The code follows the correct syntax and there are no typos.
- The comment provided is helpful in understanding the code.
- The opacity override is necessary for Firefox, but this may be handled differently depending on the browser.
- The use of the placeholder-shown selector should be tested to make sure it works as expected in all browsers.
- The color value is set using a variable, which is good practice.
- The text-overflow property should be tested to make sure it works correctly in all browsers.
@@ -130,6 +131,7 @@ | |||
width: 100%; | |||
resize: none; | |||
overflow: hidden; | |||
.placeholder(@textarea-placeholder-color); | |||
|
|||
&[disabled] { | |||
cursor: not-allowed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code review:
-
At line 1, you have imported the placeholder.less mixin. This is good practice as it allows you to reuse code and keep your codebase organized.
-
At line 130, you have added a placeholder mixin which sets the textarea-placeholder-color variable. This will help ensure consistent styling across different textareas.
-
At line 131, you have added a statement that sets the cursor to not-allowed when the textarea is disabled. This will prevent accidental changes to the textarea while still providing feedback to the user.
Overall, this is a well written patch that ensures consistent styling and prevents accidental changes.
This preview will be available after the AzureCI is passed. |
Codecov Report
@@ Coverage Diff @@
## main #1512 +/- ##
=======================================
Coverage 92.75% 92.75%
=======================================
Files 331 331
Lines 30801 30801
Branches 3533 3534 +1
=======================================
Hits 28568 28568
Misses 2233 2233
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -1,3 +1,4 @@ | |||
@import '../../style/mixins/placeholder.less'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@import '../../../components/style//mixins/placeholder.less';
直接用 components 里的就好了。
@@ -130,6 +131,7 @@ | |||
width: 100%; | |||
resize: none; | |||
overflow: hidden; | |||
.placeholder(@textarea-placeholder-color); | |||
|
|||
&[disabled] { | |||
cursor: not-allowed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The code looks good and there is no obvious bug risk.
- It would be better to add a comment above the @import statement to indicate what the placeholder.less file contains, as it can help with understanding the code better.
- The statement ".placeholder(@textarea-placeholder-color);" should be added inside a media query if it is necessary to keep the code responsive.
PR Checklist
Please check if your PR fulfills the following requirements:
What is the current behavior?
What is the new behavior?
input 的 placeholder 颜色和 textarea 的 placeholder 颜色不一样,在 components 的 style mixins 中定义了一个 placeholder 的 less 方法,在 pro 里面没有。所以在 pro 里面添加了这个方法,并且在 textarea 使用。
Other information