source: frontend/node_modules/postcss-flexbugs-fixes/bugs/bug6.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 650 bytes
Line 
1var postcss = require('postcss');
2
3module.exports = function(decl) {
4 if (decl.prop === 'flex') {
5 var values = postcss.list.space(decl.value);
6 var flexGrow = values[0];
7 var flexShrink = values[1] || '1';
8 var flexBasis = values[2] || '0%';
9 // Safari seems to hate '0%' and the others seems to make do with a nice value when basis is missing,
10 // so if we see a '0%', just remove it. This way it'll get adjusted for any other cases where '0%' is
11 // already defined somewhere else.
12 if (flexBasis === '0%') flexBasis = null;
13 decl.value =
14 flexGrow + ' ' + flexShrink + (flexBasis ? ' ' + flexBasis : '');
15 }
16};
Note: See TracBrowser for help on using the repository browser.