
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
flex-wrap-layout
Advanced tools
Experimentations with flexbox and flex-wrap: wrap
to get rid of the classic and limited 12 columns grid (e.g. things like .col-md-6 { width: 50% }
).
Web technologies (HTML, CSS, JavaScript) are now used for creating complex GUIs (web apps vs web sites). Desktop tools and libraries like Qt have elegantly solved the problem for decades.
yarn add flex-wrap-layout
or npm install flex-wrap-layout
Import layout.scss or flex-wrap-layout.scss:
$layout-item-margin-y: $form-group-margin-bottom;
$layout-item-margin-x: $form-group-margin-bottom;
@import '~flex-wrap-layout/src/layout';
If you need to detect CSS flex wrap:
import { detectRowWrap } from 'flex-wrap-layout';
https://codepen.io/tkrotoff/pen/pWzKqZ
<form vspace>
<div layout="row" hspace vspace>
<div layout="column" vspace grow>
<div layout="row">
<label for="firstname" offset-with-content>First Name</label>
<input id="firstname" grow>
</div>
<div layout="row">
<label for="lastname" offset-with-content>Last Name</label>
<input id="lastname" grow>
</div>
</div>
<div layout="column" vspace grow>
<div layout="row">
<label for="arrival" offset-with-content>Arrival</label>
<input type="date" id="arrival" grow>
</div>
<div layout="row">
<label for="departure" offset-with-content>Departure</label>
<input type="date" id="departure" grow>
</div>
</div>
</div>
<div layout="row">
<div grow></div>
<div layout="row" hspace vspace>
<button>Save</button>
<button>Cancel</button>
</div>
<div grow></div>
</div>
</form>
Lines up child elements horizontally (QHBoxLayout equivalent).
<1> <2> <3>
Lines up child elements vertically (QVBoxLayout equivalent).
<1>
<2>
<3>
Grows the element if extra space is available, the element won't shrink below its natural width (QSizePolicy equivalent).
grow
:| <1> <2> <3> |
grow
attribute:| < 1 > <2> <3> |
Element 1 fills the extra space if any
grow
attribute:| <1> < 2 > < 3 > |
Elements 2 and 3 share the extra space if any
Vertical space (margin-bottom) between child elements (QLayout::spacing equivalent).
<1> instead of <1>
<2>
<2> <3>
<3>
Horizontal space (margin-right) between child elements (QLayout::spacing equivalent).
<1> <2> <3>
instead of <1><2><3>
<div grow></div>
)Stretchable blank space (QSpacerItem equivalent).
| <1> <2> <-> <3> |
| <1> <-> <2> <-> <3> |
I would like to right-align the labels of a form:
| < label> <input> | instead of | <label > <input> |
| < label> <input> | | <label > <input> |
Unfortunately it is not possible to detect when an element is wrapped in CSS:
| < label> | instead of | <label > |
| <input> | | <input> |
| < label> | | <label > |
| <input> | | <input> |
This would also solve other problems (all of them?).
To work around this, detectRowWrap()
is a JavaScript function that detects when an element is wrapped and lets you define the CSS that goes with it.
yarn build:examples:watch
open build/examples/demo.html
FAQs
Experiments with flexbox layout
The npm package flex-wrap-layout receives a total of 2 weekly downloads. As such, flex-wrap-layout popularity was classified as not popular.
We found that flex-wrap-layout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.