GAUD-8851 remove text scss#7161
Conversation
- Creates the input-text-styles.js file - Implements the style function generator - Mimics the text.scss styles based on the input-styles.js
…y input-text-styles.js
There was a problem hiding this comment.
I thought that would be easier to understand and implement style in BSI, therefore I created this new file with the generator function.
|
Thanks for the PR! 🎉 We've deployed an automatic preview for this PR - you can see your changes here:
Note The build needs to finish before your changes are deployed. |
There was a problem hiding this comment.
What I did here was basically expose some base-style-generator-functions that I used in the new file input-text-styles.js
Functions are not any more exported and only used within the _generateInputTextStyles function, which is the only exposed function to BSI for input texts
There was a problem hiding this comment.
this is a good practice that @dlockhart suggested me last time, and I found it very useful. Here we might see how different (if there is any) the component would look with these generated styles, compared to the sass ones
There was a problem hiding this comment.
I will revert these changes in this file. The report results are really good and there is not significant difference
| import { _isValidCssSelector } from '../../helpers/internal/css.js'; | ||
| import { getFocusVisibleStyles } from '../../helpers/focus.js'; | ||
|
|
||
| function _generateInputTextDisabledStyles(selector) { |
There was a problem hiding this comment.
This shouldn't be needed anymore. If you check the input-styles under the off flag. It has the same styles, meant to override focus-styles when item is disabled. However, the new generated styles adds :not(disabled) to those focus styles so they don't need to be overriden
There was a problem hiding this comment.
Thanks for the clarification. That answers my comment below as well.
…hey are already handled by the Input base styles by the :not(:disabled)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
a2f113c to
1c1c9a4
Compare
| before(() => { | ||
| const style = document.createElement('style'); | ||
| style.id = 'generated-styles'; | ||
| style.textContent = _generateInputTextStyles('.d2l-test-input-text'); |
There was a problem hiding this comment.
For example, here is a similar implementation about how this would be done in BSI as well @GZolla and @dlockhart: We would only need to call the generator function, instead of calling multiple functions there in BSI.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ction comments since they are not longer public
c6a8704 to
42d8179
Compare
|
|
||
| ${_generateInputDisabledBaseStyles(selector)} | ||
|
|
||
| ${_generatewebkitSearchStyles(selector)} |
There was a problem hiding this comment.
I don't think we want this here since then it'll show up in inputStyles and it wasn't there before. I think we want to only do it from _generateInputTextStyles.
There was a problem hiding this comment.
Uh, please correct me if I am wrong but I think that code also was included in the generated inputStyles.. So what I did just be equivalent to what it was before for that portion of the code
There was a problem hiding this comment.
Yep you're right -- I was confused because before your last commit it would have been missing them.
That indicates to me that we're missing a vdiff to cover this case for inputStyles, could you add that in?
There was a problem hiding this comment.
Hmm although if it's truly only needed for webkit then our vdiffs being Chrome-only won't help. But if it does something for Chrome then it's worth adding vdiffs I think.
There was a problem hiding this comment.
OK, I have added test cases for NON-SASS and SASS, making sure the native X doesn't appear thanks to our -webkit- css rule. Thank you!
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
🎉 This PR is included in version 3.271.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Jira
GAUD-8851
I strongly suggest to review this commit by commit to understand the final result in case it doesn't make sense right away