HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URL's added here will be added as <link>
s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
If the stylesheet you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
mixin container(className, float)
.container(class=className)
.item.foo(class=float ? 'block-item' : 'flex-item')
span.item-width
span.text
.item.bar(class=float ? 'block-item' : 'flex-item')
span.item-width
span.text
.item.baz(class=float ? 'block-item' : 'flex-item')
span.item-width
span.text
.wrapper
- var i = 0
.measure
while i < 36
.unit
- i++
span.desc
| block & float
br
span.ok
| 60 + 120 + 180
+container('block-container', true)
span.desc
| flex-grow 1:2:3 & width auto
br
| 360 - (40 + 40 + 40) = 240
br
| (40 + 1/6 * 240) + (40 + 2/6 * 240) + (40 + 3/6 * 240)
br
span.ok
| 80 + 120 + 160
+container('flex-grow-container-widthauto')
span.desc
| flex-grow 1:2:3 & width auto & padding 20
br
| 360 - (80 + 80 + 80) = 120
br
| (80 + 1/6 * 120) + (80 + 2/6 * 120) + (80 + 3/6 * 120)
br
span.ok
| 100 + 120 + 140
+container('flex-grow-container-widthauto-padding20')
span.desc
| flex-grow 1:2:3 & width auto & margin 20
br
| 360 - (80 + 80 + 80) = 240
br
| (80 + 1/6 * 240) + (80 + 2/6 * 240) + (80 + 3/6 * 240)
br
span.ok
| 60 + 80 + 100 + (margin 120)
+container('flex-grow-container-widthauto-margin20')
span.desc
| flex-grow 1:2:3 & basis 0
br
| 360 - (0 + 0 + 0) = 360
br
| (0 + 1/6 * 360) + (0 + 2/6 * 360) + (0 + 3/6 * 360)
br
span.ok
| 60 + 120 + 180
+container('flex-grow-container-basis0')
span.desc
| flex-grow 1:5:6 & basis 0
br
| 360 - (0 + 0 + 0) = 360
br
| (0 + 1/12 * 360) + (0 + 5/12 * 360) + (0 + 6/12 * 360)
br
span.warn 30 + 150 + 180 [IE11]
br
| (40-10) + (150) + (180)
br
| (40) + (0 + 5/11 * 320) + (0 + 6/11 * 320)
br
span.warn 40 + 145.4545... + 174.5454... [Chrome, Firefox, Safari, Edge]
+container('flex-grow-container-basis0-1_5_6')
span.desc
| flex-grow 1:2:3 & basis 0 & content 80
br
| 360 - (0 + 0 + 0) = 360
br
| (0 + 1/6 * 360) + (0 + 2/6 * 360) + (0 + 3/6 * 360)
br
span.warn 60 + 120 + 180 [IE11]
br
| (80-20) + (120) + (180)
br
| (80) + (0 + 2/5 * 280) + (0 + 3/5 * 280)
br
span.warn 80 + 112 + 168 [Chrome, Firefox, Safari, Edge]
+container('flex-grow-container-basis0-content80')
span.desc
| flex-grow 1:2:3 & basis 0 & content 120
br
| 360 - (0 + 0 + 0) = 360
br
| (0 + 1/6 * 360) + (0 + 2/6 * 360) + (0 + 3/6 * 360)
br
span.warn 60 + 120 + 180 [IE11]
br
| (120-60) + (120) + (180)
br
| (120) + (0 + 2/5 * 240) + (0 + 3/5 * 240)
br
| (120) + (96) + (144)
br
| (120) + (120 - 24) + (144)
br
span.warn 120 + 120 + 120 [Chrome, Firefox, Safari, Edge]
+container('flex-grow-container-basis0-content120')
span.desc
| flex-grow 1:2:3 & basis 0 & content 160
br
| 360 - (0 + 0 + 0) = 360
br
| (0 + 1/6 * 360) + (0 + 2/6 * 360) + (0 + 3/6 * 360)
br
span.warn 60 + 120 + 180 [IE11]
br
| (160-100) + (160-40) + (180)
br
| (160) + (160) + (180-140)
br
span.warn 160 + 160 + 160 [Chrome, Firefox, Safari, Edge]
+container('flex-grow-container-basis0-content160')
span.desc
| flex-grow 1:2:3 & width 0
br
| 360 - (0 + 0 + 0) = 360
br
| (0 + 1/6 * 360) + (0 + 2/6 * 360) + (0 + 3/6 * 360)
br
span.ok
| 60 + 120 + 180
+container('flex-grow-container-width0')
span.desc
| flex-grow 1:5:6 & width 0
br
| 360 - (0 + 0 + 0) = 360
br
| (0 + 1/12 * 360) + (0 + 5/12 * 360) + (0 + 6/12 * 360)
br
span.ok 30 + 150 + 180
+container('flex-grow-container-width-1_5_6')
span.desc
| flex-grow 1:2:3 & width 0 & content 80
br
| 360 - (0 + 0 + 0) = 360
br
| (0 + 1/6 * 360) + (0 + 2/6 * 360) + (0 + 3/6 * 360)
br
span.ok 60 + 120 + 180
+container('flex-grow-container-width0-content80')
span.desc
| flex-grow 1:2:3 & width 0 & content 120
br
| 360 - (0 + 0 + 0) = 360
br
| (0 + 1/6 * 360) + (0 + 2/6 * 360) + (0 + 3/6 * 360)
br
span.ok 60 + 120 + 180
+container('flex-grow-container-width0-content120')
span.desc
| flex-grow 1:2:3 & width 0 & content 160
br
| 360 - (0 + 0 + 0) = 360
br
| (0 + 1/6 * 360) + (0 + 2/6 * 360) + (0 + 3/6 * 360)
br
span.ok 60 + 120 + 180
+container('flex-grow-container-width0-content160')
span.desc
| flex-grow 1:2:3 & width 0 & padding 20
br
| 360 - (40 + 40 + 40) = 240
br
| (40 + 1/6 * 240) + (40 + 2/6 * 240) + (40 + 3/6 * 240)
br
span.ok
| 80 + 120 + 160
+container('flex-grow-container-width0-padding20')
span.desc
| flex-grow 1:2:3 & width 0 & margin 20
br
| 360 - (40 + 40 + 40) = 240
br
| (40 + 1/6 * 240) + (40 + 2/6 * 240) + (40 + 3/6 * 240)
br
span.ok
| 40 + 80 + 120 + (margin 120)
+container('flex-grow-container-width0-margin20')
span.desc
| block & float
br
span.ok
| 120 + 120 + 120
+container('block-container-120', true)
span.desc
| flex-shrink 1:2:3 & basis 160
br
| 360 - (160 + 160 + 160) = -120
br
| (160 - 1/6 * 120) + (160 - 2/6 * 120) + (160 - 3/6 * 120)
br
span.ok
| 140 + 120 + 100
+container('flex-shrink-container-basis160')
span.desc
| flex-shrink 1:2:3 & basis 200
br
| 360 - (200 + 200 + 200) = -240
br
| (200 - 1/6 * 240) + (200 - 2/6 * 240) + (200 - 3/6 * 240)
br
span.ok
| 160 + 120 + 80
+container('flex-shrink-container-basis200')
span.desc
| flex-shrink 1:2:3 & basis 360
br
| 360 - (360 + 360 + 360) = -720
br
| (360 - 1/6 * 720) + (360 - 2/6 * 720) + (360 - 3/6 * 720)
br
span.warn 240 + 120 + 0 [IE11]
br
| (240) + (120) + (40-40)
br
| (240 - 1/3 * 40) + (120 - 2/3 * 40) + (40)
br
sapn.warn 226.6666... + 93.3333... + 40 [Chrome, Firefox, Safari, Edge]
+container('flex-shrink-container-basis360')
span.desc
| flex-shrink 1:2:3 & basis 360 & min-width 0
br
| 360 - (360 + 360 + 360) = -720
br
| (360 - 1/6 * 720) + (360 - 2/6 * 720) + (360 - 3/6 * 720)
br
span.ok 240 + 120 + 0
+container('flex-shrink-container-basis360-minwidth0')
span.desc
| flex-shrink 1:2:3 & width 160
br
| 360 - (160 + 160 + 160) = -120
br
| (160 - 1/6 * 120) + (160 - 2/6 * 120) + (160 - 3/6 * 120)
br
span.ok
| 140 + 120 + 100
+container('flex-shrink-container-width160')
span.desc
| flex-shrink 1:2:3 & width 200
br
| 360 - (200 + 200 + 200) = -240
br
| (200 - 1/6 * 240) + (200 - 2/6 * 240) + (200 - 3/6 * 240)
br
span.ok
| 160 + 120 + 80
+container('flex-shrink-container-width200')
span.desc
| flex-shrink 1:2:3 & width 360
br
| 360 - (360 + 360 + 360) = -720
br
| (360 - 1/6 * 720) + (360 - 2/6 * 720) + (360 - 3/6 * 720)
br
span.warn 240 + 120 + 0 [IE11]
br
| (240) + (120) + (40-40)
br
| (240 - 1/3 * 40) + (120 - 2/3 * 40) + (40)
br
sapn.warn 226.6666... + 93.3333... + 40 [Chrome, Firefox, Safari, Edge]
+container('flex-shrink-container-width360')
span.desc
| flex-shrink 1:2:3 & width 360 & min-width 0
br
| 360 - (360 + 360 + 360) = -720
br
| (360 - 1/6 * 720) + (360 - 2/6 * 720) + (360 - 3/6 * 720)
br
span.ok 240 + 120 + 0
+container('flex-shrink-container-width360-minwidth0')
span.desc
| flex-shrink 1:2:3 & basis 160 & padding 20
br
| 360 - (200 + 200 + 200) = -240
br
| (200 - 1/6 * 240) + (200 - 2/6 * 240) + (200 - 3/6 * 240)
br
span.ok
| 160 + 120 + 80
+container('flex-shrink-container-basis160-padding20')
span.desc
| flex-shrink 1:2:3 & basis 160 & margin 20
br
| 360 - (200 + 200 + 200) = -240
br
| (200 - 1/6 * 240) + (200 - 2/6 * 240) + (200 - 3/6 * 240)
br
span.ok
| 120 + 80 + 40 + (margin 120)
+container('flex-shrink-container-basis160-margin20')
span.desc
| flex-shrink 1:2:3 & basis 160 & padding 40
br
| 360 - (240 + 240 + 240) = -360
br
| (240 - 1/6 * 360) + (240 - 2/6 * 360) + (240 - 3/6 * 360)
br
| (180) + (120) + (60)
br
| (180) + (120) + (120-60) #[span.warn |] (180) + (120) + (80 - 20)
br
| (180-60) + (120) + (120) #[span.warn |] (180 - 1/3 * 20) + (120 - 2/3 * 20)
br
span.warn
|120 + 120 + 120 [Chrome, Firefox, Safari, Edge]
br
| 173.3333... + 106.6666... + 80 [IE11]
+container('flex-shrink-container-basis160-padding40')
span.desc
| flex-shrink 1:2:3 & basis 160 & padding 40 & min-width 0
br
| 360 - (240 + 240 + 240) = -360
br
| (240 - 1/6 * 360) + (240 - 2/6 * 360) + (240 - 3/6 * 360)
br
| (180) + (120) + (60)
br
| (180) + (120) + (80 - 20)
br
| (180 - 1/3 * 20) + (120 - 2/3 * 20)
br
span.ok 173.3333... + 106.6666... + 80
+container('flex-shrink-container-basis160-padding40-minwidth0')
span.desc
| flex-shrink 1:2:3 & basis 160 & margin 40
br
| 360 - (240 + 240 + 240) = -360
br
| (240 - 1/6 * 360) + (240 - 2/6 * 360) + (240 - 3/6 * 360)
br
| (180) + (120) + (60)
br
| (180) + (120) + (120-60) #[span.warn |] (180) + (120) + (80 - 20)
br
| (180-60) + (120) + (120) #[span.warn |] (180 - 1/3 * 20) + (120 - 2/3 * 20) + (80)
br
span.warn
| 40 + 40 + 40 + (margin 240) [Chrome, Firefox, Safari, Edge]
br
| 93.3333... + 26.6666... + 0 + (margin 240) [IE11]
+container('flex-shrink-container-basis160-margin40')
span.desc
| flex-shrink 1:2:3 & basis 160 & margin 40 & min-width 0
br
| 360 - (240 + 240 + 240) = -360
br
| (240 - 1/6 * 360) + (240 - 2/6 * 360) + (240 - 3/6 * 360)
br
| (180) + (120) + (60)
br
| (180) + (120) + (80 - 20)
br
| (180 - 1/3 * 20) + (120 - 2/3 * 20) + (80)
br
span.ok 93.3333... + 26.6666... + 0 + (margin 240)
+container('flex-shrink-container-basis160-margin40-minwidth0')
span.desc
| flex-shrink 1:2:3 & basis 160 & padding 50
br
| 360 - (260 + 260 + 260) = -420
br
| (260 - 1/6 * 420) + (260 - 2/6 * 420) + (260 - 3/6 * 420)
br
| (190) + (120) + (50)
br
| (190) + (140-20) + (140-90) #[span.warn |] (190) + (120) + (100 - 50)
br
| (190-110) + (140) + (140) #[span.warn |] (190 - 1/3 * 50) + (120 - 2/3 * 50) + (100)
br
span.warn
| 140 + 140 + 140 [Chrome, Firefox, Safari, Edge] |
| (173.3333...) + (86.6666...) + (100)
br
| (173.3333...) + (100 - 13.3333...) + (100)
br
span.warn 160 + 100 + 100 [IE11]
+container('flex-shrink-container-basis160-padding50')
span.desc
| flex-shrink 1:2:3 & basis 160 & padding 50 & min-width 0
br
| 360 - (260 + 260 + 260) = -420
br
| (260 - 1/6 * 420) + (260 - 2/6 * 420) + (260 - 3/6 * 420)
br
| (190) + (120) + (50)
br
| (190) + (120) + (100 - 50)
br
| (190 - 1/3 * 50) + (120 - 2/3 * 50) + (100)
br
| (173.3333...) + (86.6666...) + (100)
br
| (173.3333...) + (100 - 13.3333...) + (100)
br
span.ok 160 + 100 + 100
+container('flex-shrink-container-basis160-padding50-minwidth0')
span.desc
| flex-shrink 1:2:3 & basis 160 & margin 50
br
| 360 - (260 + 260 + 260) = -420
br
| (260 - 1/6 * 420) + (260 - 2/6 * 420) + (260 - 3/6 * 420)
br
| (190) + (120) + (50)
br
| (190) + (140-20) + (140-90) #[span.warn |] (190) + (120) + (100-50)
br
| (190 - 110) + (140) + (140) #[span.warn |] (190 - 1/3 * 50) + (120 - 2/3 * 50) + (100)
br
span.warn
| 40 + 40 + 40 + (marign 240)[Chrome, Firefox, Safari, Edge] |
| (173.3333...) + (86.6666...) + (100)
br
| (173.3333...) + (100 - 13.3333...) + (100)
br
span.warn
| 60 + 0 + 0 + (margin 300) [IE11]
+container('flex-shrink-container-basis160-margin50')
span.desc
| flex-shrink 1:2:3 & basis 160 & margin 50 & min-width 0
br
| 360 - (260 + 260 + 260) = -420
br
| (260 - 1/6 * 420) + (260 - 2/6 * 420) + (260 - 3/6 * 420)
br
| (190) + (120) + (50)
br
| (190) + (120) + (100-50)
br
| (190 - 1/3 * 50) + (120 - 2/3 * 50) + (100)
br
| (173.3333...) + (86.6666...) + (100)
br
| (173.3333...) + (100 - 13.3333...) + (100)
br
span.ok 60 + 0 + 0 + (margin 300)
+container('flex-shrink-container-basis160-margin50-minwidth0')
span.desc
| flex-shrink 1:2:3 & basis 160 & padding 70 & border-box
br
span.warn
| 140 + 140 + 140 [IE11]
br
| 180 + 180 + 180 [Chrome, Firefox, Safari, Edge]
+container('flex-shrink-container-basis160-padding70-borderbox')
span.desc
| flex-shrink 1:2:3 & basis 160 & padding 70 & border-box & min-width 0
br
span.ok 140 + 140 + 140
+container('flex-shrink-container-basis160-padding70-borderbox-minwidth0')
span.desc
| flex-shrink 1:2:3 & width 160 & padding 20
br
| 360 - (200 + 200 + 200) = -240
br
| (200 - 1/6 * 240) + (200 - 2/6 * 240) + (200 - 3/6 * 240)
br
span.ok
| 160 + 120 + 80
+container('flex-shrink-container-width160-padding20')
span.desc
| flex-shrink 1:2:3 & width 160 & margin 20
br
| 360 - (200 + 200 + 200) = -240
br
| (200 - 1/6 * 240) + (200 - 2/6 * 240) + (200 - 3/6 * 240)
br
span.ok
| 120 + 80 + 40 + (margin 120)
+container('flex-shrink-container-width160-margin20')
span.desc
| flex-shrink 1:2:3 & width 160 & padding 40
br
| 360 - (240 + 240 + 240) = -360
br
| (240 - 1/6 * 360) + (240 - 2/6 * 360) + (240 - 3/6 * 360)
br
| (180) + (120) + (60)
br
| (180) + (120) + (120-60) #[span.warn |] (180) + (120) + (80 - 20)
br
| (180-60) + (120) + (120) #[span.warn |] (180 - 1/3 * 20) + (120 - 2/3 * 20)
br
span.warn
|120 + 120 + 120 [Chrome, Firefox, Safari, Edge]
br
| 173.3333... + 106.6666... + 80 [IE11]
+container('flex-shrink-container-width160-padding40')
span.desc
| flex-shrink 1:2:3 & width 160 & padding 40 & min-width 0
br
| 360 - (240 + 240 + 240) = -360
br
| (240 - 1/6 * 360) + (240 - 2/6 * 360) + (240 - 3/6 * 360)
br
| (180) + (120) + (60)
br
| (180) + (120) + (80 - 20)
br
| (180 - 1/3 * 20) + (120 - 2/3 * 20)
br
span.ok 173.3333... + 106.6666... + 80
+container('flex-shrink-container-width160-padding40-minwidth0')
span.desc
| flex-shrink 1:2:3 & width 160 & margin 40
br
| 360 - (240 + 240 + 240) = -360
br
| (240 - 1/6 * 360) + (240 - 2/6 * 360) + (240 - 3/6 * 360)
br
| (180) + (120) + (60)
br
| (180) + (120) + (120-60) #[span.warn |] (180) + (120) + (80 - 20)
br
| (180-60) + (120) + (120) #[span.warn |] (180 - 1/3 * 20) + (120 - 2/3 * 20) + (80)
br
span.warn
| 40 + 40 + 40 + (margin 240) [Chrome, Firefox, Safari, Edge]
br
| 93.3333... + 26.6666... + 0 + (margin 240) [IE11]
+container('flex-shrink-container-width160-margin40')
span.desc
| flex-shrink 1:2:3 & width 160 & margin 40 & min-width 0
br
| 360 - (240 + 240 + 240) = -360
br
| (240 - 1/6 * 360) + (240 - 2/6 * 360) + (240 - 3/6 * 360)
br
| (180) + (120) + (60)
br
| (180) + (120) + (80 - 20)
br
| (180 - 1/3 * 20) + (120 - 2/3 * 20) + (80)
br
span.ok 93.3333... + 26.6666... + 0 + (margin 240)
+container('flex-shrink-container-width160-margin40-minwidth0')
span.desc
| flex-shrink 1:2:3 & width 160 & padding 50
br
| 360 - (260 + 260 + 260) = -420
br
| (260 - 1/6 * 420) + (260 - 2/6 * 420) + (260 - 3/6 * 420)
br
| (190) + (120) + (50)
br
| (190) + (140-20) + (140-90) #[span.warn |] (190) + (120) + (100 - 50)
br
| (190-110) + (140) + (140) #[span.warn |] (190 - 1/3 * 50) + (120 - 2/3 * 50) + (100)
br
span.warn
| 140 + 140 + 140 [Chrome, Firefox, Safari, Edge] |
| (173.3333...) + (86.6666...) + (100)
br
| (173.3333...) + (100 - 13.3333...) + (100)
br
span.warn 160 + 100 + 100 [IE11]
+container('flex-shrink-container-width160-padding50')
span.desc
| flex-shrink 1:2:3 & width 160 & padding 50 & min-width 0
br
| 360 - (260 + 260 + 260) = -420
br
| (260 - 1/6 * 420) + (260 - 2/6 * 420) + (260 - 3/6 * 420)
br
| (190) + (120) + (50)
br
| (190) + (120) + (100 - 50)
br
| (190 - 1/3 * 50) + (120 - 2/3 * 50) + (100)
br
| (173.3333...) + (86.6666...) + (100)
br
| (173.3333...) + (100 - 13.3333...) + (100)
br
span.ok 160 + 100 + 100
+container('flex-shrink-container-width160-padding50-minwidth0')
span.desc
| flex-shrink 1:2:3 & width 160 & margin 50
br
| 360 - (260 + 260 + 260) = -420
br
| (260 - 1/6 * 420) + (260 - 2/6 * 420) + (260 - 3/6 * 420)
br
| (190) + (120) + (50)
br
| (190) + (140-20) + (140-90) #[span.warn |] (190) + (120) + (100-50)
br
| (190 - 110) + (140) + (140) #[span.warn |] (190 - 1/3 * 50) + (120 - 2/3 * 50) + (100)
br
span.warn
| 40 + 40 + 40 + (marign 240)[Chrome, Firefox, Safari, Edge] |
| (173.3333...) + (86.6666...) + (100)
br
| (173.3333...) + (100 - 13.3333...) + (100)
br
span.warn
| 60 + 0 + 0 + (margin 300) [IE11]
+container('flex-shrink-container-width160-margin50')
span.desc
| flex-shrink 1:2:3 & width 160 & margin 50 & min-width 0
br
| 360 - (260 + 260 + 260) = -420
br
| (260 - 1/6 * 420) + (260 - 2/6 * 420) + (260 - 3/6 * 420)
br
| (190) + (120) + (50)
br
| (190) + (120) + (100-50)
br
| (190 - 1/3 * 50) + (120 - 2/3 * 50) + (100)
br
| (173.3333...) + (86.6666...) + (100)
br
| (173.3333...) + (100 - 13.3333...) + (100)
br
span.ok 60 + 0 + 0 + (margin 300)
+container('flex-shrink-container-width160-margin50-minwidth0')
span.desc
| flex-shrink 1:2:3 & width 160 & padding 70 & border-box
br
span.warn
| 140 + 140 + 140 [IE11]
br
| 180 + 180 + 180 [Chrome, Firefox, Safari, Edge]
+container('flex-shrink-container-width160-padding70-borderbox')
span.desc
| flex-shrink 1:2:3 & width 160 & padding 70 & border-box & min-width 0
br
span.ok 140 + 140 + 140
+container('flex-shrink-container-width160-padding70-borderbox-minwidth0')
span.desc
| flex-shrink 1:2:3 & basis 0
br
span.warn
| 0 + 0 + 0 [IE11]
br
| (40-40) + (40-40) + (40-40)
br
span.warn
| 40 + 40 + 40 [Chrome, Firefox, Safari, Edge]
+container('flex-shrink-container-basis0')
span.desc
| flex-shrink 1:2:3 & width 0
br
span.ok
| 0 + 0 + 0
+container('flex-shrink-container-width0')
span.desc
| flex-shrink 1:2:3 & basis 0 & content 160
br
span.warn
| 160 + 160 + 160 [Chrome, Firefox, Safari, Edge]
br
| 0 + 0 + 0 [IE11]
+container('flex-shrink-container-basis0-content160')
span.desc
| flex-shrink 1:2:3 & width 0 & content 160
br
span.ok 0 + 0 + 0
+container('flex-shrink-container-width0-content160')
span.desc
| flex-shrink 1:2:3 & basis 160 & content 160
br
span.warn 160 + 160 + 160 [Chrome, Firefox, Safari, Edge]
br
| 360 - (160 + 160 + 160) = -120
br
| (160 - 1/6 * 120) + (160 - 2/6 * 120) + (160 - 3/6 * 120)
br
span.warn 140 + 120 + 100 [IE11]
+container('flex-shrink-container-basis160-content160')
span.desc
| flex-shrink 1:2:3 & basis 160 & content 160 & min-width 0
br
| 360 - (160 + 160 + 160) = -120
br
| (160 - 1/6 * 120) + (160 - 2/6 * 120) + (160 - 3/6 * 120)
br
span.ok 140 + 120 + 100
+container('flex-shrink-container-basis160-content160-minwidth0')
span.desc
| flex-shrink 1:2:3 & width 160 & content 160
br
span.warn 160 + 160 + 160 [Chrome, Firefox, Safari, Edge]
br
| 360 - (160 + 160 + 160) = -120
br
| (160 - 1/6 * 120) + (160 - 2/6 * 120) + (160 - 3/6 * 120)
br
span.warn 140 + 120 + 100 [IE11]
+container('flex-shrink-container-width160-content160')
span.desc
| flex-shrink 1:2:3 & width 160 & content 160 & min-width 0
br
| 360 - (160 + 160 + 160) = -120
br
| (160 - 1/6 * 120) + (160 - 2/6 * 120) + (160 - 3/6 * 120)
br
span.ok 140 + 120 + 100
+container('flex-shrink-container-width160-content160-minwidth0')
span.desc
| flex-shrink 1:2:3 & width 0 & padding 40
br
span.ok
| 80 + 80 + 80
+container('flex-shrink-container-width0-padding40')
span.desc
| flex-shrink 1:2:3 & width 0 & margin 40
br
span.ok
| 0 + 0 + 0 + (margin 240)
+container('flex-shrink-container-width0-margin40')
span.desc
| flex-shrink 1:2:3 & width 0 & padding 60
br
span.ok
| 120 + 120 + 120
+container('flex-shrink-container-width0-padding60')
span.desc
| flex-shrink 1:2:3 & width 0 & margin 60
br
span.ok
| 0 + 0 + 0 + (margin 360)
+container('flex-shrink-container-width0-margin60')
span.desc
| flex-shrink 1:2:3 & width 0 & padding 70
br
span.ok
| 140 + 140 + 140
+container('flex-shrink-container-width0-padding70')
span.desc
| flex-shrink 1:2:3 & width 0 & margin 70
br
span.ok
| 0 + 0 + 0 + (margin 420)
+container('flex-shrink-container-width0-margin70')
span.desc
| flex-grow 1:2:3 & basis content
br
span.warn 40 + 40 + 40 [Chrome, Firefox, Safari, IE11]
br
| 360 - (40 + 40 + 40) = 240
br
| (40 + 1/6 * 240) + (40 + 2/6 * 240) + (40 + 3/6 * 240)
br
span.warn 80 + 120 + 160 [Edge]
+container('flex-grow-container-basiscontent')
span.desc
| flex-grow 1:2:3 & basis content:content:auto
br
| 360 - (40 + 40 + 40) = 240
br
| (40 + 0 * 240) + (40 + 0 * 240) + (40 + 1 * 240) #[span.warn |] (40 + 1/6 * 240) + (40 + 2/6 * 240) + (40 + 3/6 * 240)
br
span.warn
| 40 + 40 + 280 [Chrome, Firefox, Safari, IE11]
br
| 80 + 120 + 160 [Edge]
+container('flex-grow-container-basiscontent_content_auto')
span.desc
| flex-grow 1:2:3 (longhand) & basis content
br
| 360 - (40 + 40 + 40) = 240
br
| (40 + 1/6 * 240) + (40 + 2/6 * 240) + (40 + 3/6 * 240)
br
span.ok 80 + 120 + 160
+container('flex-growlonghand-container-basiscontent')
span.desc
| flex-shrink 1:2:3 & basis content & content 160
br
span.warn 160 + 160 + 160 [Chrome, Firefox, Safari, Edge]
br
| 360 - (160 + 160 + 160) = -120
br
| (160 - 1/3 * 120) + (160 - 1/3 * 120) + (160 - 1/3 * 120)
br
span.warn 120 + 120 + 120 [IE11]
+container('flex-shrink-container-basiscontent-content160')
span.desc
| flex-shrink 1:2:3 & basis content & content 160 & min-width 0
br
span.warn 160 + 160 + 160 [IE11]
br
| 360 - (160 + 160 + 160) = -120
br
| (160 - 1/3 * 120) + (160 - 1/3 * 120) + (160 - 1/3 * 120) #[span.warn |] (160 - 1/6 * 120) + (160 - 2/6 * 120) + (160 - 3/6 * 120)
br
span.warn
| 120 + 120 + 120 [Chrome, Firefox, Safari]
br
| 140 + 120 +100 [Edge]
+container('flex-shrink-container-basiscontent-content160-minwidth0')
span.desc
| flex-shrink 1:2:3 & basis content:content:auto & content 160 & min-width 0
br
span.warn 160 + 160 + 160 [IE11]
br
| 360 - (160 + 160 + 160) = -120
br
| (160 - 1/5 * 120) + (160 - 1/5 * 120) + (160 - 3/5 * 120) #[span.warn |] (160 - 1/6 * 120) + (160 - 2/6 * 120) + (160 - 3/6 * 120)
br
span.warn
| 136 + 136 + 88 [Chrome, Firefox, Safari]
br
| 140 + 120 +100 [Edge]
+container('flex-shrink-container-basiscontent_content_auto-content160-minwidth0')
span.desc
| flex-shrink 1:2:3 (longhand) & basis content & content 160 & min-width 0
br
span.warn 160 + 160 + 160 [IE11]
br
| 360 - (160 + 160 + 160) = -120
br
| (160 - 1/6 * 120) + (160 - 2/6 * 120) + (160 - 3/6 * 120)
br
span.warn 140 + 120 + 100 [Chrome, Firefox, Safari, Edge]
+container('flex-shrinklonghand-container-basiscontent-content160-minwidth0')
html
box-sizing border-box
overflow auto
*
position relative
box-sizing inherit
body
display flex
align-items center
justify-content center
background-color #f8f8f8
.wrapper
flex 0 0 auto
width 360px
height auto
display flex
flex-flow column nowrap
align-items center
justify-content center
padding 20px 0 0
box-shadow 0 0 15px rgba(black, .16)
.desc
width 100%
height auto
color #222
text-align center
font-size 10px
white-space nowrap
background-color rgba(#FDF6E3,.8)
.warn
color #d33
font-weight bold
.ok
color #2a3
font-weight bold
.measure
position absolute
top 0
left 0
display flex
width 360px
height 100%
.unit
width auto
height 100%
flex 0 0 10px
&:nth-child(odd)
background-color #d0ead0
&:nth-child(even)
background-color #f1fbe1
.container
width 360px
height auto
margin 10px 0 40px
text-align center
border-top 1px rgba(black, .3) solid
border-bottom @border-top
.item
box-sizing content-box
&.border-box
box-sizing border-box
&.foo
background-color rgba(#2299ab,.7)
.item-width
background-color blend(rgba(#11779a, .7),#222)
&.bar
background-color rgba(#6ca233,.7)
.item-width
background-color blend(rgba(#239022, .7),#222)
&.baz
background-color rgba(#ffcc2c,.7)
.item-width
background-color blend(rgba(#ff9911, .7),#222)
.item-width,
.text
font-size 10px
display inline-block
.item-width
width auto
height auto
position absolute
top 0
left 0
color #FDF6E3
padding 0 5px
.text
width 40px
height auto
color #222
background-color #FDF6E3
.block-container
display block
.block-item
float left
padding 20px 0
&.foo
width 60px
height auto
&.bar
width 120px
height auto
&.baz
width 180px
height auto
.flex-grow-container-widthauto
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex 1 0 auto
&.bar
flex 2 0 auto
&.baz
flex 3 0 auto
.flex-grow-container-widthauto-padding20
display flex
.flex-item
width auto
height auto
padding 20px
&.foo
flex 1 0 auto
&.bar
flex 2 0 auto
&.baz
flex 3 0 auto
.flex-grow-container-widthauto-margin20
display flex
.flex-item
width auto
height auto
padding 20px 0
margin 0 20px
&.foo
flex 1 0 auto
&.bar
flex 2 0 auto
&.baz
flex 3 0 auto
.flex-grow-container-basis0
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex 1 0 0px
&.bar
flex 2 0 0px
&.baz
flex 3 0 0px
.flex-grow-container-basis0-1_5_6
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex 1 0 0px
&.bar
flex 5 0 0px
&.baz
flex 6 0 0px
.flex-grow-container-basis0-content80
display flex
.flex-item
width auto
height auto
padding 20px 0
.text
width 80px
height auto
&.foo
flex 1 0 0px
&.bar
flex 2 0 0px
&.baz
flex 3 0 0px
.flex-grow-container-basis0-content120
display flex
.flex-item
width auto
height auto
padding 20px 0
.text
width 120px
height auto
&.foo
flex 1 0 0px
&.bar
flex 2 0 0px
&.baz
flex 3 0 0px
.flex-grow-container-basis0-content160
display flex
.flex-item
width auto
height auto
padding 20px 0
.text
width 160px
height auto
&.foo
flex 1 0 0px
&.bar
flex 2 0 0px
&.baz
flex 3 0 0px
.flex-grow-container-width0
display flex
.flex-item
width 0
height auto
padding 20px 0
&.foo
flex 1 0 auto
&.bar
flex 2 0 auto
&.baz
flex 3 0 auto
.flex-grow-container-width-1_5_6
display flex
.flex-item
width 0
height auto
padding 20px 0
&.foo
flex 1 0 auto
&.bar
flex 5 0 auto
&.baz
flex 6 0 auto
.flex-grow-container-width0-content80
display flex
.flex-item
width 0
height auto
padding 20px 0
.text
width 80px
height auto
&.foo
flex 1 0 auto
&.bar
flex 2 0 auto
&.baz
flex 3 0 auto
.flex-grow-container-width0-content120
display flex
.flex-item
width 0
height auto
padding 20px 0
.text
width 120px
height auto
&.foo
flex 1 0 auto
&.bar
flex 2 0 auto
&.baz
flex 3 0 auto
.flex-grow-container-width0-content160
display flex
.flex-item
width 0
height auto
padding 20px 0
.text
width 160px
height auto
&.foo
flex 1 0 auto
&.bar
flex 2 0 auto
&.baz
flex 3 0 auto
.flex-grow-container-width0-padding20
display flex
.flex-item
width 0
height auto
padding 20px
&.foo
flex 1 0 auto
&.bar
flex 2 0 auto
&.baz
flex 3 0 auto
.flex-grow-container-width0-margin20
display flex
.flex-item
width 0
height auto
padding 20px 0
margin 0 20px
&.foo
flex 1 0 auto
&.bar
flex 2 0 auto
&.baz
flex 3 0 auto
.block-container-120
display block
.block-item
float left
padding 20px 0
&.foo
width 120px
height auto
&.bar
width 120px
height auto
&.baz
width 120px
height auto
.flex-shrink-container-basis160
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis200
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex 0 1 200px
&.bar
flex 0 2 200px
&.baz
flex 0 3 200px
.flex-shrink-container-basis360
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex 0 1 360px
&.bar
flex 0 2 360px
&.baz
flex 0 3 360px
.flex-shrink-container-basis360-minwidth0
display flex
.flex-item
width auto
height auto
padding 20px 0
min-width 0
&.foo
flex 0 1 360px
&.bar
flex 0 2 360px
&.baz
flex 0 3 360px
.flex-shrink-container-width160
display flex
.flex-item
width 160px
height auto
padding 20px 0
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width200
display flex
.flex-item
width 200px
height auto
padding 20px 0
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width360
display flex
.flex-item
width 360px
height auto
padding 20px 0
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width360-minwidth0
display flex
.flex-item
width 360px
height auto
padding 20px 0
min-width 0
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-basis160-padding20
display flex
.flex-item
width auto
height auto
padding 20px
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-margin20
display flex
.flex-item
width auto
height auto
padding 20px 0
margin 0 20px
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-padding40
display flex
.flex-item
width auto
height auto
padding 20px 40px
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-padding40-minwidth0
display flex
.flex-item
width auto
height auto
padding 20px 40px
min-width 0
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-margin40
display flex
.flex-item
width auto
height auto
padding 20px 0
margin 0 40px
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-margin40-minwidth0
display flex
.flex-item
width auto
height auto
padding 20px 0
margin 0 40px
min-width 0
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-padding50
display flex
.flex-item
width auto
height auto
padding 20px 50px
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-padding50-minwidth0
display flex
.flex-item
width auto
height auto
padding 20px 50px
min-width 0
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-margin50
display flex
.flex-item
width auto
height auto
padding 20px 0
margin 0 50px
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-margin50-minwidth0
display flex
.flex-item
width auto
height auto
padding 20px 0
margin 0 50px
min-width 0
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-padding70-borderbox
display flex
.flex-item
width auto
height auto
padding 20px 70px
box-sizing content-box
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-padding70-borderbox-minwidth0
display flex
.flex-item
width auto
height auto
padding 20px 70px
box-sizing content-box
min-width 0
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-width160-padding20
display flex
.flex-item
width 160px
height auto
padding 20px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-margin20
display flex
.flex-item
width 160px
height auto
padding 20px 0
margin 0 20px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-padding40
display flex
.flex-item
width 160px
height auto
padding 20px 40px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-padding40-minwidth0
display flex
.flex-item
width 160px
height auto
padding 20px 40px
min-width 0
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-margin40
display flex
.flex-item
width 160px
height auto
padding 20px 0
margin 0 40px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-margin40-minwidth0
display flex
.flex-item
width 160px
height auto
padding 20px 0
margin 0 40px
min-width 0
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-padding50
display flex
.flex-item
width 160px
height auto
padding 20px 50px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-padding50-minwidth0
display flex
.flex-item
width 160px
height auto
padding 20px 50px
min-width 0
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-margin50
display flex
.flex-item
width 160px
height auto
padding 20px 0
margin 0 50px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-margin50-minwidth0
display flex
.flex-item
width 160px
height auto
padding 20px 0
margin 0 50px
min-width 0
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-padding70-borderbox
display flex
.flex-item
width 160px
height auto
padding 20px 70px
box-sizing content-box
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-padding70-borderbox-minwidth0
display flex
.flex-item
width 160px
height auto
padding 20px 70px
box-sizing content-box
min-width 0
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-basis0
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex 0 1 0px
&.bar
flex 0 2 0px
&.baz
flex 0 3 0px
.flex-shrink-container-width0
display flex
.flex-item
width 0
height auto
padding 20px 0
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-basis0-content160
display flex
.flex-item
width auto
height auto
padding 20px 0
.text
width 160px
height auto
&.foo
flex 0 1 0px
&.bar
flex 0 2 0px
&.baz
flex 0 3 0px
.flex-shrink-container-width0-content160
display flex
.flex-item
width 0
height auto
padding 20px 0
.text
width 160px
height auto
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-basis160-content160
display flex
.flex-item
width auto
height auto
padding 20px 0
.text
width 160px
height auto
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-basis160-content160-minwidth0
display flex
.flex-item
width auto
height auto
padding 20px 0
min-width 0
.text
width 160px
height auto
&.foo
flex 0 1 160px
&.bar
flex 0 2 160px
&.baz
flex 0 3 160px
.flex-shrink-container-width160-content160
display flex
.flex-item
width 160px
height auto
padding 20px 0
.text
width 160px
height auto
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width160-content160-minwidth0
display flex
.flex-item
width 160px
height auto
padding 20px 0
min-width 0
.text
width 160px
height auto
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width0-padding40
display flex
.flex-item
width 0
height auto
padding 20px 40px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width0-margin40
display flex
.flex-item
width 0
height auto
padding 20px 0
margin 0 40px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width0-padding60
display flex
.flex-item
width 0
height auto
padding 20px 60px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width0-margin60
display flex
.flex-item
width 0
height auto
padding 20px 0
margin 0 60px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width0-padding70
display flex
.flex-item
width 0
height auto
padding 20px 70px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-shrink-container-width0-margin70
display flex
.flex-item
width 0
height auto
padding 20px 0
margin 0 70px
&.foo
flex 0 1 auto
&.bar
flex 0 2 auto
&.baz
flex 0 3 auto
.flex-grow-container-basiscontent
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex 1 0 content
&.bar
flex 2 0 content
&.baz
flex 3 0 content
.flex-grow-container-basiscontent_content_auto
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex 1 0 content
&.bar
flex 2 0 content
&.baz
flex 3 0 auto
.flex-growlonghand-container-basiscontent
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex-grow 1
flex 1 0 content
&.bar
flex-grow 2
flex 2 0 content
&.baz
flex-grow 3
flex 3 0 content
.flex-shrink-container-basiscontent-content160
display flex
.flex-item
width auto
height auto
padding 20px 0
&.foo
flex 0 1 content
.text
width 160px
height auto
&.bar
flex 0 2 content
.text
width 160px
height auto
&.baz
flex 0 3 content
.text
width 160px
height auto
.flex-shrink-container-basiscontent-content160-minwidth0
display flex
.flex-item
width auto
height auto
min-width 0
padding 20px 0
&.foo
flex 0 1 content
.text
width 160px
height auto
&.bar
flex 0 2 content
.text
width 160px
height auto
&.baz
flex 0 3 content
.text
width 160px
height auto
.flex-shrink-container-basiscontent_content_auto-content160-minwidth0
display flex
.flex-item
width auto
height auto
min-width 0
padding 20px 0
&.foo
flex 0 1 content
.text
width 160px
height auto
&.bar
flex 0 2 content
.text
width 160px
height auto
&.baz
flex 0 3 auto
.text
width 160px
height auto
.flex-shrinklonghand-container-basiscontent-content160-minwidth0
display flex
.flex-item
width auto
height auto
min-width 0
padding 20px 0
&.foo
flex-shrink 1
flex 0 1 content
.text
width 160px
height auto
&.bar
flex-shrink 2
flex 0 2 content
.text
width 160px
height auto
&.baz
flex-shrink 3
flex 0 3 content
.text
width 160px
height auto
[].slice.call(document.querySelectorAll('.item'), 0)
.map(item => [item.querySelector('.item-width'), item])
.forEach(([l, w]) => detectWidth(l, w));
[].forEach.call(document.querySelectorAll('.text'), text => detectWidth(text, text));
function detectWidth(labelEle, widthEle) {
labelEle.textContent = widthEle.getBoundingClientRect().width;
}
Also see: Tab Triggers