38
Bootstrap & Joomla UI Andrea Tarr MetaScale /Sears Holdings Joomla Day New England 2013

Bootstrap & Joomla UI

Embed Size (px)

DESCRIPTION

One of Joomla's greatest strengths is all the great extensions that can be integrated to add functionality to your website. From the point of view of the designer, this has always been one of the biggest problems -- How to make all these different extensions look like they are on the same site. Joomla UI, with the included Bootstrap, is a way that Joomla 3.x fixes that. It is a stylesheet of UI -- the markup, the CSS, and the JavaScript behaviors, that extension & template developers can share. When templates and developers use the same UI, your site will look united. This presentation will be an introduction to Bootstrap and JUI, what it is, what it can do, and how it will affect templates in Joomla. This talk will continue in the session on LESS, the CSS pre-compiler, that is used with Bootstrap.

Citation preview

Page 1: Bootstrap & Joomla UI

Bootstrap & Joomla UI

Andrea Tarr MetaScale /Sears Holdings

Joomla Day New England 2013

Page 2: Bootstrap & Joomla UI

The Problem Using Bootstrap Bootstrap in Joomla

JDNE: Bootstrap & Joomla UI April 13, 2013 2

Page 3: Bootstrap & Joomla UI

The Problem

JDNE: Bootstrap & Joomla UI April 13, 2013 3

Page 4: Bootstrap & Joomla UI

Not everything is in core Extensions make up UI Templates must be coded for specific extensions

Patchwork JDNE: Bootstrap & Joomla UI April 13, 2013 4

Page 5: Bootstrap & Joomla UI

Bootstrap Consistency CSS layout styles CSS UI elements CSS responsive styles Integrated JavaScript Full set of icons

JDNE: Bootstrap & Joomla UI April 13, 2013 5

Page 6: Bootstrap & Joomla UI

Bootstrap Fast & Flexible Minified CSS Minified JavaScript CSS preprocessor, LESS

JDNE: Bootstrap & Joomla UI April 13, 2013 6

Page 7: Bootstrap & Joomla UI

Using Bootstrap

JDNE: Bootstrap & Joomla UI April 13, 2013 7

Page 8: Bootstrap & Joomla UI

Download the CSS & JavaScript files Call the files plus jQuery in your program

JDNE: Bootstrap & Joomla UI April 13, 2013 8

Page 9: Bootstrap & Joomla UI

<link href="css/bootstrap.min.css" rel="stylesheet"> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"> </script>

JDNE: Bootstrap & Joomla UI April 13, 2013 9

Page 10: Bootstrap & Joomla UI

Notice we used CSS & JavaScipt files. No LESS files. LESS is used to help create Bootstrap CSS files but isn't need to use Bootstrap.

JDNE: Bootstrap & Joomla UI April 13, 2013 10

Page 11: Bootstrap & Joomla UI

Documentation Examples & Downloads http://twitter.github.com/bootstrap

JDNE: Bootstrap & Joomla UI April 13, 2013 11

Page 12: Bootstrap & Joomla UI

Full Source (Includes .LESS files) http://github.com/twitter/bootstrap

JDNE: Bootstrap & Joomla UI April 13, 2013 12

Page 13: Bootstrap & Joomla UI

Grid System - Static .row

JDNE: Bootstrap & Joomla UI April 13, 2013 13

.offsetx

.spanx

Page 14: Bootstrap & Joomla UI

Grid System - Static <div class="row"> <div class="span4"> ...</div> <div class="offset2 span6">...</div> </div>

JDNE: Bootstrap & Joomla UI April 13, 2013 14

Page 15: Bootstrap & Joomla UI

Grid System - Fluid .row-fluid

JDNE: Bootstrap & Joomla UI April 13, 2013 15

.offsetx

.spanx

Page 16: Bootstrap & Joomla UI

Grid System - Fluid <div class="row-fluid"> <div class="span4"> ...</div> <div class="offset2 span6">...</div> </div>

JDNE: Bootstrap & Joomla UI April 13, 2013 16

Page 17: Bootstrap & Joomla UI

<div class="row-fluid"> <div class="span4"> <div class="row-fluid"> <div class="span3">...</div> <div class="span9">...</div> </div> </div> <div class="offset2 span6">... </div> </div>

JDNE: Bootstrap & Joomla UI April 13, 2013 17

Page 18: Bootstrap & Joomla UI

Responsive classes .hidden-phone .visible-phone .hidden-tablet .visible-tablet .hidden-desktop .visible-desktop

JDNE: Bootstrap & Joomla UI April 13, 2013 18

Page 19: Bootstrap & Joomla UI

Text classes .muted .text-warning .text-error .text-info .text-success

JDNE: Bootstrap & Joomla UI April 13, 2013 19

Page 20: Bootstrap & Joomla UI

Useful classes .pull-right .pull-left .clearfix .element-invisible (JUI)

JDNE: Bootstrap & Joomla UI April 13, 2013 20

Page 21: Bootstrap & Joomla UI

<table> classes .table .table-striped .table-condensed .table-border .table-hover

JDNE: Bootstrap & Joomla UI April 13, 2013 21

Page 22: Bootstrap & Joomla UI

<tr> classes .success .error

JDNE: Bootstrap & Joomla UI April 13, 2013 22

.warning

.info

Page 23: Bootstrap & Joomla UI

.btn

.btn-primary

.btn-info

.btn-success

.btn-warning

.btn-danger

.btn-inverse

.btn-link JDNE: Bootstrap & Joomla UI April 13, 2013 23

Page 24: Bootstrap & Joomla UI

Size is optional .btn-large .btn-small .btn-mini <div> size .btn-block

JDNE: Bootstrap & Joomla UI April 13, 2013 24

Page 25: Bootstrap & Joomla UI

Downloads twitter.github.com/bootstrap github.com/twitter/bootstrap Tutorial webdesign.tutsplus.com/series/twitter-bootstrap-101 Video Tutorial youtube.com/watch?v=DgwtRpf60xI

JDNE: Bootstrap & Joomla UI April 13, 2013 25

Page 26: Bootstrap & Joomla UI

Bootstrap in Joomla

JDNE: Bootstrap & Joomla UI April 13, 2013 26

Page 27: Bootstrap & Joomla UI

Three Options 1. Use Bootstrap files in

Joomla 2. Download customized

Bootstrap files 3. Create template.css

file from Joomla Bootstrap LESS files

JDNE: Bootstrap & Joomla UI April 13, 2013 27

Page 28: Bootstrap & Joomla UI

1. Use Bootstrap files in Joomla media jui css fonts img js less

JDNE: Bootstrap & Joomla UI April 13, 2013 28

Page 29: Bootstrap & Joomla UI

media/jui/css bootstrap.css bootstrap.min.css bootstrap-responsive.css bootstrap-responsive.min.css bootstrap-extended.css bootstrap-rtl.css

JDNE: Bootstrap & Joomla UI April 13, 2013 29

Page 30: Bootstrap & Joomla UI

media/jui/css chosen-sprite.png chosen.css icomoon.css sortablelist.css

JDNE: Bootstrap & Joomla UI April 13, 2013 30

Page 31: Bootstrap & Joomla UI

Load CSS automatically <?php JHtml::_('bootstrap.loadCss'); ?>

JDNE: Bootstrap & Joomla UI April 13, 2013 31

Page 32: Bootstrap & Joomla UI

Load main CSS files JHtml::_('bootstrap.loadCss'); Main CSS files plus RTL files <?php $doc=JFactory::getDocument(); $this->direction=$doc->direction; JHtml::_('bootstrap.loadCss', true, $this->direction); ?>

JDNE: Bootstrap & Joomla UI April 13, 2013 32

Page 33: Bootstrap & Joomla UI

Only RTL file If you loaded Bootstrap CSS separately or it's included in your template.css file as in options 2&3. <?php $doc=JFactory::getDocument(); $this->direction=$doc>direction; JHtml::_('bootstrap.loadCss', false, $this->direction); ?>

JDNE: Bootstrap & Joomla UI April 13, 2013 33

Page 34: Bootstrap & Joomla UI

Load JavaScript <?php JHtml::_('bootstrap.framework'); ?>

JDNE: Bootstrap & Joomla UI April 13, 2013 34

Page 35: Bootstrap & Joomla UI

2. Download customized Bootstrap files http://twitter.github.com/bootstrap Customize

JDNE: Bootstrap & Joomla UI April 13, 2013 35

Page 36: Bootstrap & Joomla UI

Be safe: use the same version Extensions may need components so include them Change variables to suit Download and include as normal CSS files

JDNE: Bootstrap & Joomla UI April 13, 2013 36

Page 37: Bootstrap & Joomla UI

3. Create template.css file from Joomla Bootstrap LESS files Come to my LESS talk this afternoon

JDNE: Bootstrap & Joomla UI April 13, 2013 37

Page 38: Bootstrap & Joomla UI

Questions?

JDNE: Bootstrap & Joomla UI April 13, 2013 38