Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 995b954

Browse files
authored
feat(theme): add box-sizing to the global styles (Teams theme) (#1057)
* -added border-box in the global styles * -updated icon styles * -fixed dropdown styles * -moved styles to globalStyles * -removed unnecessary box sizing styles * -updates changelog * -reverted loader styles form base theme * -updated changelog * -removed unnecessary border-box styles * -changed changelog -moved content-box for font icons near the width and height props * -reverted border-box in loader styles * -updates on the box sizing prop * -fixed changelog entry * -removed boxSizing: 'border-box' to video and embed styles in Teams theme * -reverted boxSizing: 'border-box' on imageStyles, as it was moved in base theme
1 parent f75141e commit 995b954

File tree

13 files changed

+14
-25
lines changed

13 files changed

+14
-25
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1717

1818
## [Unreleased]
1919

20+
### BREAKING CHANGES
21+
- Add `box-sizing: border-box` to all elements, as well as before and after pseudo elements in Teams theme @mnajdova ([#1057](https://github.com/stardust-ui/react/pull/1057))
22+
2023
### Fixes
2124
- Fix overflowing focus outline for `Grid` items for Teams theme @Bugaa92 ([#1195](https://github.com/stardust-ui/react/pull/1195))
2225
- Fix routing for accessibility documentation @sophieH29 ([#1208](https://github.com/stardust-ui/react/pull/1208))

docs/src/prototypes/chatPane/composeMessage.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ const getInputWrapperStyles = ({ attached }: ComposeMessageProps): React.CSSProp
5757
const borderWidth = '1px'
5858

5959
return {
60-
boxSizing: 'border-box',
6160
borderStyle: 'solid',
6261
borderWidth,
6362
borderRadius: `${borderTopRadius} ${borderTopRadius} ${borderBottomRadius} ${borderBottomRadius}`,

packages/react/src/themes/teams/components/Alert/alertStyles.ts

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ const alertStyles: ComponentSlotStylesInput<AlertProps, AlertVariables> = {
6161
alignItems: 'center',
6262
position: 'relative',
6363
width: '100%',
64-
boxSizing: 'border-box',
6564
borderStyle: v.borderStyle,
6665
borderWidth: v.borderWidth,
6766
borderRadius: v.borderRadius,

packages/react/src/themes/teams/components/Attachment/attachmentStyles.ts

-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ const attachmentStyles: ComponentSlotStylesInput<AttachmentProps, AttachmentVari
2424

2525
outline: 0,
2626

27-
// todo: remove when #1057 to make box-sizing global is checked in
28-
boxSizing: 'border-box',
29-
'& *': {
30-
boxSizing: `border-box`,
31-
},
32-
3327
...(p.isFromKeyboard && {
3428
':focus': {
3529
borderColor: v.focusInnerBorderColor,

packages/react/src/themes/teams/components/Avatar/avatarStyles.ts

-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const avatarStyles: ComponentSlotStylesInput<AvatarProps, any> = {
1717
const sizeInRem = pxToRem(sizeToPxValue[size])
1818

1919
return {
20-
boxSizing: 'border-box',
2120
position: 'relative',
2221
backgroundColor: 'inherit',
2322
display: 'inline-block',
@@ -27,7 +26,6 @@ const avatarStyles: ComponentSlotStylesInput<AvatarProps, any> = {
2726
}
2827
},
2928
image: ({ variables: v }): ICSSInJSStyle => ({
30-
boxSizing: 'border-box',
3129
borderColor: v.avatarBorderColor,
3230
borderStyle: 'solid',
3331
borderWidth: `${v.avatarBorderWidth}px`,
@@ -40,7 +38,6 @@ const avatarStyles: ComponentSlotStylesInput<AvatarProps, any> = {
4038
label: ({ props: { size } }): ICSSInJSStyle => {
4139
const sizeInRem = pxToRem(sizeToPxValue[size])
4240
return {
43-
boxSizing: 'border-box',
4441
display: 'inline-block',
4542
width: sizeInRem,
4643
height: sizeInRem,

packages/react/src/themes/teams/components/Dropdown/dropdownStyles.ts

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ const dropdownStyles: ComponentSlotStylesInput<DropdownPropsAndState, DropdownVa
6464
display: 'flex',
6565
flexWrap: 'wrap',
6666
position: 'relative',
67-
boxSizing: 'border-box',
6867
borderStyle: 'solid',
6968
borderColor: 'transparent',
7069
outline: 0,

packages/react/src/themes/teams/components/Dropdown/dropdownVariables.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ export default (siteVars): DropdownVariables => ({
3030
borderWidth: `0 0 ${pxToRem(2)} 0`,
3131
color: siteVars.bodyColor,
3232
comboboxPaddingButton: `0 ${_12px_asRem}`,
33-
comboboxFlexBasis: '50px',
33+
comboboxFlexBasis: pxToRem(50),
3434
listBackgroundColor: siteVars.colors.white,
3535
listBorderRadius: _3px_asRem,
3636
listPadding: `${pxToRem(8)} 0`,
3737
listBoxShadow: `0 .2rem .6rem 0 ${siteVars.gray06}`,
38-
listMaxHeight: '20rem',
38+
listMaxHeight: pxToRem(296),
3939
listItemBackgroundColor: siteVars.colors.white,
4040
listItemBackgroundColorActive: siteVars.colors.primary[500],
4141
listItemColorActive: siteVars.colors.white,

packages/react/src/themes/teams/components/Embed/embedStyles.ts

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { EmbedVariables } from './embedVariables'
66
export default {
77
root: ({ props: p, variables: v }): ICSSInJSStyle => {
88
return {
9-
boxSizing: 'border-box',
109
display: 'inline-block',
1110
verticalAlign: 'middle',
1211
position: 'relative',

packages/react/src/themes/teams/components/Input/inputStyles.ts

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const inputStyles: ComponentSlotStylesInput<InputProps, InputVariables> = {
1414

1515
input: ({ props: p, variables: v }): ICSSInJSStyle => ({
1616
outline: 0,
17-
boxSizing: 'border-box',
1817
borderStyle: 'solid',
1918
borderColor: 'transparent',
2019
borderWidth: v.borderWidth,

packages/react/src/themes/teams/components/RadioGroup/radioGroupItemStyles.ts

-7
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ const radioStyles: ComponentSlotStylesInput<
2424
RadioGroupItemVariables
2525
> = {
2626
root: ({ props: p, variables: v }): ICSSInJSStyle => ({
27-
// can remove this after global style for border-box goes in
28-
boxSizing: 'border-box',
29-
3027
alignItems: 'center',
3128
borderStyle: 'solid',
3229
borderWidth: `${pxToRem(1)}`,
@@ -69,10 +66,6 @@ const radioStyles: ComponentSlotStylesInput<
6966
// overrides from icon styles
7067
backgroundColor: 'transparent',
7168
boxShadow: 'none',
72-
73-
// can remove this after global style for border-box goes in
74-
boxSizing: 'border-box',
75-
7669
borderStyle: 'solid',
7770
borderWidth: `${pxToRem(1)}`,
7871
borderColor: 'currentColor',

packages/react/src/themes/teams/components/Status/statusStyles.ts

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export const getSizeStyles = (sizeInPx: number, variables: StatusVariables) => {
5858
const statusStyles: ComponentSlotStylesInput<StatusProps, StatusVariables> = {
5959
root: ({ props: { color, size, state }, variables }): ICSSInJSStyle => {
6060
return {
61-
boxSizing: 'border-box',
6261
display: 'inline-flex',
6362
alignItems: 'center',
6463
justifyContent: 'center',

packages/react/src/themes/teams/components/Video/videoStyles.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { VideoVariables } from './videoVariables'
44

55
export default {
66
root: ({ variables: v }): ICSSInJSStyle => ({
7-
boxSizing: 'border-box',
87
display: 'inline-block',
98
verticalAlign: 'middle',
109
width: v.width,

packages/react/src/themes/teams/staticStyles/globalStyles.ts

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ const globalStyles: StaticStyleFunction = siteVars => ({
88
fontSize: siteVars.bodyFontSize,
99
lineHeight: siteVars.bodyLineHeight,
1010
},
11+
'*': {
12+
boxSizing: 'border-box',
13+
},
14+
'*:before': {
15+
boxSizing: 'border-box',
16+
},
17+
'*:after': {
18+
boxSizing: 'border-box',
19+
},
1120
})
1221

1322
export default globalStyles

0 commit comments

Comments
 (0)