Flex on PhantomJS

Does PhantomJS support modern flex? if I run this file:

$ cat x.js var $ = require('jquery'); $('<div/>', {id: 'x'}).appendTo($('body')); var x = $('#x'); x.css('color', 'red'); console.log('color: ' + x.css('color')); x.css('flex', '0 0 0px'); console.log('css: ' + x.css('flex')); 

it can be seen that .css() works fine for color, but not for flex.

 $ phantomjs x.js color: rgb(255, 0, 0) css: undefined 

I also tried some of the options: -webkit-flex , -moz-box-flex and -ms-flex , all of which give the same results. Curiously, -webkit-box-flex returns 0 instead of undefined , but that seems wrong.

I run with:

 $ phantomjs --version 1.9.8 
+7
css flexbox phantomjs
source share
1 answer

Given that the PhantomJS 1.x engine is now over 5 years old. Yes, flexbox is not supported. Modernizr reports that it supports flexboxlegacy. With PhantomJS 2.x, you get flex support .

+2
source share

All Articles