-
Notifications
You must be signed in to change notification settings - Fork 72
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
Update styling for empty button and date picker icon #1342
Conversation
Signed-off-by: Shenoy Pratik <[email protected]>
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.
just some early feedback
.ouiFormControlLayout__prepend{ | ||
.ouiQuickSelectPopover__buttonText { | ||
// Override specificity from universal and sibling selectors | ||
margin-right: calc($ouiSizeXS/2) !important; |
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.
why do you need calc when this will resolve to a value?
Also, how did you determine this size?
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.
Currently, this is how it is done in rest of OUI rather than using constants. This approach may be helpful in making things extensible when a theme comes in and changes the $ouiSizeXS
from 4px to 8px. Other places using this:
https://github.com/search?q=repo%3Aopensearch-project%2Foui+calc%28%24ouiSizeXS+%2F+2%29&type=code
Please let me know if this isn't recommended can hard code to margin-right: 2px
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.
Sorry, my point is that calc
is a css function, but I believe, maybe wrong, that the expression $ouiSize/2
will be evaluated by sass first, so the resulting css will be margin-right: calc(2px) !important
- basically my point is I don't think calc is doing anything here, and not sure how it helps make it extensible unless we had css variables.
@@ -96,6 +96,7 @@ $ouiButtonEmptyTypes: ( | |||
// Ghost is unique and ALWAYS sits against a dark background. | |||
color: $color; | |||
} @else if ($name == 'text') { | |||
line-height: inherit; |
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.
Is the goal for empty buttons to be aligned with other text? How does this impact alignment with other buttons?
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.
Signed-off-by: Shenoy Pratik <[email protected]>
Signed-off-by: Shenoy Pratik <[email protected]>
.ouiQuickSelectPopover__buttonText { | ||
// Override specificity from universal and sibling selectors | ||
margin-right: $ouiSizeXS !important; |
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.
I see that the new rule applies to elements with classname ouiQuickSelectPopover__buttonText
when inside a prepend but it removes the rule that applied margin to all other elements with classname ouiQuickSelectPopover__buttonText
. Shouldn't we retain that? Are we not breaking anything else by removing this?
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.
I did check it, every repo in the opensearch-project is using this class for date-picker. It is only dashboards which is using this class for the save button.
Class references: https://github.com/search?q=org%3Aopensearch-project+euiQuickSelectPopover__buttonText&type=code
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.
is this class only used by explicit classname or is it applied by a component? If by component, I'm not sure if your search is sufficient for usage.
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.
Reverted to original class. Reasoning based on offline discussion with @AMoo-Miki since, OUI is a styling library:
- It is expected users can use anything/everything exposed by OUI from components to styling.
- We shouldn’t break existing stuff for plugins/core or community partners
.ouiQuickSelectPopover__buttonText { | ||
// Override specificity from universal and sibling selectors | ||
margin-right: $ouiSizeXS !important; | ||
.ouiFormControlLayout__prepend{ |
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.
nit: space before {
?
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.
removed the prepend class based on Miki's comment
.ouiQuickSelectPopover__buttonText { | ||
// Override specificity from universal and sibling selectors | ||
margin-right: $ouiSizeXS !important; |
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.
is this class only used by explicit classname or is it applied by a component? If by component, I'm not sure if your search is sufficient for usage.
.ouiFormControlLayout__prepend{ | ||
.ouiQuickSelectPopover__buttonText { | ||
// Override specificity from universal and sibling selectors | ||
margin-right: calc($ouiSizeXS/2) !important; |
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.
Sorry, my point is that calc
is a css function, but I believe, maybe wrong, that the expression $ouiSize/2
will be evaluated by sass first, so the resulting css will be margin-right: calc(2px) !important
- basically my point is I don't think calc is doing anything here, and not sure how it helps make it extensible unless we had css variables.
Signed-off-by: Shenoy Pratik <[email protected]>
@virajsanghvi Without the
|
Signed-off-by: Shenoy Pratik <[email protected]>
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.
Approving assuming it passes checks
* update styling for empty button and date picker icon Signed-off-by: Shenoy Pratik <[email protected]> * move line-height to empty button class Signed-off-by: Shenoy Pratik <[email protected]> * update changelog Signed-off-by: Shenoy Pratik <[email protected]> * remove specificity for QuickSelectPopover Signed-off-by: Shenoy Pratik <[email protected]> * fix formatting in for calc Signed-off-by: Shenoy Pratik <[email protected]> --------- Signed-off-by: Shenoy Pratik <[email protected]> (cherry picked from commit d2bea6f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
* update styling for empty button and date picker icon Signed-off-by: Shenoy Pratik <[email protected]> * move line-height to empty button class Signed-off-by: Shenoy Pratik <[email protected]> * update changelog Signed-off-by: Shenoy Pratik <[email protected]> * remove specificity for QuickSelectPopover Signed-off-by: Shenoy Pratik <[email protected]> * fix formatting in for calc Signed-off-by: Shenoy Pratik <[email protected]> --------- Signed-off-by: Shenoy Pratik <[email protected]> (cherry picked from commit d2bea6f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Update styling for empty button and date picker icon alignments issues:
Issues Resolved
Before:
After:
Check List
yarn lint
yarn test-unit
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.