Bootstrap CSS Framework Templates & UI Kits https://speckyboy.com/category/bootstrap/ Design News, Resources & Inspiration Wed, 27 Dec 2023 14:35:02 +0000 en-US hourly 1 The 40 Best Free Bootstrap Themes for 2024 https://speckyboy.com/free-bootstrap-framework-templates/ https://speckyboy.com/free-bootstrap-framework-templates/#respond Thu, 19 Oct 2023 15:53:10 +0000 http://speckyboy.com/?p=49167 A collection of the best free Bootstrap 5 templates for you to use on your next web project. All templates come bundled with added extras.

The post The 40 Best Free Bootstrap Themes for 2024 appeared first on Speckyboy Design Magazine.

]]>
Bootstrap is the most popular CSS framework ever. It is currently used on over 22% of all sites on the web, and despite the rapid rise in popularity of front-end JavaScript frameworks, it continues to grow. And with each new version (currently v5.0), it gets better and better.

Built on a mobile-first twelve-column grid system, bundled with an endless list of components, utilities and helpers, and add in the fact that it is easy to customize and extend, it is no wonder that web designers and developers continue to use and love Bootstrap. It truly is the perfect framework for quickly getting started on any type of web project.

To help make life easier for you, we have collected forty of the best free Bootstrap 5 templates for you to use on your next project. We have purposefully omitted all of those starter and barebones templates from this collection, of which there is already a multitude available on the web. Instead, we have focused on highlighting all of those fully-featured, beautifully designed, and of course, free Bootstrap templates that you can use straight away.

All of the responsive templates come packaged with pre-styled ‘ready to use’ components, and many have come bundled with additional extras, like charting libraries, pricing tables, tabs, and much more. All of these templates will save you hours of extra work and are all waiting for you to add your content and creativity.

If you’re new to Bootstrap, the best place to learn how to use the framework is to follow the steps on the official quick start guide, and you’ll be up and running in no time.

You might also our collections of Bootstrap Admin templates and Bootstrap UI kits.


The post The 40 Best Free Bootstrap Themes for 2024 appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/free-bootstrap-framework-templates/feed/ 0
25 Free Bootstrap Dashboard & Admin Templates for 2024 https://speckyboy.com/free-bootstrap-admin-themes/ https://speckyboy.com/free-bootstrap-admin-themes/#respond Wed, 18 Oct 2023 21:20:54 +0000 http://speckyboy.com/?p=48862 These pre-built free Bootstrap templates have been designed as a complete solution for the admin area or dashboard of your web application.

The post 25 Free Bootstrap Dashboard & Admin Templates for 2024 appeared first on Speckyboy Design Magazine.

]]>
In the past, the admin sections of web applications were often built with functionality as the only priority, with little or no consideration given to the design. Thankfully, times have changed, and in recent years, there has been a pleasing convergence of powerful functionality and beautiful design. This trend has been aided by the popularity of the Bootstrap framework, which has made it easier than ever to create attractive and functional admin dashboards.

So why use Bootstrap? With Bootstrap, you know exactly what you’re getting. It’s a mobile-first framework that is relatively easy to customize, with pre-built design patterns and a vast library of components and widgets. More importantly, your Bootstrap build will be consistent across all screen sizes, devices, and browsers. It makes sense to use something that you know will work well when building the dashboard or admin panel of your web application.

The free Bootstrap admin and dashboard templates below have been pre-built as complete solutions, allowing you to rapidly create the front-end dashboard of your application. They include all of Bootstrap’s widgets and many additional addons, plugins, and features for charts, graphs, calendars, file managers, and more—everything you need to build powerful, professional, and responsive dashboards.

You might also like our collection of Bootstrap UI kits and Bootstrap templates.


The post 25 Free Bootstrap Dashboard & Admin Templates for 2024 appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/free-bootstrap-admin-themes/feed/ 0
20 Free Bootstrap UI Kits https://speckyboy.com/free-bootstrap-ui-kits/ https://speckyboy.com/free-bootstrap-ui-kits/#respond Wed, 18 Oct 2023 05:50:21 +0000 https://speckyboy.com/?p=105069 A collection of the best free Bootstrap 4 & 5 UI kits that you can use as the starting point of your next web design project.

The post 20 Free Bootstrap UI Kits appeared first on Speckyboy Design Magazine.

]]>
Bootstrap is undoubtedly one of the most popular design frameworks available today. It’s optimized for mobile devices and boasts a well-organized grid system, along with hundreds of components, elements, and plugins that make designing and prototyping for the web a breeze.

Bootstrap offers a wide range of UI kits and templates that are perfect for any design project, from minimal startup websites to complex admin screens. With its responsive design, you can create stunning web pages and applications that look great on any device.

If you’re looking for inspiration or need a head start on your next web project, take a look at our collection of free Bootstrap UI kits (version 4 and version 5 of Bootstrap). Whether you’re a designer or developer, these UI kits can help you create beautiful and functional web pages and applications quickly and easily.

You might also our collections of Bootstrap templates and Bootstrap Admin themes.


The post 20 Free Bootstrap UI Kits appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/free-bootstrap-ui-kits/feed/ 0
Bootstrap Turns 10: A Look at Its Impact on the Web https://speckyboy.com/bootstrap-turns-10/ https://speckyboy.com/bootstrap-turns-10/#respond Tue, 31 Aug 2021 11:49:00 +0000 https://speckyboy.com/?p=131080 With a decade under its belt, we take a look at the overall impact Bootstrap has had on the web. A blessing, curse, or somewhere in-between?

The post Bootstrap Turns 10: A Look at Its Impact on the Web appeared first on Speckyboy Design Magazine.

]]>
In the web design industry, it’s rare that a tool stays relevant for a decade or more. Things tend to change so quickly that the useful life of an app or framework usually isn’t very long. However, Twitter’s Bootstrap has defied those odds.

Now in existence for over 10 years, the self-described “front-end open source toolkit” is used on over 22% of all websites. And we see it included everywhere from customized UI kits to WordPress themes.

Why has Bootstrap been able to reach such heights? For one, it comes packed with virtually everything designers need to craft a clean, responsive UI. Plus, the fact that it continues to be actively developed and evolve means that web professionals can reliably come back to it again and again.

With a decade under its belt, this is a good time to look at the overall impact Bootstrap has had on the web. Has it been a blessing, curse, or somewhere in-between?

A Tool for Rapidly Implementing an Established Look and Feel

The biggest advantage Bootstrap provides is the ability to implement an established look and feel. Right out of the box, you have a set of UI elements and components that cover just about every use case. It doesn’t matter if you’re selling t-shirts or blogging about your favorite video games – the framework gives you a massive head start on the design.

In addition, Bootstrap is extensible. It’s built with customization in mind, making it a fairly straightforward process to change various components to meet your needs. Creating your own components is also possible.

That goes beyond individuals performing one-off tweaks for a specific project. It also extends to theme developers. They can leverage the framework to bring a familiar front-end UI to content management systems (CMS).

Yet, customization is still optional. If your goal is to design and deploy a project quickly, just installing Bootstrap (or an offshoot UI kit) and familiarizing yourself with its contents is all you need.

This level of convenience and flexibility has undoubtedly played a large role in Bootstrap’s enduring popularity.

Bootstrap Framework Snippets page.

The Bootstrapping of the Web

Bootstrap does its intended job quite well. Perhaps a little too well.

As we mentioned, the usage statistics point to nearly a quarter of all websites utilizing the framework. When a UI is so widespread, it’s bound to lead to some sameness when it comes to design.

Much like the early days of the CMS, it’s often easy for the trained eye to pick out elements of Bootstrap within a website. You start to notice the same buttons, navigation styles, and pricing tables. Even sites that don’t use it may well attempt to duplicate certain aspects of the look.

To be sure, it’s generally clean, accessible, and easy to read. While that can be considered a good thing, there’s also a bit of a downside. And it isn’t necessarily an issue with Bootstrap itself.

Rather, it’s about designers either accepting its default styles or changing them only minimally. The result is a web that is becoming increasingly homogeneous.

Bootstrap Feature examples.

Inspiring a New Category of Frameworks

Perhaps it’s a testament to how well put together Bootstrap is. There aren’t a bunch of shortcomings that need fixed. Everything works as intended right from the start.

With that, some designers may not feel the need to radically change anything. One could even argue that it goes against the very point of the framework in the first place.

Unlike a lot of tools aimed at the web design community, Bootstrap has a universal appeal. There is no particular niche that it can’t fit into. That’s a key to its massive adoption rate. And it has inspired an entire category of CSS and JavaScript frameworks.

Other worthy competitors have popped up in recent years, such as Tailwind CSS. It has a similar appeal. However, it differs in that it’s more “utility” based. The various elements are all there, but depend on the designer to customize them to fit a need.

Bootstrap is unabashedly opinionated in its design. Tailwind CSS goes in the opposite direction. If anything, this provides designers with two great options, depending on their own preferences.

Design from the ground up or implement a completely polished UI – the choice is yours.

Bootstrap Theme listing.

A Behind-the-Scenes Powerhouse

Maybe the most impressive aspect of Bootstrap’s 10-year rise is that it’s a completely developer-focused tool. That is, you interact with its code and view the results on the front end. That’s opposed to, say, WordPress, where users create content and install custom functionality via a back-end dashboard.

The framework is generally of interest to professionals. Thus, it relies on web designers for growth. It doesn’t have the same public-facing profile of a CMS.

That says a lot about what Bootstrap has done right over the past decade. To win over a sizeable portion of this industry is no small task. To maintain it and continue to grow for this long is even more telling.

What will the future bring? We don’t have all the answers. But, whatever happens, it’s likely Bootstrap will still play a significant role in web design for years to come.

The post Bootstrap Turns 10: A Look at Its Impact on the Web appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/bootstrap-turns-10/feed/ 0
10 Super-Useful Bootstrap 4 Code Snippets https://speckyboy.com/bootstrap-4-code-snippets/ https://speckyboy.com/bootstrap-4-code-snippets/#respond Thu, 14 Jan 2021 19:32:46 +0000 https://speckyboy.com/?p=98287 These CSS snippets highlight some of the coolest examples of what Bootstrap 4 can do. If you want explore the updated framework, you’ll love this.

The post 10 Super-Useful Bootstrap 4 Code Snippets appeared first on Speckyboy Design Magazine.

]]>
If you’ve done any frontend development then you’ve heard of Bootstrap. It is by far the most significant framework for web developers with the most features out there.

The newer Bootstrap 4 is super easy to use and it even works with many free templates you can find online. But the team has made quite a few changes to BS 4 and there’s a lot of new goodies.

These snippets are some of the coolest examples to showcase what BS4 has to offer. If you want to dive into this newly updated framework, then you’ll love this collection.



1. Life’s A Beach

Take a look at this beachy concept theme created by developer Edd Yerburgh. It shows that you can have a lot of fun working with Bootstrap if you know your way around the library.

In this demo you’ll find page elements for pretty much everything. Cards, buttons, grids, you name it. And the whole thing runs on the latest version of BS4, so the aesthetics are marvelous.

Note this isn’t a theme for Bootstrap, but rather a starting point. You could think of it as a mini-theme showing what Bootstrap has to offer.

2. What’s New In BS4

Here’s another really cool example showing off the goodies in Bootstrap. In this pen you’ll find a minimalist layout with tons of little tidbits on the latest & greatest UI elements.

The code itself is pretty easy to dig through so you can find lots of examples to rework for your own sites.

But the coolest part is lower on the page with links to components and sample page elements. These are great for working into your own projects since they’re clean & easy to restyle.

Certainly a cool snippet but it’s also just a taste of what you get with Bootstrap.

3. Pricing Table

Online sales would plummet without great pricing tables. And thanks to this free snippet by Daniel Zawadzki we can all make killer responsive pricing tables on the BS4 codebase.

This design is really simple and doesn’t use too much color. It’s the best way to rework a template from scratch since you don’t have to worry about changing too much outside of the layout.

4. BS4 Grid rem Demo

Developer Nicholas Cerminara created this grid demo using Bootstrap 4 and the newer rem unit.

The code works primarily in CSS, but there is a small bit of JavaScript so you can switch between font sizes. This way you can see how the grid auto-scales to suit the needs of your fonts. Pretty cool!

And it’s even cooler since this runs natively in the Bootstrap framework. If you dig into the code on this one, you’ll learn a lot about rems in CSS.

5. NgAudio Player in BS4

The ngAudio script is used in Angular projects for audio players. It’s a popular choice for sounds on the web and this cool snippet combines the ngAudio script with a Bootstrap 4 layout.

Awesome? Totally. Useful? Depends on your project.

If you aren’t a big AngularJS user then this probably won’t interest you. But it’s an interesting merger of the BS4 frontend along with the Angular controller.

6. Profile Card

Here’s a pretty simple project that’s a great practice piece for anyone new to Bootstrap. Developer Nicola Pressi created this profile card with just HTML and CSS code, all of which is based off this Dribbble shot.

I’ve gotta say, it’s pretty darn accurate!

Granted you wouldn’t need Bootstrap to make this from scratch. But it certainly helps to save time, and it’s a great example of BS4 in action.

7. Dynamic Loading Bar

For this demo Noriyo Akita created a progress bar using some jQuery and Bootstrap code. However this one still runs with the BS4 Alpha 3 release so it’s using a slightly outdated version before the beta came out.

Still, I have to say this thing is cool. It doesn’t use the default HTML5 progress element and instead uses buttons that fill up depending on where you click.

This could work with any type of project from basic form steps to checkout pages.

8. Floating Label Fields

It seems like floating labels have quickly become the hottest trend on the modern web. These often save space in your forms and they animate around each input field once the user starts typing.

Have a look at this example coded by Anton Staroverov for a demo running on Bootstrap. It comes with all the typical behaviors you’d expect of floating labels, but with the added benefit of Bootstrap’s awesome framework.

9. BS4 Starter Template

Looking for a simple way to dive into Bootstrap & start playing around? Then check out this starter template and see what you think.

It’s super short and really basic. However, it’s probably the best template you’ll find offering clean BS4 code and very few customizations. That means what you see is mostly the default BS4 style. Cool right?

10. Navbar With Dropdowns

For something a little more complex have a gander at these awesome dropdowns coded with Bootstrap 4. Developer Paweł Wojtas is using some jQuery along with custom animations to create menus that drop into view with style.

Plus the navbar itself stays fixed while you scroll, so the dropdowns are easy to access from anywhere.

This can make a fantastic template if you aren’t sure where to start with your next Bootstrap project.

In fact, the same can be said for all of these superb BS4 code snippets!

The post 10 Super-Useful Bootstrap 4 Code Snippets appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/bootstrap-4-code-snippets/feed/ 0
45 Plugins, Addons & Components for the Bootstrap Framework https://speckyboy.com/plugins-for-extending-bootstrap/ https://speckyboy.com/plugins-for-extending-bootstrap/#respond Sun, 16 Jun 2019 10:51:19 +0000 http://speckyboy.com/?p=49574 Get the most out of the Bootstrap framework with these free components and addons. Buttons, breadcrumbs, calendars, menus, and more.

The post 45 Plugins, Addons & Components for the Bootstrap Framework appeared first on Speckyboy Design Magazine.

]]>
Bootstrap is already pre-packaged with a vast selection of useful tools, extensions and components, and is more than enough to kick-start most web design or web application projects.

But there will be times when the bundled components are not enough for your needs. That is where this article comes in. We have a collection of plugins, addons, and components that will allow you to extend Bootstrap further.

Rather than group the extensions and components into relevant categories, as we usually would, we have instead opted to create an A-Z listing, which should make it much easier for you to find the particular addon you are looking for.

Everything you could need is included below, from buttons, breadcrumbs, and calendars, to tree menus, video players, and WYSIWYG editors.

Accessibility

Accessibility Plugin – This plugin adds accessibility mark-up to the default components of Bootstrap. Components include Alert, Tooltip, Popover, Modal Dialog, Dropdown Menu, Tab Panel, Collapse, and Carousel.

Breadcrumbs

Bootstrap-Breadcrumb – A Bootstrap JavaScript plugin that allows you to programmatically manipulate breadcrumb navigation.

Calendar

Bootstrap-Calendar – A Full view calendar based on Bootstrap.
Full view calendar addon Twitter Bootstrap

Carousel

Bootstrap Modal Carousel – A collection of plugins for displaying a carousel in fullscreen modal window.
collection plugins displaying carousel fullscreen modal window extending Bootstrap

Checkbox

prettyCheckable – A jQuery plugin for replacing the default checkboxes and radio inputs.
jQuery plugin replacing default checkboxes radio inputs

Color Picker

Simple Color Picker – A very simple and lightweight (200 lines of JavaScript and 100 lines of CSS) jQuery color picker for Bootstrap.
simple lightweight jQuery color picker Bootstrap

Combobox

Bootstrap Combobox – A combobox plugin that integrates well with Bootstrap.
combobox plugin integrates extension addon Bootstrap

Contact Form

Bootstrap-Contact – A simple PHP contact form using Bootstrap and the jQuery validation plugin.


jQuery Gridform – A jQuery plugin for creating complex table-based forms with Bootstrap.
jQuery plugin creating complex table based forms addon Bootstrap

Datepicker

Datepicker – A plugin for adding a date picker field to any element.
plugin adding datepicker field element addon


Date Range Picker – This date range picker component creates a drop-down from which you can select a range of dates.
date range picker component creates drop-down select range dates Extending Bootstrap


ClockPicker – A unique clock-style timepicker for Bootstrap.
unique clock style timepicker Bootstrap

Dialog Boxes & Alerts

Bootbox.js – A small JS library that allows you to create programmatic dialog boxes using Bootstrap’s modals.
small javascript library create programmatic dialog boxes Bootstraps modals windows


Bootstrap Prompts – An plugin to replace the alert(), prompt(),confirm() notifications on the browser when using Twitter Bootstrap with modals.
Bootstrap Prompts plugin replace basic alert


Bootstrap Confirmation – A plugin that replaces popovers with confirmation dialogs.
plugin replaces popovers confirmation dialogs

File Upload

jQuery File Upload – A file upload widget that features multiple file selection, drag & drop, progress bars, validation and preview images.
file upload widget which features multiple file selection drag and drop progress bars

Form Validation

BootstrapValidator – A jQuery plugin for vaildating forms within Bootstrap.
jQuery plugin vaildating forms addon extension Bootstrap


jqBootstrapValidation – Another jQuery validation framework for Bootstrap forms.
jqBootstrapValidation Another jQuery validation framework Bootstrap


Validator – A simple and user-friendly form validator plugin for Bootstrap.
 simple user-friendly form validator plugin addon Bootstrap

HTML Tables

Tablecloth.js – Building off Bootstrap, this is is a jQuery plugin that helps you easily style HTML tables.
jQuery plugin that helps you style easily HTML tables


Navigable Table – A Bootstrap plugin for smooth navigation across table inputs.
Bootstrap plugin smooth navigation across table inputs

Image Gallery

Image Gallery – This plugin shows images and videos in the modal dialog of the Bootstrap. It features swipe, mouse & keyboard navigation, transition effects, fullscreen support, and on-demand content loading.
plugin shows images videos modal dialog Bootstrap

In-Place Editing

X-editable – A library that allows you to create editable elements on your Bootstrap page.
library create editable elements Bootstrap page

Layout Grid

jQDrawBootstrapGrid – A simple jQuery plugin that draws grid columns to a Bootstrap enabled layout.
simple jQuery plugin draws grid columns Bootstrap enabled

Magnify

Magnify – A JS plugin for adding a magnifying glass to images on mouseover.
javascript plugin adding magnifying glass images mouseover

Modal Windows

Bootstrap Modal – This plugin extends Bootstrap’s native modals to provide additional functionality (responsive, stackable, Ajax…).
plugin extend Bootstrap native modals


Bootstrap Scroll Modal – A modification of the Bootstrap Modal plugin that allows for unlimited modal height with full page scrolling.
modification Bootstrap Modal plugin unlimited modal height full page scrolling

Navigation

Contextmenu – A context menu plugin for Bootstrap.
context menu plugin Bootstrap

Pagination

bootpag – A jQuery plugin helps you create dynamic pagination with Bootstrap.
jQuery plugin create dynamic pagination Bootstrap

Progress Bars

Bootstrap Progressbar – A multi-color progress bar component for Bootstrap.
multi-color progressbar component addon Bootstrap

Ratings

Bootstrap Star Rating – A jQuery star rating plugin for Bootstrap that supports fractional star fill and RTL input support.
jQuery star rating plugin Bootstrap

Social Buttons

Social Buttons for Bootstrap – A pure CSS social sign-in button library.
pure CSS social sign-in button library for bootstrap

Selects

bselect – A plugin for styling the <select> element in Bootstrap.
plugin styling select element Bootstrap


Bootstrap Multiselect – A jQuery-based plugin for using select inputs with the multiple attributes.
jQuery based plugin using select inputs


MultiSuggest – A useful plugin that extends the default Bootstrap Typeahead component.
useful plugin extends default Bootstrap Typeahead component

Tags

Bootstrap Tags – A jQuery plugin for adding tagging functionality Bootstrap.
jQuery plugin adding tagging functionality Bootstrap


Tokenfield – An advanced tagging jQuery plugin for Bootstrap with its focus on keyboard navigation and copy/paste support.
advanced tagging jQuery plugin component Bootstrap

Table of Contents

Tocify – A jQuery plugin that dynamically generates a table of contents. It can be optionally styled with Bootstrap or jQueryUI Themeroller.
jQuery plugin dynamically generates table contents extending bootstrap

Tabs

Tabcordion.js – A simple jQuery plugin that transforms a set of Bootstrap tabs into a Bootstrap accordion.
simple jQuery plugin transforms Bootstrap tabs into Bootstrap accordion


tabcollapse – A plugin that switches the Bootstrap Tabs component to collapse for small screens.
plugin switches Bootstrap Tabs component collapse small screens

Tree Menu

EasyTree – A very basic tree-view jQuery plugin for Bootstrap.
very basic tree-view jQuery plugin addon extension Bootstrap


BootstrapTreeNav – A Javascript plugin for Bootstrap for creating tree navigation menus.
Javascript plugin Bootstrap creating tree navigation menus

Website Tour

Bootstrap Tour – A quick and easy way to build your product tours with Bootstrap Popovers.
quick easy way build your product tours with Bootstrap Popovers

WYSIWYG

bootstrap-wysihtml5 – A Javascript plugin that makes it easy to create simple WYSIWYG editors.
Javascript plugin easy create simple WYSIWYG editors


Summernote – A simple WYSIWYG editor for Bootstrap.
simple WYSIWYG editor for Bootstrap component

The post 45 Plugins, Addons & Components for the Bootstrap Framework appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/plugins-for-extending-bootstrap/feed/ 0
How to Replicate the Bootstrap 3 Grid Using CSS Grid https://speckyboy.com/replicate-bootstrap-grid-using-css-grid/ https://speckyboy.com/replicate-bootstrap-grid-using-css-grid/#comments Mon, 26 Feb 2018 17:50:56 +0000 https://speckyboy.com/?p=96590 The past few years have seen a wide variety of methods for creating web page layouts. CSS Grid is one of the newest and probably the most game-changing layout technique...

The post How to Replicate the Bootstrap 3 Grid Using CSS Grid appeared first on Speckyboy Design Magazine.

]]>
The past few years have seen a wide variety of methods for creating web page layouts. CSS Grid is one of the newest and probably the most game-changing layout technique at our disposal. If you haven’t begun tinkering with it yet, now’s the time. It is a wildly different way of thinking about positioning content, and it currently has nearly full support across all popular web browsers.

In order to replicate the majority of the features of the Bootstrap 3 grid system, we only require a small portion of the features that CSS Grid has to offer.

The key concept introduced in the Bootstrap 3 grid system, which we will be replicating, is the ability to explicitly define a grid container’s proportions for each responsive breakpoint. In comparison, Bootstrap 2 only set the proportions for desktop, and any viewport smaller than 767px would render all grid items at full width, stacked vertically, in a single column.

To begin, we can define our class names similar to those used in Bootstrap 3:

  • .row for a grid container
  • .col-[screenSize]-[numColumns] for a grid item where [screenSize] is one of our size abbreviations (xs,sm,md,lg,xl) and [numColumns] is a number from 1 to 12

To use CSS Grid, we simply apply display: grid to our row class:

.row{
 display: grid;
}

Next, we can define the number of columns in our grid and the size of the gutters (the space between items/columns). Bootstrap uses 12 columns with 15px gutters:

.row{
 display: grid;
 grid-template-columns: repeat(12, 1fr);
 grid-gap: 15px;
}

repeat(12, 1fr) is shorthand for “1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr” where ‘fr’ is a fractional unit. Setting all 12 of our columns to 1fr means they will all be the same width. By changing these values, we could easily create a grid with a different number of columns, or with columns of varying widths.

We now have our grid container defined, and it is time to set the grid items that will go into it. To do so we need to only set the grid-column-end property for each variation of the grid item. Setting it to a value of span 1 would make the item one column wide. span 6 would make it 6 columns wide, half of our 12 column grid.

There is much more that we could achieve with this property. I encourage you to explore the possibilities and understand that we are only scratching the surface in this demo.

The most complicated task we have to do is fill out all of the different span sizes at all of the different breakpoints. The pattern is as follows:

@media (min-width: 0) {
 .col-xs-1 {
   grid-column-end: span 1;
 }
 .col-xs-2 {
   grid-column-end: span 2;
 }
 .col-xs-3 {
   grid-column-end: span 3;
 }
 ...up to .col-xs-12
}
@media (min-width: 768px) {
 .col-sm-1 {
   grid-column-end: span 1;
 }
 .col-sm-2 {
   grid-column-end: span 2;
 }
 .col-sm-3 {
   grid-column-end: span 3;
 }
 ...up to .col-sm-12
}
...repeat for 'md' at 992px and 'lg' at 1200px

Once we understand the pattern, it is simple enough to build it with a nested loop in Sass, like so:

// Loop through responsive breakpoints
@each $size, $abbr in (0,xs),(768px,sm),(992px,md),(1200px,lg){
 @media (min-width: $size){
   // Loop through col classes
   @for $i from 1 through 12{
     .col-#{$abbr}-#{$i}{
       grid-column-end: span $i;
     }
   }
 }
}

All that remains is to set a full width default for situations where the width is not defined. For example, a grid item with the classes “col-md-4, col-sm-6” does not have a width defined when the viewport is smaller than 768px (the sm breakpoint).

However, it is defined for viewports larger than 992px (the md breakpoint) because the media query will continue applying the width for all viewports wider than 992px unless it is overridden by defining the lg width.

Rather than requiring devs to assign xs width to every item, we can safely make it full width as a default that the user can override if they choose to.

[class^=col-]{
 grid-column-end: span 12;
}

This style rule will apply to any element with a class that begins with “col-” and set a 12 column width. The rule will be placed above our nested loop to ensure that the other grid styles override it.

See it all in action:

Advantages Over Bootstrap 3

This CSS Grid implementation has several advantages over Bootstrap 3’s grid:

1. All items in a row match the height of the tallest item.

  • In Bootstrap 3, varying item heights would cause wrapping items to be improperly positioned, and it was a big headache.

2. No need for element inside item to utilize gutter.

  • Bootstrap 3’s gutter was applied to content within the item container not to the container itself. If you wanted a border or background color on the items to have the gutter space between them, you’d have to include another element within the grid item.
  • In CSS Grid, you can apply borders and backgrounds directly to the item and it will leave the gutter empty.

3. No awkward rounded percentages.

  • Bootstrap 3 relied on meticulously rounded percentages with repeating decimals.
  • CSS Grid uses explicitly defined fractions and does the math for us.

4. No negative margin hacks.

  • Bootstrap 3 gutters were carefully crafted with padding on each item and negative margins applied to the row to negate the padding on the first item of each row.
  • CSS Grid provides proper gutters out of the box.

5. No clear-fix hacks.

  • Bootstrap 3 grid items were floated left for wrapping and relied on the clearfix hack to push down content below.

Start using CSS Grid today!

The post How to Replicate the Bootstrap 3 Grid Using CSS Grid appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/replicate-bootstrap-grid-using-css-grid/feed/ 1
Bootstrap Version 3 Has Been Released! https://speckyboy.com/bootstrap-version-3-rc1-is-out/ https://speckyboy.com/bootstrap-version-3-rc1-is-out/#respond Mon, 29 Jul 2013 08:05:55 +0000 http://speckyboy.com/?p=39635 Twitter Bootstrap, the powerful framework that is loved by developers all around the world, has just a couple of days ago taken the first step towards a major upgrade. The...

The post Bootstrap Version 3 Has Been Released! appeared first on Speckyboy Design Magazine.

]]>
Twitter Bootstrap, the powerful framework that is loved by developers all around the world, has just a couple of days ago taken the first step towards a major upgrade. The first release candidate for version 3 is out!

Bootstrap Version 3

While you still have access to the previous version, the new version 3 will soon be replacing its predecessor. In terms of changes, Bootstrap 3 brings many new tasty dishes to the table: there have been roughly 16,00 commits, 72,000 additions and deletions as well as nearly 300 file changes. If you are looking for the complete list of changes and a migration guide, check this out.

Bootstrap 3 Homepage

You can get your hands on the release candidate over here. RC1 will, most likely, be followed by an RC2, which shall then pave way for the final version. So keep your eyes and ears open, and watch out for the new ideas that Bootstrap 3 will bring to web development.

The post Bootstrap Version 3 Has Been Released! appeared first on Speckyboy Design Magazine.

]]>
https://speckyboy.com/bootstrap-version-3-rc1-is-out/feed/ 0