1
0
mirror of https://github.com/lensapp/lens.git synced 2024-09-19 13:27:36 +03:00

Fix scss compilation warning by removing flex.box dependency (#6411)

* Save only used selectors from flex.box library

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Remove flex.box dependency

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-10-14 16:56:54 +03:00 committed by GitHub
parent 19a18ebe2a
commit 07a775c32d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 115 additions and 7 deletions

View File

@ -385,7 +385,6 @@
"eslint-plugin-react": "7.31.10",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^2.0.0",
"flex.box": "^3.4.4",
"fork-ts-checker-webpack-plugin": "^6.5.2",
"gunzip-maybe": "^1.4.2",
"html-webpack-plugin": "^5.5.0",

View File

@ -7,7 +7,7 @@
@tailwind components;
@tailwind utilities;
@import "~flex.box";
@import "./flexbox";
@import "../themes/theme-vars";
@import "./fonts";

View File

@ -0,0 +1,114 @@
//-- Flexbox
.flex {
display: flex;
&.inline {
display: inline-flex;
}
&.fullsize {
width: 100vw;
height: 100vh;
}
&.column {
flex-direction: column;
&.reverse {
flex-direction: column-reverse;
}
}
&.reverse {
flex-direction: row-reverse;
}
&.wrap {
flex-wrap: wrap;
&-reverse {
flex-wrap: wrap-reverse;
}
}
&.auto {
> * {
flex: 1 1 0%;
}
}
&.center {
> * {
margin: auto;
}
}
$flex: flex-start flex-end center;
$justifyContent: join($flex, space-around space-between);
$alignContent: join($justifyContent, stretch);
$alignItems: join($flex, stretch baseline);
// align items in x-axis for flex=row (default) and in y-axis when flex=column mode
@each $mod in $justifyContent {
&.justify-#{$mod} {
justify-content: $mod;
}
}
@each $mod in $alignItems {
&.align-#{$mod} {
align-items: $mod;
}
}
@each $mod in $alignContent {
&.content-#{$mod} {
align-content: $mod;
}
}
// gaps
&.gaps {
$gap: var(--flex-gap, 1em);
&.column {
&:not(.reverse) > :not(:last-child) {
margin-bottom: $gap;
}
&.reverse > :not(:last-child) {
margin-top: $gap;
}
}
&:not(.column) {
&:not(.reverse) > :not(:last-child) {
margin-right: $gap;
}
&.reverse > :not(:last-child) {
margin-left: $gap;
}
}
}
// children
> .box {
&.grow {
flex: 1 0;
&-fixed {
flex: 1 0 0;
}
}
&.center {
margin: auto;
}
&.left {
margin-left: 0;
margin-right: auto;
}
&.right {
margin-right: 0;
margin-left: auto;
}
@each $mod in $alignItems {
&.self-#{$mod} {
align-self: $mod;
}
}
}
}

View File

@ -6098,11 +6098,6 @@ flatted@^3.1.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3"
integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==
flex.box@^3.4.4:
version "3.4.4"
resolved "https://registry.yarnpkg.com/flex.box/-/flex.box-3.4.4.tgz#cef28a542458f4668c5d499bcd7fa97aa82b8413"
integrity sha512-PG0rguh20zXyBuWmMmDCR0JjW9rtxK48OGMSzpLyGSRioTKeMNs9nbn1Dun+EsIp3wZozSpChbqMsU8a3IgHXg==
fn.name@1.x.x:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc"