Skip to content

Commit

Permalink
bootstrap.jade renamed to _bootstrap.jade, new bootswatch mixins, but…
Browse files Browse the repository at this point in the history
…ton mixins, image mixins, sample layouts optimized using mixins
  • Loading branch information
rajasegar committed Jul 3, 2015
1 parent 03f7c72 commit 12626db
Show file tree
Hide file tree
Showing 23 changed files with 1,029 additions and 75 deletions.
12 changes: 10 additions & 2 deletions bootstrap.jade → _bootstrap.jade
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ include components/modal
include components/list-groups
//- Including Progress bar mixins
include components/progress-bars
//- Including Button mixins
include components/buttons
//- Including Image mixins
include components/images
//- Including Bootswatch theme mixins
include components/bootswatch

doctype html
html(lang="en")
Expand All @@ -49,10 +55,12 @@ html(lang="en")
title= title
block styles
link(rel="stylesheet",href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css")
body
//link(rel="stylesheet",href="css/bootstrap.min.css")
body(data-spy="scroll",data-target=".scrollspy")
block body

block scripts
script(src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js")
script(src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js")

//script(src="js/jquery.min.js")
//script(src="js/bootstrap.min.js")
5 changes: 5 additions & 0 deletions components/bootswatch.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//- Bootswatch theme mixins by Kezz Bracey
//- https://github.com/tutsplus/baking-bootstrap-snippets-with-jade
//- Author: http://tutsplus.com/authors/kezz-bracey
mixin bootswatch(theme)
link(href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.4/" + theme + "/bootstrap.min.css", rel="stylesheet")
151 changes: 151 additions & 0 deletions components/buttons.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
//- button mixins
//- anchor buttons
mixin a-btn(url,style)
- var type = (typeof style === 'undefined') ? "default" : style
a.btn(class="btn-#{type}",href="#{url}",role="button")
block

mixin a-btn-primary(url)
+a-btn(url,"primary")
block

mixin a-btn-info(url)
+a-btn(url,"info")
block

mixin a-btn-warning(url)
+a-btn(url,"warning")
block

mixin a-btn-danger(url)
+a-btn(url,"danger")
block

mixin a-btn-success(url)
+a-btn(url,"success")
block

//- buttons
mixin btn(caption,style,size)
- var type = (typeof style === 'undefined') ? "default" : style
unless size
button.btn(class="btn-#{type}",type="button")= caption
else
button.btn(class="btn-#{type} btn-#{size}",type="button")= caption


mixin btn-primary(caption)
+btn(caption,"primary")

mixin btn-info(caption)
+btn(caption,"info")

mixin btn-warning(caption)
+btn(caption,"warning")

mixin btn-danger(caption)
+btn(caption,"danger")

mixin btn-success(caption)
+btn(caption,"success")

//- Large buttons
mixin btn-lg(caption)
- var type = (typeof style === 'undefined') ? 'default' : style
+btn(caption,type,"lg")

mixin btn-lg-primary(caption)
+btn(caption,"primary","lg")

mixin btn-lg-info(caption)
+btn(caption,"info","lg")

mixin btn-lg-success(caption)
+btn(caption,"success","lg")

mixin btn-lg-warning(caption)
+btn(caption,"warning","lg")

mixin btn-lg-danger(caption)
+btn(caption,"danger","lg")

//- Small buttons
mixin btn-sm(caption)
- var type = (typeof style === 'undefined') ? 'default' : style
+btn(caption,type,"sm")

mixin btn-sm-primary(caption)
+btn(caption,"primary","sm")

mixin btn-sm-info(caption)
+btn(caption,"info","sm")

mixin btn-sm-success(caption)
+btn(caption,"success","sm")

mixin btn-sm-warning(caption)
+btn(caption,"warning","sm")

mixin btn-sm-danger(caption)
+btn(caption,"danger","sm")

//- Extra Small buttons
mixin btn-xs(caption)
- var type = (typeof style === 'undefined') ? 'default' : style
+btn(caption,type,"xs")

mixin btn-xs-primary(caption)
+btn(caption,"primary","xs")

mixin btn-xs-info(caption)
+btn(caption,"info","xs")

mixin btn-xs-success(caption)
+btn(caption,"success","xs")

mixin btn-xs-warning(caption)
+btn(caption,"warning","xs")

mixin btn-xs-danger(caption)
+btn(caption,"danger","xs")

//- input buttons
mixin input-btn(caption,style)
- var type = (typeof style === 'undefined') ? "default" : style
input.btn(class="btn-#{type}",type="button",value="#{caption}")

mixin input-btn-primary(caption)
+input-btn(caption,"primary")

mixin input-btn-info(caption)
+input-btn(caption,"info")

mixin input-btn-warning(caption)
+input-btn(caption,"warning")

mixin input-btn-danger(caption)
+input-btn(caption,"danger")

mixin input-btn-success(caption)
+input-btn(caption,"success")

//- submit buttons
mixin submit(caption,style)
- var type = (typeof style === 'undefined') ? "default" : style
input.btn(class="btn-#{type}",type="submit",value="#{caption}")

mixin submit-primary(caption)
+submit(caption,"primary")

mixin submit-info(caption)
+submit(caption,"info")

mixin submit-warning(caption)
+submit(caption,"warning")

mixin submit-danger(caption)
+submit(caption,"danger")

mixin submit-success(caption)
+submit(caption,"success")

15 changes: 15 additions & 0 deletions components/images.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//- Image mixins
mixin img-responsive(_src,_alt)
img.img-responsive(src="#{_src}",alt="#{_alt}")

mixin img-responsive-center(_src,_alt)
img.img-responsive.center-block(src="#{_src}",alt="#{_alt}")

mixin img-rounded(_src,_alt)
img.img-rounded(src="#{_src}",alt="#{_alt}")

mixin img-circle(_src,_alt)
img.img-circle(src="#{_src}",alt="#{_alt}")

mixin img-thumbnail(_src,_alt)
img.img-thumbnail(src="#{_src}",alt="#{_alt}")
85 changes: 57 additions & 28 deletions components/navbar.jade
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,65 @@
//- https://github.com/tutsplus/baking-bootstrap-snippets-with-jade
//- Author: http://tutsplus.com/authors/kezz-bracey
mixin navbar(name, id, style)
- var style = (typeof style === 'undefined') ? "default" : style
nav( role="navigation", class=["navbar", "navbar-" + style] )
.navbar-header
button.navbar-toggle.collapsed( type="button", data-toggle="collapse", data-target="#" + id, aria-expanded="false", aria-controls="navbar")
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand(href="#")= name
.collapse.navbar-collapse( id=id )
ul.nav.navbar-nav
block
- var style = (typeof style === 'undefined') ? "default" : style
nav( role="navigation", class=["navbar", "navbar-" + style] )
.navbar-header
button.navbar-toggle.collapsed( type="button", data-toggle="collapse", data-target="#" + id, aria-expanded="false", aria-controls="navbar")
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand(href="#")= name

.collapse.navbar-collapse( id=id )
ul.nav.navbar-nav
block

mixin nav_item(href, active)
li(class=active): a( href=href )
block
li(class=active): a( href=href )
block

mixin nav_item_dropdown(href, active)
li(class=["dropdown", active])
a.dropdown-toggle( href=href, data-toggle="dropdown", role="button", aria-expanded="false" )= attributes.label
span.caret
ul.dropdown-menu( role="menu" )
block
li(class=["dropdown", active])
a.dropdown-toggle( href=href, data-toggle="dropdown", role="button", aria-expanded="false" )= attributes.label
span.caret
ul.dropdown-menu( role="menu" )
block

mixin nav_divider
li.divider
li.divider

mixin nav_header
li.dropdown-header
block

li.dropdown-header
block

mixin navbar-fixed(name,id,style)
- var style = (typeof style === 'undefined') ? "default" : style
nav( role="navigation", class=["navbar","navbar-fixed-top","navbar-" + style] )
.container
.navbar-header
button.navbar-toggle.collapsed(type='button', data-toggle='collapse', data-target='#' + id, aria-expanded='false', aria-controls='navbar')
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand(href='#') Project name
.collapse.navbar-collapse( id=id )
ul.nav.navbar-nav
block

mixin navbar-static(name,id,style)
- var style = (typeof style === 'undefined') ? "default" : style
nav( role="navigation", class=["navbar","navbar-static-top","navbar-" + style] )
.container
.navbar-header
button.navbar-toggle.collapsed(type='button', data-toggle='collapse', data-target='#' + id, aria-expanded='false', aria-controls='navbar')
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand(href='#') Project name
.collapse.navbar-collapse( id=id )
ul.nav.navbar-nav
block
//- End navbar mixins
2 changes: 1 addition & 1 deletion layouts/blog.jade
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extends ../bootstrap
extends ../_bootstrap
append styles
// Custom styles for this template
link(href='../css/blog.css', rel='stylesheet')
Expand Down
Loading

0 comments on commit 12626db

Please sign in to comment.