Skip to content

Commit

Permalink
Fix html/body/root normalization on height (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatoBeltran authored May 17, 2021
1 parent 856cc4f commit a6ad4df
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# CHANGELOG

## v8.1.7
## v8.1.9
## Fixed
- Make HTML be the only one to take available space, all the other elements take 100%.
- Include nextjs root element in normalize CSS for react root.

## v8.1.8
### Changed
- Fixed app height on webkit based browsers to take all available space instead of 100vh

Expand Down Expand Up @@ -139,11 +144,11 @@

## v5.0.2
### Changed
- reverted changes on color background input for dark-theme
- reverted changes on color background input for dark-theme

## v5.0.1
### Changed
- changed to transparent the color background on input for dark-theme
- changed to transparent the color background on input for dark-theme

## v5.0.0
### Changed
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@microsoft/azure-iot-ux-fluent-css",
"description": "Azure IoT common styles library for CSS, Colors and Themes",
"version": "8.1.8",
"version": "8.1.9",
"license": "MIT",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
32 changes: 21 additions & 11 deletions src/_normalize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@

:global {
:root {
// Fix webkit mobile bug with handling 100vh hiding it over the sticky browser footer
height: -webkit-fill-available;
// Safari correctly handles `height: 100%` on the html element to the whole viewport height,
// but it doesn't for the body or root element, so we use it here, and then use flex
// to size everything correctly. This approach will guarantee that all browsers fill
// the entire viewport in the same way with html, body and app root
height: 100%;
display: flex;
flex-direction: column;
}

body {
height: 100vh;
height: -webkit-fill-available;
flex: 1;
min-height: 100%;
display: flex;
flex-direction: column;

margin: 0;
padding: 0;
Expand All @@ -33,14 +40,17 @@
color: var(--color-foreground-default);
}

#root {
height: 100%;
height: -webkit-fill-available;

// Ensure that the root of the React app uses the full page height
// We use an attribute selector rather than #__next, because CSS IDs may not
// begin with an underscore.
[id="root"], [id="__next"] {
flex: 1;
min-height: 100%;

// Set positioning to relative so that everything flows from shell
position: relative;

// Flex will help us position the masthead and workspace to take the full height of the
// Flex will help us position the masthead and workspace to take the full height of the
// viewport correctly
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -221,11 +231,11 @@
outline: 1px solid var(--color-foreground-inactive);
outline-offset: -1px;
}

&:focus:not(:focus-visible) {
outline: 0;
}

&:focus-visible {
outline: 1px solid var(--color-foreground-inactive);
outline-offset: -1px;
Expand Down

0 comments on commit a6ad4df

Please sign in to comment.