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

feat(theme): add box-sizing to the global styles (Teams theme) #1057

Merged
merged 20 commits into from
Apr 15, 2019

Conversation

mnajdova
Copy link
Contributor

@mnajdova mnajdova commented Mar 13, 2019

This PR adds the box-sizing: border-box to all elements, as well before and auto pseudo elements in teams theme, by providing a rule in the global styles. Parts of the styles of the components, had to be updated. We can still see some screener differences, but I see these as fixes, rather then regressions. @codepretty @bcalvery @notandrew let me know what you think.

BREAKING CHANGES:

The `box-sizing: border-box' prop is added for all elements, so check for regressions to all components that has style overrides affecting the size of the components, or adding paddings and margings of the elements.

@codecov
Copy link

codecov bot commented Mar 13, 2019

Codecov Report

Merging #1057 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1057   +/-   ##
=======================================
  Coverage   82.56%   82.56%           
=======================================
  Files         752      752           
  Lines        8859     8859           
  Branches     1178     1178           
=======================================
  Hits         7314     7314           
  Misses       1530     1530           
  Partials       15       15
Impacted Files Coverage Δ
...t/src/themes/teams/components/Alert/alertStyles.ts 12.5% <ø> (ø) ⬆️
...themes/teams/components/Dropdown/dropdownStyles.ts 20% <ø> (ø) ⬆️
...src/themes/teams/components/Status/statusStyles.ts 14.28% <ø> (ø) ⬆️
...t/src/themes/teams/components/Video/videoStyles.ts 33.33% <ø> (ø) ⬆️
...eams/components/RadioGroup/radioGroupItemStyles.ts 28.57% <ø> (ø) ⬆️
...es/teams/components/Attachment/attachmentStyles.ts 30.76% <ø> (ø) ⬆️
...t/src/themes/teams/components/Input/inputStyles.ts 8.33% <ø> (ø) ⬆️
...eact/src/themes/teams/staticStyles/globalStyles.ts 100% <ø> (ø) ⬆️
...mes/teams/components/Dropdown/dropdownVariables.ts 100% <ø> (ø) ⬆️
...t/src/themes/teams/components/Embed/embedStyles.ts 37.5% <ø> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f75141e...463cc66. Read the comment docs.

@mnajdova mnajdova changed the title [wip]: add box-sizing to the normalizeCSS [wip]: add box-sizing to the global styles (teams theme) Mar 14, 2019
@mnajdova mnajdova changed the title [wip]: add box-sizing to the global styles (teams theme) feat(theme): add box-sizing to the global styles (Teams theme) Mar 14, 2019
@notandrew notandrew self-assigned this Mar 15, 2019
@layershifter layershifter mentioned this pull request Mar 18, 2019
@bmdalex
Copy link
Collaborator

bmdalex commented Mar 18, 2019

pls remove boxSizing style in alertStyles.ts before merging: see #1063 (comment)

listBackgroundColor: siteVars.colors.white,
listBorderRadius: _3px_asRem,
listPadding: `${pxToRem(8)} 0`,
listBoxShadow: `0 .2rem .6rem 0 ${siteVars.gray06}`,
listMaxHeight: '20rem',
listMaxHeight: pxToRem(296),
Copy link
Member

Choose a reason for hiding this comment

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

just curious how 20rem became 296px?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So previously on the Dropdown list, we had padding on the top and 6 elements in the list (one list item has height of 48px) => (6*48px) + 8px = 296px :) We don't want to use rem anyway and the height was a bit different because of the box-sizing, so that is why I converted it to px.

CHANGELOG.md Outdated Show resolved Hide resolved
@mnajdova mnajdova merged commit 995b954 into master Apr 15, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/add-box-sizing-in-global-styles branch April 15, 2019 07:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants