Skip to content

Commit

Permalink
fix(component): change checkbox margin and box sizing (#646)
Browse files Browse the repository at this point in the history
Co-authored-by: Stanislav Holts <[email protected]>
  • Loading branch information
bc-alexsaiannyi and golcinho authored Nov 5, 2021
1 parent 7662b8e commit 3c9ac79
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ exports[`render Checkbox checked 1`] = `
-ms-flex-align: center;
align-items: center;
background: #3C64F4;
box-sizing: border-box;
border: 1px solid #D9DCE9;
border-color: #3C64F4;
border-radius: 0.25rem;
Expand All @@ -75,8 +76,8 @@ exports[`render Checkbox checked 1`] = `
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-bottom: 0.0625rem;
margin-top: 0.0625rem;
margin-bottom: 0.125rem;
margin-top: 0.125rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down Expand Up @@ -207,6 +208,7 @@ exports[`render Checkbox disabled checked 1`] = `
-ms-flex-align: center;
align-items: center;
background: #3C64F4;
box-sizing: border-box;
border: 1px solid #D9DCE9;
border-color: #3C64F4;
border-radius: 0.25rem;
Expand All @@ -221,8 +223,8 @@ exports[`render Checkbox disabled checked 1`] = `
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-bottom: 0.0625rem;
margin-top: 0.0625rem;
margin-bottom: 0.125rem;
margin-top: 0.125rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down Expand Up @@ -356,6 +358,7 @@ exports[`render Checkbox disabled indeterminate 1`] = `
-ms-flex-align: center;
align-items: center;
background: #3C64F4;
box-sizing: border-box;
border: 1px solid #D9DCE9;
border-color: #3C64F4;
border-radius: 0.25rem;
Expand All @@ -370,8 +373,8 @@ exports[`render Checkbox disabled indeterminate 1`] = `
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-bottom: 0.0625rem;
margin-top: 0.0625rem;
margin-bottom: 0.125rem;
margin-top: 0.125rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down Expand Up @@ -503,6 +506,7 @@ exports[`render Checkbox disabled unchecked 1`] = `
-ms-flex-align: center;
align-items: center;
background: #FFFFFF;
box-sizing: border-box;
border: 1px solid #D9DCE9;
border-color: #D9DCE9;
border-radius: 0.25rem;
Expand All @@ -517,8 +521,8 @@ exports[`render Checkbox disabled unchecked 1`] = `
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-bottom: 0.0625rem;
margin-top: 0.0625rem;
margin-bottom: 0.125rem;
margin-top: 0.125rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down Expand Up @@ -650,6 +654,7 @@ exports[`render Checkbox indeterminate 1`] = `
-ms-flex-align: center;
align-items: center;
background: #3C64F4;
box-sizing: border-box;
border: 1px solid #D9DCE9;
border-color: #3C64F4;
border-radius: 0.25rem;
Expand All @@ -664,8 +669,8 @@ exports[`render Checkbox indeterminate 1`] = `
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-bottom: 0.0625rem;
margin-top: 0.0625rem;
margin-bottom: 0.125rem;
margin-top: 0.125rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down Expand Up @@ -793,6 +798,7 @@ exports[`render Checkbox unchecked 1`] = `
-ms-flex-align: center;
align-items: center;
background: #FFFFFF;
box-sizing: border-box;
border: 1px solid #D9DCE9;
border-color: #D9DCE9;
border-radius: 0.25rem;
Expand All @@ -807,8 +813,8 @@ exports[`render Checkbox unchecked 1`] = `
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-bottom: 0.0625rem;
margin-top: 0.0625rem;
margin-bottom: 0.125rem;
margin-top: 0.125rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down Expand Up @@ -976,6 +982,7 @@ exports[`render Checkbox with description object 1`] = `
-ms-flex-align: center;
align-items: center;
background: #FFFFFF;
box-sizing: border-box;
border: 1px solid #D9DCE9;
border-color: #D9DCE9;
border-radius: 0.25rem;
Expand All @@ -990,8 +997,8 @@ exports[`render Checkbox with description object 1`] = `
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-bottom: 0.0625rem;
margin-top: 0.0625rem;
margin-bottom: 0.125rem;
margin-top: 0.125rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down Expand Up @@ -1148,6 +1155,7 @@ exports[`render Checkbox with description string 1`] = `
-ms-flex-align: center;
align-items: center;
background: #FFFFFF;
box-sizing: border-box;
border: 1px solid #D9DCE9;
border-color: #D9DCE9;
border-radius: 0.25rem;
Expand All @@ -1162,8 +1170,8 @@ exports[`render Checkbox with description string 1`] = `
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-bottom: 0.0625rem;
margin-top: 0.0625rem;
margin-bottom: 0.125rem;
margin-top: 0.125rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down
5 changes: 3 additions & 2 deletions packages/big-design/src/components/Checkbox/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const StyledCheckbox = styled.label<StyledCheckboxProps>`
align-items: center;
background: ${({ checked, isIndeterminate, theme }) =>
checked || isIndeterminate ? theme.colors.primary : theme.colors.white};
box-sizing: border-box;
border: ${({ theme }) => theme.border.box};
border-color: ${({ checked, isIndeterminate, theme }) =>
checked || isIndeterminate ? theme.colors.primary : theme.colors.secondary30};
Expand All @@ -43,8 +44,8 @@ export const StyledCheckbox = styled.label<StyledCheckboxProps>`
display: inline-flex;
height: ${({ theme }) => theme.spacing.large};
justify-content: center;
margin-bottom: ${({ theme }) => theme.helpers.remCalc(1)};
margin-top: ${({ theme }) => theme.helpers.remCalc(1)};
margin-bottom: ${({ theme }) => theme.helpers.remCalc(2)};
margin-top: ${({ theme }) => theme.helpers.remCalc(2)};
user-select: none;
width: ${({ theme }) => theme.spacing.large};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ exports[`selectable renders selectable actions and checkboxes 1`] = `
-ms-flex-align: center;
align-items: center;
background: #FFFFFF;
box-sizing: border-box;
border: 1px solid #D9DCE9;
border-color: #D9DCE9;
border-radius: 0.25rem;
Expand All @@ -886,8 +887,8 @@ exports[`selectable renders selectable actions and checkboxes 1`] = `
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-bottom: 0.0625rem;
margin-top: 0.0625rem;
margin-bottom: 0.125rem;
margin-top: 0.125rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ exports[`renders worksheet 1`] = `
/>
<label
aria-hidden="true"
class="styled__StyledCheckbox-sc-s1u0st-3 hMHbNJ"
class="styled__StyledCheckbox-sc-s1u0st-3 hDRNJM"
for="bd-checkbox-1"
>
<svg
Expand Down Expand Up @@ -206,7 +206,7 @@ exports[`renders worksheet 1`] = `
/>
<label
aria-hidden="true"
class="styled__StyledCheckbox-sc-s1u0st-3 hMHbNJ"
class="styled__StyledCheckbox-sc-s1u0st-3 hDRNJM"
for="bd-checkbox-4"
>
<svg
Expand Down Expand Up @@ -335,7 +335,7 @@ exports[`renders worksheet 1`] = `
/>
<label
aria-hidden="true"
class="styled__StyledCheckbox-sc-s1u0st-3 ijngYq"
class="styled__StyledCheckbox-sc-s1u0st-3 hxYgxP"
for="bd-checkbox-7"
>
<svg
Expand Down Expand Up @@ -465,7 +465,7 @@ exports[`renders worksheet 1`] = `
/>
<label
aria-hidden="true"
class="styled__StyledCheckbox-sc-s1u0st-3 hMHbNJ"
class="styled__StyledCheckbox-sc-s1u0st-3 hDRNJM"
for="bd-checkbox-10"
>
<svg
Expand Down Expand Up @@ -593,7 +593,7 @@ exports[`renders worksheet 1`] = `
/>
<label
aria-hidden="true"
class="styled__StyledCheckbox-sc-s1u0st-3 hMHbNJ"
class="styled__StyledCheckbox-sc-s1u0st-3 hDRNJM"
for="bd-checkbox-13"
>
<svg
Expand Down Expand Up @@ -723,7 +723,7 @@ exports[`renders worksheet 1`] = `
/>
<label
aria-hidden="true"
class="styled__StyledCheckbox-sc-s1u0st-3 hMHbNJ"
class="styled__StyledCheckbox-sc-s1u0st-3 hDRNJM"
for="bd-checkbox-16"
>
<svg
Expand Down Expand Up @@ -852,7 +852,7 @@ exports[`renders worksheet 1`] = `
/>
<label
aria-hidden="true"
class="styled__StyledCheckbox-sc-s1u0st-3 ijngYq"
class="styled__StyledCheckbox-sc-s1u0st-3 hxYgxP"
for="bd-checkbox-19"
>
<svg
Expand Down Expand Up @@ -982,7 +982,7 @@ exports[`renders worksheet 1`] = `
/>
<label
aria-hidden="true"
class="styled__StyledCheckbox-sc-s1u0st-3 hMHbNJ"
class="styled__StyledCheckbox-sc-s1u0st-3 hDRNJM"
for="bd-checkbox-22"
>
<svg
Expand Down Expand Up @@ -1112,7 +1112,7 @@ exports[`renders worksheet 1`] = `
/>
<label
aria-hidden="true"
class="styled__StyledCheckbox-sc-s1u0st-3 hMHbNJ"
class="styled__StyledCheckbox-sc-s1u0st-3 hDRNJM"
for="bd-checkbox-25"
>
<svg
Expand Down

0 comments on commit 3c9ac79

Please sign in to comment.