Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
postcss-structure
Advanced tools
francoisromain.github.io/postcss-structure
A PostCSS plugin to create grid systems based on a fixed column width.
Install the npm module:
$ npm install postcss-structure --save-dev
Require the PostCSS plugin:
postcss([ require('postcss-structure') ])
See PostCSS usage to setup with Gulp, Grunt, Webpack, npm scripts…
$ npm install postcss-cli --save-dev
Add a script to package.json:
"scripts": {
"build": "postcss -u postcss-structure -i src/styles.css -o dist/styles.css"
}
$ npm run build
Global settings rule (and default values):
@structure {
unit: 20.5rem, /* width of a single column */
gutter: 1.5rem, /* width of the gutter */
padding: 1.5rem, /* padding of the main container */
max: 8, /* maximum number of blocs (wide screens) */
min: 2, /* minimum number of blocs (mobile) */
align: center, /* center or left */
display: flex /* float or flex */
}
A media-query is created for each unit multiple, from min to max. When the screen is narrower than min * unit, elements are fluids.
structure: container
The container width is set for each media-query.
.my-container {
structure: container;
}
Example: input, output, markup, demo
structure: row
Rows are intended to contain either a bloc or a blob element. They have a negative right margin.
.my-row {
structure: row;
}
Example: input, output, markup, demo
structure: bloc [breakpoint]-[width](-[offset])
Blocs have a fixed width.
.my-bloc {
structure: bloc 3-2;
}
.my-bloc-with-offset {
structure: bloc 3-2-3;
}
Example: input, output, markup, demo
Example (with offset): input, output, markup, demo
structure: fraction [ratio]/[total]
.my-fraction {
structure: fraction 3/2;
}
Example: input, output, markup, demo
structure: blob [breakpoint]-[ratio]/[total]
Unlike blocs, blobs width will change depending on the breakpoint.
.my-blob {
structure: blob 3-2/3;
}
Example: input, output, markup, demo
structure: columns [breakpoint]-[columns](-[offset])
.my-columns {
structure: columns 3-4;
}
.my-columns-with-offset {
structure: columns 3-4-2;
}
Example: input, output, markup, demo
Example (with offset): input, output, markup, demo
structure: show [breakpoint]
.my-element {
structure: show 3;
}
Example: input, output, markup, demo
structure: hide [breakpoint]
.my-element {
structure: hide 3;
}
structure: right [breakpoint]
.my-element {
structure: right 3;
}
Example: input, output, markup, demo
@structure-media [breakpoint] {
.myClass {
…
}
}
@structure-media 0 { …
.FAQs
A bundle of PostCSS plugins.
The npm package postcss-structure receives a total of 0 weekly downloads. As such, postcss-structure popularity was classified as not popular.
We found that postcss-structure 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.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.