Giter Club home page Giter Club logo

awesome-navbars's Introduction

SCSS Bootstrap navbar

Templates

Start by copying our navbar template:

Of course, you have to replace the assets (logo, profile picture) by your own.

Respect the navbar markup

For our navbar styles to apply, you have to:

  • add class="navbar-wagon" to the initial Bootstrap <nav>
  • your logo should be a <img> inside the .navbar-brand link.
  • your profile picture should hold the class class="img-avatar"
  • To apply a "button-style" to a link, add it a class="btn"

SCSS template

Our _navbar.css.scss implements style rules on the .wagon-navbar class. Herebelow we detail the role of each sass variable.

Navbar-Wagon SCSS variables

General appearance

Change your navbar background and link color, and link hover color

/* -------------------------------------
 * Colors & Fonts
 * ------------------------------------- */
$navbar-color: white;
$navbar-hover-color: #D4312D;
$navbar-font-family: "Montserrat", sans-serif; // Google fonts
$navbar-bg: transparent;

Change the height, spacing and borders

/* -------------------------------------
 * Box model
 * ------------------------------------- */
$navbar-height: 50px;
$navbar-vertical-padding: 5px;
$navbar-horizontal-padding: 20px;
$navbar-border-bottom-width: 0;
$navbar-border-bottom-color: grey;

Navbar button style

We give you some variables for pimping your navbar buttons.

/* -------------------------------------
 * Navbar button
 * ------------------------------------- */
$navbar-btn-height: 40px;
$navbar-btn-bg: lightgrey;
$navbar-btn-color: white;
$navbar-btn-horizontal-padding: 10px;
$navbar-btn-radius: 2px;

Profile picture

You can also change the style of your navbar profile picture playing on its radius and border

/* -------------------------------------
 * Navbar profile picture
 * ------------------------------------- */
$navbar-profile-radius: 50%;
$navbar-profile-border-color: white;
$navbar-profile-border-width: 2px;

Integration in Rails

Rails assets

In Rails, the integration is easy if you have installed sass-rails and bootstrap-sass gems. You can just add the _navbar.scss file to your Rails layout stylesheets, and then import this file in application.css.scss

//stylesheets/layout/_navbar.css.scss

// Our navbar SCSS code
//stylesheets/layout/_index.css.scss
@import "navbar";
@import "footer";
@import "sidebar";
//stylesheets/application.css.scss

/* -------------------------------------
 * Layout stylesheets
 * ------------------------------------- */
 @import "layout/index";

Here you go!

ERB template

Don't forget to modify our ERB template carefully if you use different path helpers.

Contribute, share your masterpiece!

Feel free to contribute to this project with pull requests, and to share with us your navbar masterpieces!

Peace

awesome-navbars's People

Contributors

papillard avatar ssaunier avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.