Skip to content

Commit

Permalink
chore(button): update ModalButton margin (uber#3742)
Browse files Browse the repository at this point in the history
Update ModalButton margin to use `:not(:last-child)`, which is slightly more semantic than `:nth-last-child(n+2)`. Should have the same specificity.

Co-authored-by: Chase Starr <[email protected]>
  • Loading branch information
leyanlo and chasestarr authored Sep 10, 2020
1 parent cfb2721 commit 03f21f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modal/__tests__/modal-button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('ModalButton', () => {
const result = mergedOverrides.BaseButton.style({$theme: mockTheme});
expect(result).toEqual({
color: 'red',
':nth-last-child(n+2)': {
':not(:last-child)': {
marginRight: '$theme.sizing.scale500',
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/modal/modal-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const overrides = {
const marginInlineEnd: string =
$theme.direction !== 'rtl' ? 'marginRight' : 'marginLeft';
return {
':nth-last-child(n+2)': {
':not(:last-child)': {
[marginInlineEnd]: $theme.sizing.scale500,
},
};
Expand Down

0 comments on commit 03f21f4

Please sign in to comment.