0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-19 16:54:24 +01:00

revamp all the things

This commit is contained in:
Mark Otto 2014-03-17 02:03:16 -07:00
parent b3f30bb70e
commit 35ddc8427e
9 changed files with 241 additions and 161 deletions

View File

@ -1,12 +1,10 @@
<!-- Footer
================================================== -->
<footer class="bs-docs-footer" role="contentinfo">
<div class="container">
<div class="bs-docs-container">
{% include social-buttons.html %}
<p>Designed and built with all the love in the world by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> and <a href="http://twitter.com/fat" target="_blank">@fat</a>.</p>
<p>Maintained by the <a href="https://github.com/twbs?tab=members">core team</a> with the help of <a href="https://github.com/twbs/bootstrap/graphs/contributors">our contributors</a>.</p>
<p>Code licensed under <a href="https://github.com/twbs/bootstrap/blob/master/LICENSE" target="_blank">MIT</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
<p>Designed and built with all the love in the world by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> and <a href="http://twitter.com/fat" target="_blank">@fat</a>. Maintained by the <a href="https://github.com/twbs?tab=members">core team</a> with the help of <a href="https://github.com/twbs/bootstrap/graphs/contributors">our contributors</a>. Code licensed under <a href="https://github.com/twbs/bootstrap/blob/master/LICENSE" target="_blank">MIT</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
<ul class="bs-docs-footer-links muted">
<li>Currently v{{ site.current_version }}</li>
<li>&middot;</li>

View File

@ -0,0 +1,64 @@
<div id="top"></div>
<div class="bs-docs-sidebar">
<a href="../" class="bs-docs-sidebar-brand">Bootstrap</a>
<div class="bs-docs-toc">
<div class="bs-docs-toc-item{% if page.slug == "getting-started" %} active{% endif %}">
<a class="bs-docs-toc-link" href="../getting-started">Getting started</a>
{% if page.slug == "getting-started" %}
<ul class="nav bs-docs-sidenav">
{% include nav/getting-started.html %}
</ul>
{% endif %}
</div>
<div class="bs-docs-toc-item{% if page.slug == "css" %} active{% endif %}">
<a class="bs-docs-toc-link" href="../css">CSS</a>
{% if page.slug == "css" %}
<ul class="nav bs-docs-sidenav">
{% include nav/css.html %}
</ul>
{% endif %}
</div>
<div class="bs-docs-toc-item{% if page.slug == "components" %} active{% endif %}">
<a class="bs-docs-toc-link" href="../components">Components</a>
{% if page.slug == "components" %}
<ul class="nav bs-docs-sidenav">
{% include nav/components.html %}
</ul>
{% endif %}
</div>
<div class="bs-docs-toc-item{% if page.slug == "js" %} active{% endif %}">
<a class="bs-docs-toc-link" href="../javascript">JavaScript</a>
{% if page.slug == "js" %}
<ul class="nav bs-docs-sidenav">
{% include nav/javascript.html %}
</ul>
{% endif %}
</div>
<div class="bs-docs-toc-item{% if page.slug == "customize" %} active{% endif %}">
<a class="bs-docs-toc-link" href="../customize">Customize</a>
{% if page.slug == "customize" %}
<ul class="nav bs-docs-sidenav">
{% include nav/customize.html %}
</ul>
{% endif %}
</div>
<div class="bs-docs-toc-item{% if page.slug == "js" %} active{% endif %}">
<a class="bs-docs-toc-link" href="../about">About</a>
{% if page.slug == "js" %}
<ul class="nav bs-docs-sidenav">
{% include nav/about.html %}
</ul>
{% endif %}
</div>
<div class="bs-docs-toc-item{% if page.slug == "migration" %} active{% endif %}">
<a class="bs-docs-toc-link" href="../migration">Migrating to v3.x</a>
{% if page.slug == "migration" %}
<ul class="nav bs-docs-sidenav">
{% include nav/migration.html %}
</ul>
{% endif %}
</div>
</div>
</div>

View File

@ -1,4 +1,4 @@
<header class="navbar navbar-static-top bs-docs-nav" id="top" role="banner">
<header class="navbar navbar-inverse navbar-static-top bs-docs-nav" id="top" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">

View File

@ -4,28 +4,26 @@
<!-- Meta, title, CSS, favicons, etc. -->
{% include header.html %}
</head>
<body>
<body class="bs-docs">
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
<!-- Docs master nav -->
{% include nav/main.html %}
{% include nav/docs.html %}
<!-- Docs page layout -->
<div class="bs-docs-header" id="content">
<div class="container">
<div class="bs-docs-container">
<h1>{{ page.title }}</h1>
<p>{{ page.lead }}</p>
{% include ads.html %}
</div>
</div>
<div class="container bs-docs-container">
<div class="bs-docs-container">
<div class="row">
<div class="col-md-9" role="main">
<!-- <div class="row"> -->
<!-- <div class="col-md-9" role="main"> -->
{{ content }}
</div>
<div class="col-md-3">
<!-- </div> -->
<!-- <div class="col-md-3">
<div class="bs-docs-sidebar hidden-print" role="complementary">
<ul class="nav bs-docs-sidenav">
{% if page.slug == "getting-started" %}
@ -49,7 +47,8 @@
</a>
</div>
</div>
</div>
-->
<!-- </div> -->
</div>

View File

@ -8,7 +8,7 @@
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
<!-- Docs master nav -->
{% include nav/main.html %}
{% include nav/home.html %}
<!-- Page content of course! -->
{{ content }}

File diff suppressed because one or more lines are too long

View File

@ -116,9 +116,10 @@ body {
* Turn the `.navbar` at the top of the docs purple.
*/
.bs-docs-nav {
margin-bottom: 0;
background-color: #fff;
background-color: #563d7c;
border-bottom: 0;
}
.bs-home-nav .bs-nav-b {
@ -127,24 +128,27 @@ body {
.bs-docs-nav .navbar-brand,
.bs-docs-nav .navbar-nav > li > a {
font-weight: 500;
color: #563d7c;
color: #cdbfe3;
}
.bs-docs-nav .navbar-brand {
color: #fff;
}
.bs-docs-nav .navbar-nav > li > a:hover,
.bs-docs-nav .navbar-nav > .active > a,
.bs-docs-nav .navbar-nav > .active > a:hover {
color: #463265;
background-color: #f9f9f9;
}
.bs-docs-nav .navbar-toggle .icon-bar {
color: #fff;
background-color: #563d7c;
}
.bs-docs-nav .navbar-toggle .icon-bar {
background-color: #fff;
}
.bs-docs-nav .navbar-header .navbar-toggle {
border-color: #fff;
border-color: #322f38;
}
.bs-docs-nav .navbar-header .navbar-toggle:hover,
.bs-docs-nav .navbar-header .navbar-toggle:focus {
background-color: #f9f9f9;
border-color: #f9f9f9;
background-color: #29262f;
border-color: #29262f;
}
@ -155,8 +159,6 @@ body {
*/
.bs-docs-footer {
padding-top: 40px;
padding-bottom: 40px;
margin-top: 100px;
color: #777;
text-align: center;
@ -179,6 +181,9 @@ body {
.bs-docs-footer p {
margin-bottom: 0;
}
.bs-docs .bs-docs-footer {
text-align: left;
}
}
@ -215,6 +220,13 @@ body {
border: 0;
}
@media (min-width: 768px) {
.bs-docs .bs-docs-social {
margin-left: -8px;
text-align: left;
}
}
/*
* Homepage
@ -222,9 +234,8 @@ body {
* Tweaks to the custom homepage and the masthead (main jumbotron).
*/
/* Share masthead with page headers */
.bs-docs-masthead,
.bs-docs-header {
/* Masthead (headings and download button) */
.bs-docs-masthead {
position: relative;
padding: 30px 15px;
color: #cdbfe3;
@ -235,11 +246,9 @@ body {
background-image: -webkit-linear-gradient(top, #563d7c 0%, #6f5499 100%);
background-image: -o-linear-gradient(top, #563d7c 0%, #6f5499 100%);
background-image: linear-gradient(to bottom, #563d7c 0%, #6f5499 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6f5499', GradientType=0);
background-repeat: repeat-x;
}
/* Masthead (headings and download button) */
.bs-docs-masthead .bs-docs-booticon {
margin: 0 auto 30px;
}
@ -299,17 +308,24 @@ body {
/* Page headers */
.bs-docs-header {
padding: 30px 0;
margin-bottom: 40px;
font-size: 20px;
background-color: #fafafa;
border-bottom: 1px solid #eee;
}
.bs-docs-header .bs-docs-container {
max-width: none;
}
.bs-docs-header h1 {
margin-top: 0;
color: #fff;
color: #563d7c;
}
.bs-docs-header p {
margin-bottom: 0;
font-weight: 300;
line-height: 1.4;
color: #777;
}
.bs-docs-header .container {
position: relative;
@ -317,8 +333,6 @@ body {
@media (min-width: 768px) {
.bs-docs-header {
padding-top: 60px;
padding-bottom: 60px;
font-size: 24px;
text-align: left;
}
@ -382,6 +396,10 @@ body {
.carbonad #azcarbon > img {
display: none; /* hide what I assume are tracking images */
}
.bs-docs-header .carbonad {
color: #cdbfe3;
background-color: #866ab3 !important;
}
@media (min-width: 480px) {
.carbonad {
@ -405,8 +423,8 @@ body {
@media (min-width: 992px) {
.carbonad {
position: absolute;
top: 0;
right: 15px; /* 15px instead of 0 since box-sizing */
top: 30px;
right: 60px; /* 15px instead of 0 since box-sizing */
width: 330px !important;
padding: 15px !important;
margin: 0 !important;
@ -517,121 +535,123 @@ body {
* sections of docs content.
*/
/* By default it's not affixed in mobile views, so undo that */
.bs-docs-sidebar.affix {
position: static;
.bs-docs {
padding-left: 240px;
}
.bs-docs-container {
position: relative;
max-width: 940px;
padding: 15px;
}
@media (min-width: 768px) {
.bs-docs-sidebar {
padding-left: 20px;
.bs-docs-container {
padding: 30px;
}
}
@media (min-width: 992px) {
.bs-docs-container {
padding: 30px 60px;
}
}
/* First level of nav */
.bs-docs-sidenav {
margin-top: 20px;
margin-bottom: 20px;
.bs-docs-sidebar {
position: fixed;
top: 0;
bottom: 0;
left: 0;
width: 240px;
padding-bottom: 30px;
overflow-x: hidden;
overflow-y: auto;
background-color: #322f38;
background-image: -webkit-gradient(linear, left top, left bottom, from(#29262f), to(#322f38));
background-image: -webkit-linear-gradient(top, #29262f 0%, #322f38 100%);
background-image: -o-linear-gradient(top, #29262f 0%, #322f38 100%);
background-image: linear-gradient(to bottom, #29262f 0%, #322f38 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#29262f', endColorstr='#322f38', GradientType=0);
background-repeat: repeat-x;
}
/* All levels of nav */
.bs-docs-sidebar .nav > li > a {
.bs-docs-sidebar-brand {
display: block;
padding: 20px;
margin-bottom: 15px;
font-size: 20px;
font-weight: 500;
line-height: 1;
color: #fff;
background-color: #6f4f9f;
border-bottom: 3px solid #563d7c;
}
.bs-docs-sidebar-brand:hover,
.bs-docs-sidebar-brand:focus {
color: #fff;
text-decoration: none;
}
.bs-docs-sidenav {
display: none;
}
.bs-docs-toc-link {
display: block;
padding: 4px 20px;
font-size: 13px;
font-weight: 500;
color: #999;
font-size: 16px;
color: #706e74;
}
.bs-docs-sidebar .nav > li > a:hover,
.bs-docs-sidebar .nav > li > a:focus {
padding-left: 19px;
color: #563d7c;
.bs-docs-toc-link:hover,
.bs-docs-toc-link:focus {
color: #fff;
text-decoration: none;
}
.active > .bs-docs-toc-link {
font-weight: 500;
color: #fff;
}
.active > .bs-docs-sidenav {
display: block;
}
.bs-docs-toc-item.active {
margin-top: 15px;
margin-bottom: 15px;
}
/* All levels of nav */
.bs-docs-toc .nav > li > a {
display: block;
padding: 4px 20px;
font-size: 14px;
color: #99979c;
}
.bs-docs-toc .nav > li > a:hover,
.bs-docs-toc .nav > li > a:focus {
color: #fff;
text-decoration: none;
background-color: transparent;
border-left: 1px solid #563d7c;
}
.bs-docs-sidebar .nav > .active > a,
.bs-docs-sidebar .nav > .active:hover > a,
.bs-docs-sidebar .nav > .active:focus > a {
padding-left: 18px;
font-weight: bold;
color: #563d7c;
.bs-docs-toc .nav > .active > a,
.bs-docs-toc .nav > .active:hover > a,
.bs-docs-toc .nav > .active:focus > a {
font-weight: 500;
color: #fff;
background-color: transparent;
border-left: 2px solid #563d7c;
}
/* Nav: second level (shown on .active) */
.bs-docs-sidebar .nav .nav {
display: none; /* Hide by default, but at >768px, show it */
padding-bottom: 10px;
}
.bs-docs-sidebar .nav .nav > li > a {
padding-top: 1px;
padding-bottom: 1px;
padding-left: 30px;
font-size: 12px;
font-weight: normal;
}
.bs-docs-sidebar .nav .nav > li > a:hover,
.bs-docs-sidebar .nav .nav > li > a:focus {
padding-left: 29px;
}
.bs-docs-sidebar .nav .nav > .active > a,
.bs-docs-sidebar .nav .nav > .active:hover > a,
.bs-docs-sidebar .nav .nav > .active:focus > a {
padding-left: 28px;
font-weight: 500;
}
/* Back to top (hidden on mobile) */
.back-to-top {
.bs-docs-toc .nav .nav {
display: none;
padding: 4px 10px;
margin-top: 10px;
margin-left: 10px;
font-size: 12px;
font-weight: 500;
color: #999;
}
.back-to-top:hover {
color: #563d7c;
text-decoration: none;
.bs-docs-toc .nav > .active > .nav {
display: block;
}
@media (min-width: 768px) {
.back-to-top {
display: block;
}
}
/* Show and affix the side nav when space allows it */
@media (min-width: 992px) {
.bs-docs-sidebar .nav > .active > ul {
display: block;
}
/* Widen the fixed sidebar */
.bs-docs-sidebar.affix,
.bs-docs-sidebar.affix-bottom {
width: 213px;
}
.bs-docs-sidebar.affix {
position: fixed; /* Undo the static from mobile first approach */
top: 20px;
}
.bs-docs-sidebar.affix-bottom {
position: absolute; /* Undo the static from mobile first approach */
}
.bs-docs-sidebar.affix-bottom .bs-docs-sidenav,
.bs-docs-sidebar.affix .bs-docs-sidenav {
margin-top: 0;
margin-bottom: 0;
}
}
@media (min-width: 1200px) {
/* Widen the fixed sidebar again */
.bs-docs-sidebar.affix-bottom,
.bs-docs-sidebar.affix {
width: 263px;
}
.bs-docs-toc .nav .nav > li > a {
padding-top: 2px;
padding-bottom: 2px;
padding-left: 30px;
font-size: 13px;
}

View File

@ -13,4 +13,4 @@ var Holder=Holder||{};!function(a,b){function c(a,b,c){b=parseInt(b,10),a=parseI
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
* details, see http://creativecommons.org/licenses/by/3.0/.
*/
!function(a){a(function(){if(navigator.userAgent.match(/IEMobile\/10\.0/)){var b=document.createElement("style");b.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.querySelector("head").appendChild(b)}{var c=a(window),d=a(document.body);a(".navbar").outerHeight(!0)+10}d.scrollspy({target:".bs-docs-sidebar"}),c.on("load",function(){d.scrollspy("refresh")}),a(".bs-docs-container [href=#]").click(function(a){a.preventDefault()}),setTimeout(function(){var b=a(".bs-docs-sidebar");b.affix({offset:{top:function(){var c=b.offset().top,d=parseInt(b.children(0).css("margin-top"),10),e=a(".bs-docs-nav").height();return this.top=c-e-d},bottom:function(){return this.bottom=a(".bs-docs-footer").outerHeight(!0)}}})},100),setTimeout(function(){a(".bs-top").affix()},100),a(".tooltip-demo").tooltip({selector:"[data-toggle=tooltip]",container:"body"}),a(".tooltip-test").tooltip(),a(".popover-test").popover(),a(".bs-docs-navbar").tooltip({selector:"a[data-toggle=tooltip]",container:".bs-docs-navbar .nav"}),a(".bs-docs-popover").popover(),a(".bs-docs-popover-dismiss").popover({trigger:"focus"}),a("#loading-example-btn").click(function(){var b=a(this);b.button("loading"),setTimeout(function(){b.button("reset")},3e3)})})}(jQuery);
!function(a){a(function(){if(navigator.userAgent.match(/IEMobile\/10\.0/)){var b=document.createElement("style");b.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.querySelector("head").appendChild(b)}var c=a(window),d=a(document.body);d.scrollspy({target:".bs-docs-toc-item"}),c.on("load",function(){d.scrollspy("refresh")}),a(".tooltip-demo").tooltip({selector:"[data-toggle=tooltip]",container:"body"}),a(".tooltip-test").tooltip(),a(".popover-test").popover(),a(".bs-docs-navbar").tooltip({selector:"a[data-toggle=tooltip]",container:".bs-docs-navbar .nav"}),a(".bs-docs-popover").popover(),a(".bs-docs-popover-dismiss").popover({trigger:"focus"}),a("#loading-example-btn").click(function(){var b=a(this);b.button("loading"),setTimeout(function(){b.button("reset")},3e3)})})}(jQuery);

View File

@ -31,44 +31,43 @@
var $window = $(window)
var $body = $(document.body)
var navHeight = $('.navbar').outerHeight(true) + 10
// var navHeight = $('.navbar').outerHeight(true) + 10
$body.scrollspy({
target: '.bs-docs-sidebar',
// offset: navHeight
target: '.bs-docs-toc-item',
})
$window.on('load', function () {
$body.scrollspy('refresh')
})
$('.bs-docs-container [href=#]').click(function (e) {
e.preventDefault()
})
// $('.bs-docs-container [href=#]').click(function (e) {
// e.preventDefault()
// })
// back to top
setTimeout(function () {
var $sideBar = $('.bs-docs-sidebar')
// setTimeout(function () {
// var $sideBar = $('.bs-docs-sidebar')
$sideBar.affix({
offset: {
top: function () {
var offsetTop = $sideBar.offset().top
var sideBarMargin = parseInt($sideBar.children(0).css('margin-top'), 10)
var navOuterHeight = $('.bs-docs-nav').height()
// $sideBar.affix({
// offset: {
// top: function () {
// var offsetTop = $sideBar.offset().top
// var sideBarMargin = parseInt($sideBar.children(0).css('margin-top'), 10)
// var navOuterHeight = $('.bs-docs-nav').height()
return (this.top = offsetTop - navOuterHeight - sideBarMargin)
},
bottom: function () {
return (this.bottom = $('.bs-docs-footer').outerHeight(true))
}
}
})
}, 100)
// return (this.top = offsetTop - navOuterHeight - sideBarMargin)
// },
// bottom: function () {
// return (this.bottom = $('.bs-docs-footer').outerHeight(true))
// }
// }
// })
// }, 100)
setTimeout(function () {
$('.bs-top').affix()
}, 100)
// setTimeout(function () {
// $('.bs-top').affix()
// }, 100)
// tooltip demo
$('.tooltip-demo').tooltip({