-
Notifications
You must be signed in to change notification settings - Fork 32
GAUD-8851 remove text scss #7161
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
base: main
Are you sure you want to change the base?
Changes from all commits
40790aa
62ae002
b7177ee
ac4a874
0f43fa6
b248410
b285bca
248ed70
a80c5c7
58d11b3
b8167e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought that would be easier to understand and implement style in BSI, therefore I created this new file with the generator function. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
|
|
||
| import { | ||
| _generateInputAriaInvalidBaseStyles, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the plan to use this functions separately on BSI? I think it would be cleaner to merge everything that is always used together under a single function so that consumers wouldn't need to import all of them separately.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, The plan is to only use the exported function |
||
| _generateInputBaseStyles, | ||
| _generateInputDisabledBaseStyles, | ||
| _generateInputPlaceholderBaseStyles, | ||
| _getInputBaseStyleDelegates, | ||
| } from './input-styles.js'; | ||
| import { css, unsafeCSS } from 'lit'; | ||
| import { _isValidCssSelector } from '../../helpers/internal/css.js'; | ||
| import { getFocusVisibleStyles } from '../../helpers/focus.js'; | ||
|
|
||
| function _generateInputTextFocusStyles(selector) { | ||
| const input = _getInputBaseStyleDelegates(selector); | ||
| return getFocusVisibleStyles(input.selector, input.style); | ||
| } | ||
|
|
||
| /** | ||
| * A private helper method that should not be used by general consumers | ||
| */ | ||
| export function _generateInputTextStyles(selector) { | ||
| if (!_isValidCssSelector(selector)) return ''; | ||
| const finalSelector = unsafeCSS(selector); | ||
|
|
||
| return css` | ||
| ${ _generateInputBaseStyles(finalSelector) } | ||
|
|
||
| ${ _generateInputPlaceholderBaseStyles(finalSelector) } | ||
|
|
||
| ${ _generateInputTextFocusStyles(finalSelector) } | ||
|
|
||
| ${ _generateInputAriaInvalidBaseStyles(finalSelector) } | ||
|
|
||
| ${_generateInputDisabledBaseStyles(finalSelector)} | ||
| `; | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will revert these changes in this file. The report results are really good and there is not significant difference |
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.
What I did here was basically expose some base-style-generator-functions that I used in the new file
input-text-styles.jsThere 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.
I will revert these changes in the test file. The report results are really good and there is not significant difference