Remove all frameworks except Bootstrap (#251)

- Remove all frameworks except Bootstrap

- Remove roots-options.php and replace with a more simple
  roots-config.php

- Include all Bootstrap Javascript plugins by default in
  js/plugins.js

- Use Bootstrap Responsive and Topbar navigation by default

- Use Bootstrap markup on forms, page titles, image galleries,
  alerts and errors, post and comment navigation

- Remove Roots styles from style.css and introduce app.css for
  site-specific CSS. Remove almost all previous default Roots
  styles.

- Add latest updates from H5BP project
This commit is contained in:
Ben Word
2012-02-03 12:10:44 -07:00
parent 7266dae71b
commit 3c3b71fac0
143 changed files with 7480 additions and 17483 deletions

View File

@@ -3,79 +3,18 @@
add_action('roots_stylesheets', 'roots_get_stylesheets');
function roots_get_stylesheets() {
global $roots_options;
global $roots_css_framework;
$styles = '';
$styles .= stylesheet_link_tag('/style.css', 1);
$styles .= stylesheet_link_tag('/bootstrap.css', 1);
if (class_exists('RGForms')) {
$styles .= "\t<link rel=\"stylesheet\" href=\"" . plugins_url(). "/gravityforms/css/forms.css\">\n";
if (BOOTSTRAP_RESPONSIVE) {
$styles .= stylesheet_link_tag('/bootstrap-responsive.css', 1);
}
$styles .= stylesheet_link_tag('/app.css', 1);
if (is_child_theme()) {
$styles .= stylesheet_link_tag('/style.css', 1);
$styles .= "\t<link rel=\"stylesheet\" href=\"" . get_stylesheet_uri(). "\">\n";
} else {
$styles .= stylesheet_link_tag('/style.css', 1);
}
switch ($roots_css_framework) {
case 'blueprint' :
$styles .= stylesheet_link_tag('/blueprint/screen.css');
break;
case '960gs_12' :
case '960gs_16' :
$styles .= stylesheet_link_tag('/960/reset.css');
$styles .= stylesheet_link_tag('/960/text.css', 1);
$styles .= stylesheet_link_tag('/960/960.css', 1);
break;
case '960gs_24' :
$styles .= stylesheet_link_tag('/960/reset.css');
$styles .= stylesheet_link_tag('/960/text.css', 1);
$styles .= stylesheet_link_tag('/960/960_24_col.css', 1);
break;
case '1140' :
$styles .= stylesheet_link_tag('/1140/1140.css');
break;
case 'adapt' :
$styles .= stylesheet_link_tag('/adapt/master.css');
$styles .= "\t<noscript>\n";
$styles .= stylesheet_link_tag('/adapt/mobile.css', 1);
$styles .= "\t</noscript>\n";
break;
case 'foundation' :
$styles .= stylesheet_link_tag('/foundation/globals.css');
$styles .= stylesheet_link_tag('/foundation/typography.css', 1);
$styles .= stylesheet_link_tag('/foundation/grid.css', 1);
$styles .= stylesheet_link_tag('/foundation/ui.css', 1);
$styles .= stylesheet_link_tag('/foundation/forms.css', 1);
$styles .= stylesheet_link_tag('/foundation/orbit.css', 1);
$styles .= stylesheet_link_tag('/foundation/reveal.css', 1);
$styles .= stylesheet_link_tag('/foundation/mobile.css', 1);
$styles .= stylesheet_link_tag('/foundation/app.css', 1);
break;
case 'less' :
$styles .= stylesheet_link_tag('/less/less.css');
break;
case 'bootstrap' :
$styles .= stylesheet_link_tag('/bootstrap/bootstrap.css');
$styles .= stylesheet_link_tag('/bootstrap/bootstrap-responsive.css');
break;
case 'bootstrap_less' :
$styles .= stylesheet_link_tag('/bootstrap/lib/bootstrap.less', 0, true, 'stylesheet/less');
break;
}
switch ($roots_css_framework) {
case 'blueprint' :
$styles .= "\t<!--[if lt IE 8]>" . stylesheet_link_tag('/blueprint/ie.css', 0, false) . "<![endif]-->\n";
break;
case '1140' :
$styles .= "\t<!--[if lt IE 8]>" . stylesheet_link_tag('/1140/ie.css', 0, false) . "<![endif]-->\n";
break;
case 'foundation' :
$styles .= "\t<!--[if lt IE 9]>" . stylesheet_link_tag('/foundation/ie.css', 0, false) . "<![endif]-->\n";
break;
}
echo $styles;
@@ -89,12 +28,10 @@ function stylesheet_link_tag($file, $tabs = 0, $newline = true, $rel = 'styleshe
add_action('roots_footer', 'roots_google_analytics');
function roots_google_analytics() {
global $roots_options;
$roots_google_analytics_id = $roots_options['google_analytics_id'];
$get_roots_google_analytics_id = esc_attr($roots_options['google_analytics_id']);
$roots_google_analytics_id = GOOGLE_ANALYTICS_ID;
if ($roots_google_analytics_id !== '') {
echo "\n\t<script>\n";
echo "\t\tvar _gaq=[['_setAccount','$get_roots_google_analytics_id'],['_trackPageview'],['_trackPageLoadTime']];\n";
echo "\t\tvar _gaq=[['_setAccount','$roots_google_analytics_id'],['_trackPageview'],['_trackPageLoadTime']];\n";
echo "\t\t(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];\n";
echo "\t\tg.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';\n";
echo "\t\ts.parentNode.insertBefore(g,s)}(document,'script'));\n";
@@ -102,79 +39,4 @@ function roots_google_analytics() {
}
}
// 1140 specific
if (roots_current_framework() === '1140') {
add_action('roots_header_before', 'roots_1140_header_before');
add_action('roots_header_after', 'roots_1140_header_after');
add_action('roots_footer_before', 'roots_1140_footer_before');
add_action('roots_footer_after', 'roots_1140_footer_after');
function roots_1140_header_before() {
echo '<div class="container"><div class="row">', "\n";
}
function roots_1140_header_after() {
echo "</div></div><!-- /.row /.container -->\n";
echo '<div class="container"><div class="row">', "\n";
}
function roots_1140_footer_before() {
echo "</div></div><!-- /.row /.container -->\n";
echo '<div class="container"><div class="row">', "\n";
}
function roots_1140_footer_after() {
echo "</div></div><!-- /.row /.container -->\n";
}
}
// Adapt specific
if (roots_current_framework() === 'adapt') {
add_action('roots_head', 'roots_adapt_head');
function roots_adapt_head() {
$template_uri = get_template_directory_uri();
echo "\n\t<script>\n";
echo "\t\tvar ADAPT_CONFIG = {\n";
echo "\t\t\tpath: '$template_uri/css/adapt/',\n";
echo "\t\t\tdynamic: true,\n";
echo "\t\t\trange: [\n";
echo "\t\t\t\t'0px to 760px = mobile.css',\n";
echo "\t\t\t\t'760px to 980px = 720.css',\n";
echo "\t\t\t\t'980px to 1280px = 960.css',\n";
echo "\t\t\t\t'1280px to 1600px = 1200.css',\n";
echo "\t\t\t\t'1600px to 1920px = 1560.css',\n";
echo "\t\t\t\t'1920px = fluid.css'\n";
echo "\t\t\t]\n";
echo "\t\t};\n";
echo "\t</script>\n";
}
}
// Bootstrap specific
if (roots_current_framework() === 'bootstrap' || roots_current_framework() === 'bootstrap_less') {
add_action('roots_header_before', 'roots_bootstrap_header_before');
add_action('roots_header_after', 'roots_bootstrap_header_after');
add_action('roots_footer_before', 'roots_bootstrap_footer_before');
add_action('roots_footer_after', 'roots_bootstrap_footer_after');
function roots_bootstrap_header_before() {
echo '<div class="container">', "\n";
}
function roots_bootstrap_header_after() {
echo "</div><!-- /.container -->\n";
echo '<div class="container">', "\n";
}
function roots_bootstrap_footer_before() {
echo "</div><!-- /.container -->\n";
echo '<div class="container">', "\n";
}
function roots_bootstrap_footer_after() {
echo "</div><!-- /.container -->\n";
}
}
?>