Skip to content
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

Add icon margin that works on both LTR & RTL, re-add removed styles #104

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v4.9.3

- Use margin right and left to avoid browser specific prefix fix for rtl space issue.
- Re-add the padding styles that was removed that caused regression.

# v4.9.2

- Resolved regression in iconic menu trigger size.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "px-dropdown",
"version": "4.9.2",
"version": "4.9.3",
"main": [
"px-dropdown.html"
],
Expand Down
2 changes: 1 addition & 1 deletion css/px-dropdown-styles.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "px-dropdown",
"author": "General Electric",
"description": "A Predix UI Dropdown component",
"version": "4.9.2",
"version": "4.9.3",
"extName": null,
"scripts": {
"clean": "gulp clean",
Expand Down
16 changes: 9 additions & 7 deletions sass/px-dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ $inuit-enable-btn--primary: true;
--iron-icon-width: 1.06667rem;
--iron-icon-height: 1.06667rem;
margin-left: $inuit-base-spacing-unit--tiny;
/*
These margins are for pages that are rendered from "Right-To-Left" or "Left-To-Right"
If the writing direction is left-to-right, this value overrides margin-left.
If the writing direction is right-to-left, this value overrides margin-right.
*/
-webkit-margin-start: $inuit-base-spacing-unit--tiny;
-moz-margin-start: $inuit-base-spacing-unit--tiny;
margin-right: $inuit-base-spacing-unit--tiny;
Copy link
Contributor

@benjaminliugang benjaminliugang Feb 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix only can add margin-right value for the dropdown button's icon, the item icon's space issue still exist.
image

We should add margin-right value for item-icon, but if we only add margin-right, for RTL, the item-icon's space issue will comes out again.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
.dropdown {
font-size: var(--px-dropdown-content-font-size, inherit);
Expand Down Expand Up @@ -223,6 +217,8 @@ $inuit-enable-btn--primary: true;
.item-icon {
--iron-icon-width: var(--px-dropdown-item-icon-size, calculateRem(16px));
--iron-icon-height: var(--px-dropdown-item-icon-size, calculateRem(16px));
margin-right: $inuit-base-spacing-unit--tiny;
margin-left: $inuit-base-spacing-unit--tiny;
}
.checkbox {
margin-right: $inuit-base-spacing-unit--tiny;
Expand Down Expand Up @@ -309,3 +305,9 @@ $inuit-enable-btn--primary: true;
border-width: 6px;
margin-left: -6px;
}

$inuit-enable-paddings--small: true;
$inuit-enable-paddings--tiny: true;
$inuit-enable-paddings--none: true;
$inuit-enable-margins--small: true;
@import "px-spacing-design/_trumps.spacing.scss";