diff --git a/README.md b/README.md index 8f9f056..a67e122 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,10 @@ _Minimum content sizing of flex items not honored_ - 1.1.abug
- 1.1.bworkaround
- 1.2.abug
- 1.2.bworkaround + 1.1.abug
+ 1.1.bworkaround
+ 1.2.abug
+ 1.2.bworkaround Chrome (fixed in 72)
@@ -84,8 +84,8 @@ _Column flex items set to `align-items: center` overflow their container_ - 2.1.abug
- 2.1.bworkaround + 2.1.abug
+ 2.1.bworkaround Internet Explorer 10-11 (fixed in Edge) @@ -115,10 +115,10 @@ _`min-height` on a flex container won't apply to its flex items_ - 3.1.abug
- 3.1.bworkaround
- 3.2.abug
- 3.2.bworkaround + 3.1.abug
+ 3.1.bworkaround
+ 3.2.abug
+ 3.2.bworkaround Internet Explorer 10-11 (fixed in Edge) IE #802625 @@ -131,9 +131,9 @@ In IE 10-11, `min-height` declarations on flex containers work to size the conta #### Workaround -By far the most common element to apply `min-height` to is the body element, and usually you're setting it to `100%` (or `100vh`). Since the body element will never have any content below it, and since having a vertical scroll bar appear when there's a lot of content on the page is usually the desired behavior, substituting `height` for `min-height` will almost always work as shown in demo [3.1.b](https://codepen.io/philipwalton/pen/KwNvLo). +By far the most common element to apply `min-height` to is the body element, and usually you're setting it to `100%` (or `100vh`). Since the body element will never have any content below it, and since having a vertical scroll bar appear when there's a lot of content on the page is usually the desired behavior, substituting `height` for `min-height` will almost always work as shown in demo [3.1.b](https://philipwalton.github.io/flexbugs/3.1.b-workaround.html). -For cases where `min-height` is required, the workaround is to add a wrapper element around the flex container that is itself a flex container in the column direction. For some reason nested flex containers are not affected by this bug. Demo [3.2.a](https://codepen.io/philipwalton/pen/VYmbmj) shows a visual design where `min-height` is required, and demo [3.2.b](https://codepen.io/philipwalton/pen/JdvdJE) shows how this bug can be avoided with a wrapper element. +For cases where `min-height` is required, the workaround is to add a wrapper element around the flex container that is itself a flex container in the column direction. For some reason nested flex containers are not affected by this bug. Demo [3.2.a](https://philipwalton.github.io/flexbugs/3.2.a-bug.html) shows a visual design where `min-height` is required, and demo [3.2.b](https://philipwalton.github.io/flexbugs/3.2.b-workaround.html) shows how this bug can be avoided with a wrapper element. @@ -150,8 +150,8 @@ _`flex` shorthand declarations with unitless `flex-basis` values are ignored_ - 4.1.abug
- 4.1.bworkaround + 4.1.abug
+ 4.1.bworkaround Internet Explorer 10-11 (fixed in Edge) @@ -184,8 +184,8 @@ _Column flex items don't always preserve intrinsic aspect ratios_ - 5.1.abug
- 5.1.bworkaround + 5.1.abug
+ 5.1.bworkaround Internet Explorer 10-11 (fixed in Edge) @@ -195,7 +195,7 @@ The [March 2014 spec](http://www.w3.org/TR/2014/WD-css-flexbox-1-20140325/#min-s > On a flex item whose overflow is not visible, this [auto] keyword specifies as the minimum size the smaller of: (a) the min-content size, or (b) the computed width/height, if that value is definite. -Demo [5.1.a](https://codepen.io/philipwalton/pen/LEbQON) contains an image whose height is 200 pixels and whose width is 500 pixels. Its container, however, is only 300 pixels wide, so after the image is scaled to fit into that space, its computed height should only be 120 pixels. The text quoted above does not make it clear as to whether the flex item's min-content size should be based the image's actual height or scaled height. +Demo [5.1.a](https://philipwalton.github.io/flexbugs/5.1.a-bug.html) contains an image whose height is 200 pixels and whose width is 500 pixels. Its container, however, is only 300 pixels wide, so after the image is scaled to fit into that space, its computed height should only be 120 pixels. The text quoted above does not make it clear as to whether the flex item's min-content size should be based the image's actual height or scaled height. The [most recent spec](http://dev.w3.org/csswg/css-flexbox/#min-size-auto) has resolved this ambiguity in favor of using sizes that will preserve an element's intrinsic aspect ratio. @@ -218,10 +218,10 @@ _The default `flex` value has changed_ - 6.1.abug
- 6.1.bworkaround
- 6.2.abug
- 6.2.bworkaround + 6.1.abug
+ 6.1.bworkaround
+ 6.2.abug
+ 6.2.bworkaround Internet Explorer 10 (fixed in 11) @@ -261,7 +261,7 @@ This bug can manifest itself in two ways: when not setting any flex values or wh #### Workaround -If you have to support IE 10, the best solution is to *always* set an explicit `flex-shrink` value on all of your flex items, or to always use the longhand form (rather than the shorthand) in `flex` declarations to avoid the gotchas shown in the table above. Demo [6.1.a](https://codepen.io/philipwalton/pen/myOYqW) shows how not setting any flexibility properties causes an error, and demo [6.2.a](https://codepen.io/philipwalton/pen/zvvQdB) shows how using `flex: 1` can have the same problem. +If you have to support IE 10, the best solution is to *always* set an explicit `flex-shrink` value on all of your flex items, or to always use the longhand form (rather than the shorthand) in `flex` declarations to avoid the gotchas shown in the table above. Demo [6.1.a](https://philipwalton.github.io/flexbugs/6.1.a-bug.html) shows how not setting any flexibility properties causes an error, and demo [6.2.a](https://philipwalton.github.io/flexbugs/6.2.a-bug.html) shows how using `flex: 1` can have the same problem. @@ -278,9 +278,9 @@ _`flex-basis` doesn't account for `box-sizing: border-box`_ - 7.1.abug
- 7.1.bworkaround
- 7.1.cworkaround + 7.1.abug
+ 7.1.bworkaround
+ 7.1.cworkaround Internet Explorer 10-11 (fixed in Edge) @@ -288,14 +288,14 @@ _`flex-basis` doesn't account for `box-sizing: border-box`_ An explicit `flex-basis` value (i.e., any value other than `auto`) is supposed to act just like `width` or `height`. It determines the initial size of a flex item and then the other flexibility properties allow it to grow or shrink accordingly. -IE 10-11 always assume a content box model when using `flex-basis` to determine a flex item's size, even if that item is set to `box-sizing: border-box`. Demo [7.1.a](https://codepen.io/philipwalton/pen/JoWjyb) shows that an item with a `flex-basis` value of `100%` will overflow its container by the amount of its border plus its padding. +IE 10-11 always assume a content box model when using `flex-basis` to determine a flex item's size, even if that item is set to `box-sizing: border-box`. Demo [7.1.a](https://philipwalton.github.io/flexbugs/7.1.a-bug.html) shows that an item with a `flex-basis` value of `100%` will overflow its container by the amount of its border plus its padding. #### Workaround There are two ways to work around this bug. The first requires no additional markup, but the second is slightly more flexible: -1. Instead of setting an explicit `flex-basis` value, use `auto`, and then set an explicit width or height. Demo [7.1.b](https://codepen.io/philipwalton/pen/XJMWem) shows this. -2. Use a wrapper element that contains no border or padding so it works with the content box model. Demo [7.1.c](https://codepen.io/philipwalton/pen/ZYLdqb) show this. +1. Instead of setting an explicit `flex-basis` value, use `auto`, and then set an explicit width or height. Demo [7.1.b](https://philipwalton.github.io/flexbugs/7.1.b-workaround.html) shows this. +2. Use a wrapper element that contains no border or padding so it works with the content box model. Demo [7.1.c](https://philipwalton.github.io/flexbugs/7.1.c-workaround.html) show this. @@ -312,29 +312,29 @@ _`flex-basis` doesn't support `calc()`_ - 8.1.abug
- 8.1.bworkaround + 8.1.abug
+ 8.1.bworkaround Internet Explorer 10-11 (fixed in Edge) - 8.2.abug
- 8.2.bworkaround + 8.2.abug
+ 8.2.bworkaround Internet Explorer 10 (fixed in 11) -IE 10-11 ignore `calc()` functions used in `flex` shorthand declarations. Demo [8.1.a](https://codepen.io/philipwalton/pen/ogBrye) shows `flex: 0 0 calc(100%/3)` not working in IE. +IE 10-11 ignore `calc()` functions used in `flex` shorthand declarations. Demo [8.1.a](https://philipwalton.github.io/flexbugs/8.1.a-bug.html) shows `flex: 0 0 calc(100%/3)` not working in IE. -In IE 10, `calc()` functions don't even work in longhand `flex-basis` declarations (though this does work in IE 11). Demo [8.2.a](https://codepen.io/philipwalton/pen/VYJgJo) shows `flex-basis: calc(100%/3)` not working in IE 10. +In IE 10, `calc()` functions don't even work in longhand `flex-basis` declarations (though this does work in IE 11). Demo [8.2.a](https://philipwalton.github.io/flexbugs/8.2.a-bug.html) shows `flex-basis: calc(100%/3)` not working in IE 10. #### Workaround -Since this bug only affects the `flex` shorthand declaration in IE 11, an easy workaround (if you only need to support IE 11) is to always specify each flexibility property individually. Demo [8.1.b](https://codepen.io/philipwalton/pen/bNgPKz) offers an example of this. +Since this bug only affects the `flex` shorthand declaration in IE 11, an easy workaround (if you only need to support IE 11) is to always specify each flexibility property individually. Demo [8.1.b](https://philipwalton.github.io/flexbugs/8.1.b-workaround.html) offers an example of this. -If you need to support IE 10 as well, then you'll need to fall back to setting `width` or `height` (depending on the container's `flex-direction` property). You can do this by setting a `flex-basis` value of `auto`, which will instruct the browser to use the element's [main size](http://dev.w3.org/csswg/css-flexbox/#box-model) property (i.e., its `width` or `height`). Demo [8.2.b](https://codepen.io/philipwalton/pen/pvXGmW) offers an example of this. +If you need to support IE 10 as well, then you'll need to fall back to setting `width` or `height` (depending on the container's `flex-direction` property). You can do this by setting a `flex-basis` value of `auto`, which will instruct the browser to use the element's [main size](http://dev.w3.org/csswg/css-flexbox/#box-model) property (i.e., its `width` or `height`). Demo [8.2.b](https://philipwalton.github.io/flexbugs/8.2.b-workaround.html) offers an example of this. @@ -352,11 +352,11 @@ _Some HTML elements can't be flex containers_ - 9.1.abug
- 9.1.bworkaround
- 9.2.abug
- 9.2.bworkaround
- 9.3.abug
+ 9.1.abug
+ 9.1.bworkaround
+ 9.2.abug
+ 9.2.bworkaround
+ 9.3.abug
Chrome
@@ -381,11 +381,11 @@ _Some HTML elements can't be flex containers_ Certain HTML elements, like ``, `
` and ` + + diff --git a/docs/9.1.b-workaround.html b/docs/9.1.b-workaround.html new file mode 100644 index 0000000..88b6410 --- /dev/null +++ b/docs/9.1.b-workaround.html @@ -0,0 +1,53 @@ + + + + + + Flexbug 9.1.b (workaround) + + + + + + + diff --git a/docs/9.2.a-bug.html b/docs/9.2.a-bug.html new file mode 100644 index 0000000..6301d7d --- /dev/null +++ b/docs/9.2.a-bug.html @@ -0,0 +1,54 @@ + + + + + + Flexbug 9.2.a (bug) + + + + +
+
+ +
+
+ +
+
+ +
+
+ + diff --git a/docs/9.2.b-workaround.html b/docs/9.2.b-workaround.html new file mode 100644 index 0000000..8b5c9f2 --- /dev/null +++ b/docs/9.2.b-workaround.html @@ -0,0 +1,56 @@ + + + + + + Flexbug 9.2.b (workaround) + + + + +
+
+
+ +
+
+ +
+
+ +
+
+
+ + diff --git a/docs/9.3.a-bug.html b/docs/9.3.a-bug.html new file mode 100644 index 0000000..94cabd7 --- /dev/null +++ b/docs/9.3.a-bug.html @@ -0,0 +1,54 @@ + + + + + + Flexbug 9.3.a (bug) + + + + + +
+ these elements +
+
+ shouldn't be +
+
+ stacked vertically +
+
+ + diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..e42b4df --- /dev/null +++ b/docs/README.md @@ -0,0 +1,5 @@ +## Flexbugs Static Files + +This folder primarily houses static html files containing [bugs and their workarounds](https://github.com/philipwalton/flexbugs#the-bugs-and-their-workarounds) for hosting on GitHub pages. You can view their source code in this folder [here](https://github.com/philipwalton/flexbugs/tree/master/docs). + +In order to ensure that the original documentation stays on GitHub [README](https://github.com/philipwalton/flexbugs#flexbugs) (and not on GitHub pages), absolute links have been used (instead of relative links) wherever applicable. diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 0000000..c741881 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-slate \ No newline at end of file