Firefox 52 to Introduce New Box-Alignment Values

CSS Grid is coming in Firefox 52 in March. That’s amazing. It could overshadow a few small improvements that are also coming in the release. The Box-Alignment module is getting a couple new features, as well.
Space items evenly instead of around!
First…


This content originally appeared on bryanlrobinson.com and was authored by bryanlrobinson.com

CSS Grid is coming in Firefox 52 in March. That's amazing. It could overshadow a few small improvements that are also coming in the release. The Box-Alignment module is getting a couple new features, as well.

Space items evenly instead of around!

First, we have a new value we can use in justify-content and align-items: space-evenly.

In the past, we've had space-around. This allows the extra whitespace generated by flex/grid to be placed to the left and right of the children. This is useful, but the exterior whitespace is half the value of the internal whitespace. Often not ideal.

Space-Around's less-than-ideal layout

Space-evenly takes the extra whitespace and splits it up ... well ... evenly.

.container {
display:flex;
width: 600px;
margin: 50px auto;
background-color: #042A2B;
justify-content: space-even;
}

With this value, you no longer need to account for half the spacing as padding on the parent. The Box-Alignment properties can now handle all spacing needs.

Space-Evenly's fix

I've written a CodePen if you want to play with this value. Remember, it can only be accessed in the Firefox 52 Beta currently.

Baseline first and last

Align-items has always had baseline as a value. This aligns the baseline of the first line of text to the first line of text of its sibling boxes. This is great for some use cases and pairs nicely as a counterpoint to align-items: flex-start.

Where's the counterpoint to flex-end, though?

Firefox 52 implements align-items: first/last baseline allowing you to choose.

.container {
align-items: last baseline;
}

Baseline last in action

See the entire list of new features here. There's also some new interesting clip-path and animation features included. Of course, there's also CSS Grid!


This content originally appeared on bryanlrobinson.com and was authored by bryanlrobinson.com


Print Share Comment Cite Upload Translate Updates
APA

bryanlrobinson.com | Sciencx (2017-02-16T00:00:00+00:00) Firefox 52 to Introduce New Box-Alignment Values. Retrieved from https://www.scien.cx/2017/02/16/firefox-52-to-introduce-new-box-alignment-values/

MLA
" » Firefox 52 to Introduce New Box-Alignment Values." bryanlrobinson.com | Sciencx - Thursday February 16, 2017, https://www.scien.cx/2017/02/16/firefox-52-to-introduce-new-box-alignment-values/
HARVARD
bryanlrobinson.com | Sciencx Thursday February 16, 2017 » Firefox 52 to Introduce New Box-Alignment Values., viewed ,<https://www.scien.cx/2017/02/16/firefox-52-to-introduce-new-box-alignment-values/>
VANCOUVER
bryanlrobinson.com | Sciencx - » Firefox 52 to Introduce New Box-Alignment Values. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2017/02/16/firefox-52-to-introduce-new-box-alignment-values/
CHICAGO
" » Firefox 52 to Introduce New Box-Alignment Values." bryanlrobinson.com | Sciencx - Accessed . https://www.scien.cx/2017/02/16/firefox-52-to-introduce-new-box-alignment-values/
IEEE
" » Firefox 52 to Introduce New Box-Alignment Values." bryanlrobinson.com | Sciencx [Online]. Available: https://www.scien.cx/2017/02/16/firefox-52-to-introduce-new-box-alignment-values/. [Accessed: ]
rf:citation
» Firefox 52 to Introduce New Box-Alignment Values | bryanlrobinson.com | Sciencx | https://www.scien.cx/2017/02/16/firefox-52-to-introduce-new-box-alignment-values/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.