Light Layout

Description

The light layout has a light color navbar, navigation menu and footer. In this page you can experience it. If you want to create a light version template you can use this layout.

CSS Classes

This table contains all classes related to the light layout. This is a custom layout classes for light layout page requirements.

All these options can be set via following classes:

Classes Description
.navbar-light To set navbar light color you need to add .navbar-light class in navbar <nav> tag. Refer HTML markup line no 7.
.menu-light To set the main navigation light color on page .menu-light class needs to add in navigation wrapper. Refer HTML markup line no 12.
.footer-light To set the main footer light color on page .footer-light class needs to add in footer wrapper. Refer HTML markup line no 37.

HTML Markup

This section contains HTML Markup to create light layout. This markup define where to add css classes to make navbar, navigation & footer light.

  • Line no 7: Contain the .navbar-light class for adjusting navbar color light.
  • Line no 12: Contain the .menu-light class for adjusting main navigation color light.
  • Line no 37: Contain the .footer-light class for adjusting footer color light.

Modern has a ready to use starter kit, you can use this layout directly by using the starter kit pages from the modern-admin/starter-kit folder.

        
            <!DOCTYPE html>
              <html lang="en">
                <head></head>
                <body data-menu="vertical-menu" class="vertical-layout vertical-menu 2-column menu-expanded">
                  <!-- fixed-top-->
                  <nav role="navigation" class="header-navbar navbar-expand-sm navbar navbar-with-menu fixed-top navbar-light navbar-shadow navbar-border">
                      ...
                  </nav>
                  <!-- BEGIN Navigation-->
                  <div class="main-menu menu-light menu-fixed menu-shadow">
                      ...
                  </div>
                  <!-- END Navigation-->
                  <!-- BEGIN Content-->
                  <div class="content app-content">
                      <div class="content-wrapper">
                          <!-- content header-->
                          <div class="content-header row">
                              ...
                          </div>
                          <!-- content header-->
                          <!-- content right-->
                          <div class="content-right">
                              ...
                          </div>
                          <!-- content right-->
                      </div>
                  </div>
                  <!-- END Content-->
                  <!-- START FOOTER DARK-->
                  <footer class="footer footer-light footer-fixed">
                      ...
                  </footer>
                  <!-- START FOOTER DARK-->
                </body>
              </html>
        
        

PUG Configuration

Modern Admin use PUG as template engine to generate pages and whole template quickly using node js, for getting start with PUG usage & template generating process please refer template documentation.

PUG Variables

This table contains required PUG variables to generate light layout.

Block Variable Datatype Value Description
pageConfig logoType string 'dark' pageConfig block has a logoType variable, it contains logo type specific classes in that you need to set 'dark' to set dark version logo.
navbarConfig navbarColor string 'navbar-light' navbarConfig block has a navbarColor variable, it contains navbar color specific classes in that you need to set 'navbar-light' for light navbar.
verticalMenuConfig menuColor string 'menu-light' verticalMenuConfig block has a menuColor variable, it contains navigation color specific classes in that you need to set 'menu-light' for light navigation in vertical layout.
horizontalMenuConfig menuColor string 'navbar-light' horizontalMenuConfig block has a menuColor variable, it contains navigation color specific classes in that you need to set 'navbar-light' for light navigation in horizontal layout.
footerConfig footerColor string 'footer-light' footerConfig block has a footerColor variable, it contains footer specific classes in that you need to set 'footer-light' for light footer.
PUG Code

To generate light layout page or template, you need to use following PUG code.

  • Line no 20-21: Set class logoType variable value as 'dark' in pageConfig block for dark version logo as our layout is light.
  • Line no 23-24: Set navbar light class to navbarColor variable value as 'navbar-light' in navbarConfig block for light navbar.
  • Line no 26-27: Set vertical layout navigation light class to menuColor variable value as 'menu-light' in verticalMenuConfig block for light navigation in vertical layout.
  • Line no 29-30: Set horizontal layout navigation light class to menuColor variable value as 'navbar-light' in horizontalMenuConfig block for light navigation in horizontal layout.
  • Line no 32-33: Set footer light class to footerColor variable value as 'footer-light' in footerConfig block for light footer.
  • Line no 39-40: content block has content section html file included include ../contents/layout-light.html, which can be customizable on page level.

If you want to use this layout on page level you need to define it on page it self. This template has one example pug file for light layout layout-light.pug, however you can use it on template level but it will generate whole template as a light layout.

              
                  block pageVars
                    - var pageTitle    = "Light Layout"
                    - var pageSubTitle = "Light template layout"
                    - var description  = "The light layout has light version navbar, navigation & footer."
                    - var activeMenu   = "layout-light"
                  extends template
                  append pageConfig
                    - var logoType = 'dark'
                  append navbarConfig
                    - var navbarColor = "navbar-light"
                  append verticalMenuConfig
                    - var menuColor = "menu-light"
                  append horizontalMenuConfig
                    - var horizontalMenuColor = "navbar-light"
                  append footerConfig
                    - var footerColor = "footer-light"
                  append breadcrumbs
                    +breadcrumbs([{url:"index.html",name:"Home"},{url:"#",name:"Page Layouts"}, {name:"Light Layout"}])
                  //- Include page content in page block
                  append content
                    include ../contents/layout-light.html
                  //- Vendor CSS
                  //------------------------------
                  //- Add Vendor specific CSS
                  append vendorcss  
                  //- Page CSS
                  //------------------------------
                  //- Add custom page specific CSS
                  append pagecss
                  //- Vendor JS
                  //------------------------------
                  //- Add vendor specific JS
                  append vendorjs  
                  //- Page JS
                  //------------------------------
                  //- Add custom page specific JS
                  append pagejs