Skip to content

Commit 8ac64fa

Browse files
committed
Add (final) Flexbox implementation (2013)
References: - http://www.w3.org/TR/css3-flexbox/#property I did not update the allowed values for min-width and min-height, because this change was dropped from the Flexbox spec: - http://dev.w3.org/csswg/css-flexbox/#changes - http://lists.w3.org/Archives/Public/www-style/2013Mar/0137.html
1 parent 15ddf36 commit 8ac64fa

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

src/css/Properties.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
var Properties = {
33

44
//A
5+
"align-items" : "flex-start | flex-end | center | baseline | stretch",
6+
"align-content" : "flex-start | flex-end | center | space-between | space-around | stretch",
7+
"align-self" : "auto | flex-start | flex-end | center | baseline | stretch",
58
"alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | <percentage> | <length>",
69
"alignment-baseline" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
710
"animation" : 1,
@@ -251,7 +254,7 @@ var Properties = {
251254

252255
//D
253256
"direction" : "ltr | rtl | inherit",
254-
"display" : "inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | box | inline-box | grid | inline-grid | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box",
257+
"display" : "inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | box | inline-box | grid | inline-grid | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box | flex | -webkit-flex | inline-flex | -webkit-inline-flex",
255258
"dominant-baseline" : 1,
256259
"drop-initial-after-adjust" : "central | middle | after-edge | text-after-edge | ideographic | alphabetic | mathematical | <percentage> | <length>",
257260
"drop-initial-after-align" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
@@ -268,6 +271,13 @@ var Properties = {
268271
"filter" : 1,
269272
"fit" : "fill | hidden | meet | slice",
270273
"fit-position" : 1,
274+
"flex" : "none | [ <flex-grow> <flex-shrink>? || <flex-basis>",
275+
"flex-basis" : "<width>",
276+
"flex-direction" : "row | row-reverse | column | column-reverse",
277+
"flex-flow" : "<flex-direction> || <flex-wrap>",
278+
"flex-grow" : "<number>",
279+
"flex-shrink" : "<number>",
280+
"flex-wrap" : "nowrap | wrap | wrap-reverse",
271281
"float" : "left | right | none | inherit",
272282
"float-offset" : 1,
273283
"font" : 1,
@@ -311,6 +321,9 @@ var Properties = {
311321
"image-resolution" : 1,
312322
"inline-box-align" : "initial | last | <integer>",
313323

324+
//J
325+
"justify-content" : "flex-start | flex-end | center | space-between | space-around",
326+
314327
//L
315328
"left" : "<margin-width> | inherit",
316329
"letter-spacing" : "<length> | normal | inherit",
@@ -354,6 +367,7 @@ var Properties = {
354367

355368
//O
356369
"opacity" : "<number> | inherit",
370+
"order" : "<integer>",
357371
"orphans" : "<integer> | inherit",
358372
"outline" : 1,
359373
"outline-color" : "<color> | invert | inherit",

tests/css/Validation.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,12 +591,16 @@
591591
"-moz-stack",
592592
"-moz-marker",
593593
"-webkit-box",
594-
"-webkit-inline-box"
594+
"-webkit-inline-box",
595+
"flex",
596+
"-webkit-flex",
597+
"inline-flex",
598+
"-webkit-inline-flex"
595599

596600
],
597601

598602
invalid: {
599-
"foo" : "Expected (inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | box | inline-box | grid | inline-grid | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box) but found 'foo'."
603+
"foo" : "Expected (inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | box | inline-box | grid | inline-grid | none | inherit | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box | flex | -webkit-flex | inline-flex | -webkit-inline-flex) but found 'foo'."
600604
}
601605
}));
602606

0 commit comments

Comments
 (0)