Is CSS Grid supported for Zendesk Guide? | Community
Skip to main content

Is CSS Grid supported for Zendesk Guide?

  • March 31, 2021
  • 4 replies
  • 0 views

I want to create a new layout for my support site and take advantage of CSS Grid. I can see that flexbox CSS is working but CSS Grid is not. Is it just not available to be used on Zendesk?

4 replies

Ifra
  • April 4, 2021

It's working perfectly. 


  • Author
  • April 4, 2021

Thanks for confirming. After some experimentation I managed to get my wireframe working as expected.

Do you have any advice about using grid? for example, if I was coding a site without using all the .hbs files, I could define a parent div and it could include my header and footer. Given that header and footer are separate .hbs files, is this still possible (ie. can I open the div in the header.hbs and close it in the footer.hbs?) or do I need to define a specific parent div for each of them.


Ifra
  • April 5, 2021

Hey, you can add parent div via js code, you can try the below steps:

1- Add the JQuery lib on your head file/document_head.hbs.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

 2- Then add this given code on your JS file.

$(document).ready(function (){
$('head, body, footer').wrapAll('<div class="wrapper">');
});

 

I tried on default theme but you have different classes of header/footer/body so you can update in this; ('head, body, footer').

 

Team

 


  • Author
  • April 6, 2021

Hi Ifra,

That was exactly what I needed - thank you!

Just as a leave behind for anyone who follows:

Documentation on wrap all (with examples): https://api.jquery.com/wrapall/

My specific implementation:

Where header.hbs contains:

home_page.hbs contains:

footer.hbs contains:

The result is: