This commit is contained in:
Iliyan Angelov
2025-09-14 23:24:25 +03:00
commit c67067a2a4
71311 changed files with 6800714 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
## 5.0.1
* Moving postcss to peer dependencies [#74](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/74)
## 5.0.1
* Adding postcss as dependency [#74](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/74)
## 5.0.0
* upgrade to postcss 8 [#71](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/71)
## 4.2.1
* Fix `calc` regex [#69](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/69)
## 4.2.0
* Don't change values that reference custom props [#64](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/64)
## 4.1.0
* Add option to disable bug fixes [#53](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/53)
## 4.0.0
* upgrade to postcss 7
## 3.3.1
* Autoremoval of 0% Basis [#46](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/46). More context [here](https://github.com/luisrudge/postcss-flexbugs-fixes/issues/45#issuecomment-385070879)
## 3.3.0
* Revert Autoremoval of 0% Basis [#43](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/43)
## 3.2.0
* Set flex basis if second value is not a number [#41](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/41)
## 3.1.0
* Fix safari issues with flex-basis [#38](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/38)
## 3.0.0
* upgrade to postcss 6
## 2.1.0
* Prevent mutating value when flex value is one of `['none', 'auto', 'content', 'inherit', 'initial', 'unset']`
## 2.0.0
* upgrade to postcss 5
## 1.1.0
* Ignore flex set to none [#24](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/24)
* The default value of flex-basis is 0% [#22](https://github.com/luisrudge/postcss-flexbugs-fixes/pull/22)
## 1.0
* Initial release

20
frontend/node_modules/postcss-flexbugs-fixes/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright 2015 Luis Rudge <luis@luisrudge.net>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

76
frontend/node_modules/postcss-flexbugs-fixes/README.md generated vendored Normal file
View File

@@ -0,0 +1,76 @@
# PostCSS Flexbugs Fixes [![Build Status][ci-img]][ci]
[PostCSS] plugin This project tries to fix all of [flexbug's](https://github.com/philipwalton/flexbugs) issues.
## bug [4](https://github.com/philipwalton/flexbugs/blob/master/README.md#4-flex-shorthand-declarations-with-unitless-flex-basis-values-are-ignored)
### Input
```css
.foo { flex: 1; }
.bar { flex: 1 1; }
.foz { flex: 1 1 0; }
.baz { flex: 1 1 0px; }
```
### Output
```css
.foo { flex: 1 1; }
.bar { flex: 1 1; }
.foz { flex: 1 1; }
.baz { flex: 1 1; }
```
## bug [6](https://github.com/philipwalton/flexbugs/blob/master/README.md#6-the-default-flex-value-has-changed)
### Input
```css
.foo { flex: 1; }
```
### Output
```css
.foo { flex: 1 1 0%; }
```
> This only fixes css classes that have the `flex` property set. To fix elements that are contained inside a flexbox container, use this global rule:
```css
* {
flex-shrink: 1;
}
```
## bug [8.1.a](https://github.com/philipwalton/flexbugs/blob/master/README.md#8-flex-basis-doesnt-support-calc)
### Input
```css
.foo { flex: 1 0 calc(1vw - 1px); }
```
### Output
```css
.foo {
flex-grow: 1;
flex-shrink: 0;
flex-basis: calc(1vw - 1px);
}
```
## Usage
```js
postcss([require('postcss-flexbugs-fixes')]);
```
You can also disable bugs individually, possible keys `bug4`, `bug6` and `bug8a`.
```js
var plugin = require('postcss-flexbugs-fixes');
postcss([plugin({ bug6: false })]);
```
See [PostCSS] docs for examples for your environment.
[postcss]: https://github.com/postcss/postcss
[ci-img]: https://travis-ci.org/luisrudge/postcss-flexbugs-fixes.svg
[ci]: https://travis-ci.org/luisrudge/postcss-flexbugs-fixes

View File

@@ -0,0 +1,44 @@
var postcss = require('postcss');
function shouldSetZeroBasis(basisValue) {
if (!basisValue) {
return false;
}
return basisValue === '0' || basisValue.replace(/\s/g, '') === '0px';
}
function properBasis(basis) {
if (shouldSetZeroBasis(basis)) {
return '0%';
}
return basis;
}
module.exports = function(decl) {
if (decl.prop === 'flex') {
var values = postcss.list.space(decl.value);
// set default values
var flexGrow = '0';
var flexShrink = '1';
var flexBasis = '0%';
if (values[0]) {
flexGrow = values[0];
}
if (values[1]) {
if (!isNaN(values[1])) {
flexShrink = values[1];
} else {
flexBasis = values[1];
}
}
if (values[2]) {
flexBasis = values[2];
}
decl.value = flexGrow + ' ' + flexShrink + ' ' + properBasis(flexBasis);
}
};

View File

@@ -0,0 +1,16 @@
var postcss = require('postcss');
module.exports = function(decl) {
if (decl.prop === 'flex') {
var values = postcss.list.space(decl.value);
var flexGrow = values[0];
var flexShrink = values[1] || '1';
var flexBasis = values[2] || '0%';
// Safari seems to hate '0%' and the others seems to make do with a nice value when basis is missing,
// so if we see a '0%', just remove it. This way it'll get adjusted for any other cases where '0%' is
// already defined somewhere else.
if (flexBasis === '0%') flexBasis = null;
decl.value =
flexGrow + ' ' + flexShrink + (flexBasis ? ' ' + flexBasis : '');
}
};

View File

@@ -0,0 +1,27 @@
var postcss = require('postcss');
module.exports = function(decl) {
var regex = /(\d{1,}) (\d{1,}) (calc\(.*\))/g;
var matches = regex.exec(decl.value);
if (decl.prop === 'flex' && matches) {
var grow = postcss.decl({
prop: 'flex-grow',
value: matches[1],
source: decl.source
});
var shrink = postcss.decl({
prop: 'flex-shrink',
value: matches[2],
source: decl.source
});
var basis = postcss.decl({
prop: 'flex-basis',
value: matches[3],
source: decl.source
});
decl.parent.insertBefore(decl, grow);
decl.parent.insertBefore(decl, shrink);
decl.parent.insertBefore(decl, basis);
decl.remove();
}
};

45
frontend/node_modules/postcss-flexbugs-fixes/index.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
var bug4 = require('./bugs/bug4');
var bug6 = require('./bugs/bug6');
var bug81a = require('./bugs/bug81a');
var doNothingValues = [
'none',
'auto',
'content',
'inherit',
'initial',
'unset'
];
module.exports = function(opts) {
var options = Object.assign({ bug4: true, bug6: true, bug81a: true }, opts);
return {
postcssPlugin: 'postcss-flexbugs-fixes',
Once: function(css, postcss) {
css.walkDecls(function(d) {
if (d.value.indexOf('var(') > -1) {
return;
}
if (d.value === 'none') {
return;
}
var values = postcss.list.space(d.value);
if (doNothingValues.indexOf(d.value) > 0 && values.length === 1) {
return;
}
if (options.bug4) {
bug4(d);
}
if (options.bug6) {
bug6(d);
}
if (options.bug81a) {
bug81a(d);
}
})
}
};
};
module.exports.postcss = true;

View File

@@ -0,0 +1,36 @@
{
"name": "postcss-flexbugs-fixes",
"version": "5.0.2",
"description": "PostCSS plugin This project tries to fix all of flexbug's issues",
"keywords": [
"postcss",
"css",
"postcss-plugin",
"flexbugs",
"flexbox",
"flex"
],
"author": "Luis Rudge <luis@luisrudge.net>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/luisrudge/postcss-flexbugs-fixes.git"
},
"main": "index.js",
"files": [
"bugs",
"index.js"
],
"peerDependencies": {
"postcss": "^8.1.4"
},
"devDependencies": {
"chai": "^4.2.0",
"gulp": "^4.0.2",
"gulp-eslint": "^6.0.0",
"gulp-mocha": "^7.0.2"
},
"scripts": {
"test": "gulp"
}
}