Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@fylgja/auto-grid
Advanced tools
A super small grid with auto flowing behavior based on the container size. Using a similar method to container queries
A super small grid with auto flowing behavior, based on the container size.
Using a similar method to container queries.
This grid uses a minmax method, it fills the grid items based on the space available.
Where the min value is static value and the max value is 1fr
.
It creates a grid without needing to setup any columns and rows,
since the grid items will do this for you, following the content first approach!
npm install @fylgja/auto-grid
Then include the component in to your code via;
@use "@fylgja/auto-grid";
// Or via PostCSS import
@import "@fylgja/auto-grid";
The grid can be added by just adding the class .auto-grid
.
<div class="auto-grid">
<div>..</div>
<div>..</div>
</div>
In this example we have a container thats 800px
width,
using a default col size of 250px
this wil result in 3 equal columns,
even if there are only 2 child's to fill the space.
The third one is an empty placeholder, making the grid truly auto.
You can change the behavior by adjusting the min value and the gap via the CSS variables.
Do you want to use grid columns based on the viewport width instead?
Then add the var --cols
to take complete control of the grid cols.
Which allows you to build a static grid based on the viewport, on desktop and fallback to the auto-grid on mobile.
<style>
@media (min-width: 640px) {
#cool-products {
--cols: repeat(3, 1fr);
}
}
</style>
<div id="cool-products" class="auto-grid">
<div>..</div>
<div>..</div>
</div>
Do you want more control over the Auto Grid CSS variables, modify the following SCSS variables.
$auto-grid-cols: 250px !default;
$auto-grid-gap: 1em !default;
[1.1.0] - 2021-10-10
FAQs
A super small grid with auto flowing behavior based on the container size. Using a similar method to container queries
The npm package @fylgja/auto-grid receives a total of 9 weekly downloads. As such, @fylgja/auto-grid popularity was classified as not popular.
We found that @fylgja/auto-grid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.