By Tony Boutemeur on Saturday, 10 August 2019
Posted in General
Replies 11
Likes 0
Views 818
Votes 0
Hello the Team,

As you know, joomla 4 will be at the end of this year 2019.

I red everywhere "the future of joomla 4 is css grid and not bootstrap 4".

I played with Cassiopea the default frontend template in joomla 4 and I made some template test with css-grid in joomla 3 and it's very interesting.

Bootstrap 4 will be only for backward compatibility.

Css grid allows designers and developers to place items (HTML elements) in a grid-based layout using columns and rows and furthermore allows you to lay out the elements of your design independently of their document source order.

I red css grid was more manageable (3 dimensions) and lightweight than bootstrap 3/4 and all frameworks (T3/T4, helix, ...).

Did you plan to propose some stackideas templates based on css grid for the next months?

Tony
Hello Tony,

Our extensions styles should work fine out of the box with Joomla 4 as we use our own css styles instead of relying on the platform.

We have been building and working on extensions for almost a decade now and one thing we learnt during this process is to never rely on frameworks defined on the platform. This is exactly why regardless of what framework Joomla 4 / 5 / 6 uses, our styles would never completely fail on us (I can foresee there are probably some minor conflicts but that's just about it)
·
Saturday, 10 August 2019 17:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Thank you for your reply.

Indeed, each stackideas extension have is own style.css

I red we could replace bootstrap.min.css/bootstrap.js with ccs-grid.css for getting better and more lightweight.

Bootstrap is:

- Bootstrap is too verbose: you need plenty of div even if you only have a couple of blocks in your layout
- Things get even worse when you add responsiveness…
- … or when you want to move your blocks around
- Bootstrap’s grids are limited to 12 columns
- By default, Bootstrap has 10-pixel paddings that are complex to override
- Bootstrap has to be downloaded by the users, which slows down your website

I made a test (please find my attachment)

with css code


body {
margin: 0;
padding: 0;
}
.grid-container {
display: grid;
grid-template-columns: 420px 1fr 420px;
grid-template-rows: 56px 1fr 56px;
grid-template-areas: "header header header" "left-sidebar component right-sidebar" "footer footer footer";
}

.header {
display: grid;
grid-template-columns: 420px 1fr 420px;
grid-template-rows: 1fr;
grid-template-areas: "logo search notifications";
grid-area: header;
}

.logo {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr;
grid-template-areas: ". . .";
grid-area: logo;
border: solid 1px;
}

.search {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr;
grid-template-areas: ". . .";
grid-area: search;
border: solid 1px;
}

.notifications {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr;
grid-template-areas: ". . .";
grid-area: notifications;
border: solid 1px;
}

.footer {
display: grid;
grid-template-columns: 420px 1fr 420px;
grid-template-rows: 1fr;
grid-template-areas: "footer-1 footer-2 footer-3";
grid-area: footer;
}

.footer-1 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr;
grid-template-areas: ". . .";
grid-area: footer-1;
border: solid 1px;
}

.footer-2 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr;
grid-template-areas: ". . .";
grid-area: footer-2;
border: solid 1px;
}

.footer-3 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr;
grid-template-areas: ". . .";
grid-area: footer-3;
border: solid 1px;
}

.left-sidebar {
grid-area: left-sidebar;
border: solid 1px;
}

.right-sidebar {
grid-area: right-sidebar;
border: solid 1px;
}

.component {
grid-area: component;
border: solid 1px;
}


and html code


<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/style.css">
<title>Title</title>
</head>

<body>

<div class="grid-container">
<div class="header">
<div class="logo">Logo</div>
<div class="search">Search</div>
<div class="notifications">Notifications</div>
</div>
<div class="left-sidebar">Left</div>
<div class="component">Component</div>
<div class="right-sidebar">Right</div>
<div class="footer">
<div class="footer-1">Footer1</div>
<div class="footer-2">Footer2</div>
<div class="footer-3">Footer3</div>
</div>
</div>
</body>
</html>


In addition, css grid is compatible with the major browser as you can see in my second attachment

What about the next future stackideas template? For instance in Echo template or Elegant or Wanderer, there are bootstrap 3.3.7 integrated.

Do you think it could be a good alternative for getting a better lightweight website with a css grid template for joomla in the future?

Thanks for your advice.
·
Saturday, 10 August 2019 18:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, moving forward it would be great if we can move away from Bootstrap but it's not going to be as simple as that. There are going to be a lot of backward compatibility patches which we need to retain for template clubs and also other 3rd party integrations as well

The idea is simple but it's more complicated when it involves an entire ecosystem.
·
Monday, 12 August 2019 15:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

It works, please find my attachment.

I am able to reproduce your Office template with bootstrap unset:


// Include the main simplified framework
require_once(__DIR__ . '/framework.php');
require_once(__DIR__ . '/helper.php');

unset($doc->_scripts[$this->baseurl . '/media/jui/js/bootstrap.min.js']); // Remove joomla core bootstrap
$theme = new AlphaTemplate();


Please find my attachment.
·
Tuesday, 13 August 2019 15:39
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Tony,

I understand that it's easy to unset it from rendering but if a 3rd party extension relied on it, customers are going to be complaining about the template and not the extension
·
Wednesday, 14 August 2019 12:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mark,

Yes you're right about 3rd party components and Bootstrap.

I have just unset bootstrap for test.

For instance, techjoomla components need bootstrap for styling.

I played with css grid and I have got something pretty close to your real Office template (please find my attachment).
Concerning #sidebar-toggler, I use Vertical menu module from Offjlan.

I think, it's very usefull and interesting if a joomla template do without bootstrap for getting a website more lightweight, speed and customizable.

About 3rd party components using bootstrap, if I am able to create a css grid style for each instead bootstrap, it could be interesting too. I have to analyse the possibilities.
·
Wednesday, 14 August 2019 13:45
·
0 Likes
·
0 Votes
·
0 Comments
·
I completely agree with you Tony and I have always been an advocate for Joomla to have it's own CSS framework rather than relying on Bootstrap or any other frameworks. Because this is the only way Joomla can keep it's core lean why enforcing every 3rd party extensions to try to adhere to their framework.
·
Wednesday, 14 August 2019 18:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Css-grid was a revelation to me and I think this is the answer.
·
Wednesday, 14 August 2019 18:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Yeah, but let's see which direction Joomla is heading to and we'll adapt accordingly
·
Wednesday, 14 August 2019 22:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Off course
·
Wednesday, 14 August 2019 23:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks
·
Thursday, 15 August 2019 11:29
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post