-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Checkable Button, Button and ButtonGroup, BulkAction] apply design language #2684
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,32 +80,43 @@ $stacking-order: ( | |
border-top-right-radius: 0; | ||
border-bottom-right-radius: 0; | ||
|
||
&::after { | ||
border-top-right-radius: 0; | ||
border-bottom-right-radius: 0; | ||
} | ||
|
||
&:focus { | ||
z-index: z-index(focused, $stacking-order); | ||
} | ||
} | ||
} | ||
// stylelint-disable selector-max-combinators | ||
|
||
// stylelint-disable selector-max-combinators, selector-max-compound-selectors, selector-max-specificity | ||
[data-buttongroup-segmented] { | ||
.Button { | ||
.Button, | ||
.Button::after { | ||
border-radius: 0; | ||
} | ||
> :first-child .Button { | ||
> :first-child .Button, | ||
> :first-child .Button::after { | ||
border-top-left-radius: var(--p-border-radius-base, border-radius()); | ||
border-bottom-left-radius: var(--p-border-radius-base, border-radius()); | ||
} | ||
> :last-child .Button { | ||
> :last-child .Button, | ||
> :last-child .Button::after { | ||
border-top-right-radius: var(--p-border-radius-base, border-radius()); | ||
border-bottom-right-radius: var(--p-border-radius-base, border-radius()); | ||
} | ||
} | ||
|
||
[data-buttongroup-connected-top] { | ||
> :first-child .Button { | ||
> :first-child .Button, | ||
> :first-child .Button::after { | ||
border-top-left-radius: 0; | ||
} | ||
|
||
> :last-child .Button { | ||
> :last-child .Button, | ||
> :last-child .Button::after { | ||
border-top-right-radius: 0; | ||
} | ||
} | ||
|
@@ -115,7 +126,7 @@ $stacking-order: ( | |
@include button-full-width; | ||
} | ||
} | ||
// stylelint-enable selector-max-combinators | ||
// stylelint-enable selector-max-combinators, selector-max-compound-selectors, selector-max-specificity | ||
.Content { | ||
@include text-style-button; | ||
position: relative; | ||
|
@@ -640,6 +651,10 @@ $stacking-order: ( | |
} | ||
} | ||
|
||
&:focus { | ||
box-shadow: 0 0 0 1px currentColor; | ||
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 actual bug fix for outline monochrome focus. |
||
} | ||
|
||
&.globalTheming { | ||
box-shadow: 0 0 0 border-width('base') currentColor; | ||
|
||
|
@@ -688,5 +703,10 @@ $stacking-order: ( | |
margin-left: rem(1px); | ||
border-top-left-radius: 0; | ||
border-bottom-left-radius: 0; | ||
|
||
&::after { | ||
border-top-left-radius: 0; | ||
border-bottom-left-radius: 0; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
@import '../../styles/common'; | ||
$control-size: rem(16px); | ||
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 wasn't being used 🤷♂ |
||
|
||
.Checkbox { | ||
position: relative; | ||
|
@@ -107,7 +106,7 @@ $control-size: rem(16px); | |
display: block; | ||
width: 100%; | ||
height: 100%; | ||
@include focus-ring($border-width: var(--control-border-width)); | ||
@include focus-ring($border-width: var(--p-control-border-width)); | ||
} | ||
|
||
.Icon { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,6 @@ | |
} | ||
|
||
.RadioButton.globalTheming { | ||
--control-border-width: #{rem(2px)}; | ||
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. moved this to tokens since it was was in 2 places |
||
--icon-size: #{rem(10px)}; | ||
margin: var(--p-choice-margin, 0); | ||
|
||
|
@@ -86,7 +85,7 @@ | |
display: block; | ||
width: 100%; | ||
height: 100%; | ||
border: var(--control-border-width) solid var(--p-border-secondary); | ||
border: var(--p-control-border-width) solid var(--p-border-secondary); | ||
border-radius: 50%; | ||
background-color: var(--p-surface); | ||
transition: border-color var(--p-duration-1-0-0) var(--p-ease); | ||
|
@@ -111,7 +110,7 @@ | |
background: ms-high-contrast-color('text'); | ||
} | ||
|
||
@include focus-ring($border-width: var(--control-border-width)); | ||
@include focus-ring($border-width: var(--p-control-border-width)); | ||
|
||
&::after { | ||
border-radius: 50%; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,10 @@ $chekbox-label-margin: rem(20px); | |
border-radius: border-radius(); | ||
box-shadow: none; | ||
background: transparent; | ||
// stylelint-disable-next-line selector-max-class | ||
&.globalTheming { | ||
border: none; | ||
} | ||
|
||
&:hover { | ||
background: transparent; | ||
|
@@ -100,6 +104,12 @@ $chekbox-label-margin: rem(20px); | |
height: $control-size; | ||
width: $control-size; | ||
margin-left: (-1 * (spacing(tight) + rem(1px))); // 1px accounts for border | ||
|
||
.globalTheming & { | ||
height: var(--p-choice-size); | ||
width: var(--p-choice-size); | ||
margin-left: calc(-1 * #{spacing(tight)} - var(--p-control-border-width)); | ||
} | ||
} | ||
|
||
.Label { | ||
|
@@ -111,4 +121,7 @@ $chekbox-label-margin: rem(20px); | |
text-overflow: ellipsis; | ||
// padding to fix the bottom of letters being cutoff by overflow: hidden | ||
padding: rem(1px) 0; | ||
.globalTheming & { | ||
margin-left: calc(#{$chekbox-label-margin} - var(--p-control-border-width)); | ||
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 was causing the checkbox to be misaligned |
||
} | ||
} |
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.
Easy peasy. I didn't bother adding the .globalTheming here because this doesn't impact the non-themable buttons.