Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
bootstrap-margin-grid
Advanced tools
bootstrap-margin-grid.css
to your project and use classes.bootstrap-margin-grid.scss
to your project and generate columns based on simple fractions on-the-fly.Works with same markup as Bootstrap:
<div class="container">
<div class="row">
<div class="col-4">...</div>
<div class="col-4">...</div>
<div class="col-4">...</div>
</div>
</div>
...except it produces margins instead of padding.
Want background color on rows? Wrap your row in an element and apply bg color to it. This sucks but is still better than nesting a superfluous element inside of every single column.
<div class="container">
<div class="bg">
<div class="row">
<div class="col-4">...</div>
<div class="col-4">...</div>
<div class="col-4">...</div>
</div>
</div>
</div>
.bg {
background: tomato;
}
* If this gets any attention I'll match these to Bootstrap's mixins.
.custom-container {
@include container($max-width: 0, $padding: $grid-gutter-width);
}
.custom-row {
@include row();
}
.custom-column {
@include column(1, 2); // produces a column that takes up 1/2 its row
}
With padding-based grids (Boostrap, Foundation, etc.) if you want background color on rows, you need to nest an element inside each column.
This bloats markup quickly, especially when you need nested grids. For instance, a 2-column grid with a 2-column grid inside of one of the columns (not a crazy thing to want) looks like this with Bootstrap's grid:
<div class="container">
<div class="row">
<div class="col-sm-6">
<div>1</div>
</div>
<div class="col-sm-6">
<div>
<div class="row">
<div class="col-sm-6">
<div>1a</div>
</div>
<div class="col-sm-6">
<div>1b</div>
</div>
</div>
</div>
</div>
</div>
</div>
Notice all the superfluous <div>
s. This also still leaves row's overhanging their parent.
Can you imagine how insane this gets when you have real world project?
Here's a margin-based approach.
<div class="container">
<div class="bg">
<div class="row">
<div class="col-6">1</div>
<div class="col-6">
<div class="bg">
<div class="row">
<div class="col-6">1a</div>
<div class="col-6">1b</div>
</div>
</div>
</div>
</div>
</div>
</div>
https://youtu.be/ueZ6tvqhk8U?t=18
Less markup, better results, same markup scheme. There's no reason Bootstrap shouldn't switch over to margin grids.
I haven't tested to see if this is a drop-in replacement to Bootstrap's grid system. In fact, I'm pretty sure it's not. If this project gets popular I'll match all this stuff to Bootstrap perfectly so you actually can drop-in replace (assuming Bootstrap isn't heavily coupled to their padding-based grid -- lemme know if it is).
FAQs
Bootstrap's grid with margins.
The npm package bootstrap-margin-grid receives a total of 1 weekly downloads. As such, bootstrap-margin-grid popularity was classified as not popular.
We found that bootstrap-margin-grid 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.