Upgrade to Bootstrap 3

This commit is contained in:
benweet 2013-08-15 00:44:51 +01:00
parent 902f857c4e
commit 3d92e33571
46 changed files with 1851 additions and 1199 deletions

View File

@ -48,7 +48,7 @@ div.center div.jGrowl-notification, div.center div.jGrowl-closer {
div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer {
background-color: #777;
zoom: 1;
width: 235px;
width: 280px;
padding: 15px 20px;
margin-top: 5px;
margin-bottom: 5px;
@ -60,7 +60,7 @@ div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer {
}
div.jGrowl div.jGrowl-notification {
min-height: 70px;
min-height: 80px;
}
div.jGrowl div.jGrowl-notification,

View File

@ -427,6 +427,8 @@ define([
};
// Initialize multiple things and then fire eventMgr.onReady
var isDocumentPanelShown = false;
var isMenuPanelShown = false;
core.onReady = function() {
if(viewerMode === true) {
@ -454,7 +456,6 @@ define([
menuPanelElt = $('.menu-panel').collapse({
toggle: false
});
var isMenuPanelShown = false;
var menuPanelBackdropElt = undefined;
menuPanelElt.on('show.bs.collapse', function(e) {
if(e.target === menuPanelElt[0]) {
@ -482,7 +483,6 @@ define([
documentPanelElt = $('.document-panel').collapse({
toggle: false
});
var isDocumentPanelShown = false;
var documentPanelBackdropElt = undefined;
documentPanelElt.on('show.bs.collapse', function(e) {
if(e.target === documentPanelElt[0]) {
@ -507,33 +507,6 @@ define([
}
});
var isModalShown = false;
$('.modal').on('show.bs.modal', function() {
// Close panel if open
menuPanelElt.collapse('hide');
documentPanelElt.collapse('hide');
}).on('shown.bs.modal', function() {
// Focus on the first input when modal opens
isModalShown = true;
_.defer(function(elt) {
elt.find("input:enabled:visible:first").focus();
}, $(this));
}).on('hidden.bs.modal', function() {
// Focus on the editor when modal is gone
isModalShown = false;
$("#wmd-input").focus();
}).keyup(function(e) {
// Handle enter key in modals
if(e.which == 13 && !$(e.target).is("textarea")) {
$(this).find(".modal-footer a:last").click();
}
});
// Configure Mousetrap
mousetrap.stopCallback = function(e, element, combo) {
return uiLocked || isMenuPanelShown || isDocumentPanelShown || isModalShown || $(element).is("input, select, textarea:not(#wmd-input)");
};
// UI layout
createLayout();
@ -583,6 +556,33 @@ define([
}, "");
$("#input-settings-theme").html(themeOptions);
var isModalShown = false;
$('.modal').on('show.bs.modal', function() {
// Close panel if open
menuPanelElt.collapse('hide');
documentPanelElt.collapse('hide');
}).on('shown.bs.modal', function() {
// Focus on the first input when modal opens
isModalShown = true;
_.defer(function(elt) {
elt.find("input:enabled:visible:first").focus();
}, $(this));
}).on('hidden.bs.modal', function() {
// Focus on the editor when modal is gone
isModalShown = false;
$("#wmd-input").focus();
}).keyup(function(e) {
// Handle enter key in modals
if(e.which == 13 && !$(e.target).is("textarea")) {
$(this).find(".modal-footer a:last").click();
}
});
// Configure Mousetrap
mousetrap.stopCallback = function(e, element, combo) {
return uiLocked || isMenuPanelShown || isDocumentPanelShown || isModalShown || $(element).is("input, select, textarea:not(#wmd-input)");
};
// Click events on "insert link" and "insert image" dialog buttons
$(".action-insert-link").click(function(e) {
var value = utils.getInputTextValue($("#input-insert-link"), e);

View File

@ -13,36 +13,43 @@ define([
};
var fileDesc = undefined;
var removeButtonTemplate = '<a class="btn btn-default" title="Remove this location"><i class="icon-trash"></i></a>';
var publishListElt = undefined;
var $msgPublishListElt = undefined;
var $msgNoPublishElt = undefined;
var refreshDialog = function(fileDescParameter) {
if(fileDescParameter !== undefined && fileDescParameter !== fileDesc) {
return;
}
var publishAttributesList = _.values(fileDesc.publishLocations);
$(".msg-no-publish, .msg-publish-list").addClass("hide");
var publishList = $("#manage-publish-list").empty();
if(publishAttributesList.length > 0) {
$(".msg-publish-list").removeClass("hide");
if(_.size(fileDesc.publishLocations) > 0) {
$msgPublishListElt.removeClass("hide");
$msgNoPublishElt.addClass("hide");
}
else {
$(".msg-no-publish").removeClass("hide");
$msgPublishListElt.addClass("hide");
$msgNoPublishElt.removeClass("hide");
}
_.each(publishAttributesList, function(publishAttributes) {
formattedAttributes = _.omit(publishAttributes, "provider", "publishIndex", "sharingLink");
var publishListHtml = _.reduce(fileDesc.publishLocations, function(result, publishAttributes) {
var formattedAttributes = _.omit(publishAttributes, "provider", "publishIndex", "sharingLink");
if(formattedAttributes.password) {
formattedAttributes.password = "********";
}
var publishDesc = JSON.stringify(formattedAttributes).replace(/{|}|"/g, "").replace(/,/g, ", ");
var lineElement = $(_.template(dialogManagePublicationLocationHTML, {
provider: publishAttributes.provider,
publishDesc: publishDesc
}));
lineElement.append($(removeButtonTemplate).click(function() {
formattedAttributes = JSON.stringify(formattedAttributes).replace(/{|}|"/g, "").replace(/,/g, ", ");
return result + _.template(dialogManagePublicationLocationHTML, {
publishAttributes: publishAttributes,
publishDesc: formattedAttributes
});
}, '');
publishListElt.innerHTML = publishListHtml;
_.each(publishListElt.querySelectorAll('.remove-button'), function(removeButtonElt) {
var $removeButtonElt = $(removeButtonElt);
var publishAttributes = fileDesc.publishLocations[$removeButtonElt.data('publishIndex')];
$removeButtonElt.click(function() {
fileDesc.removePublishLocation(publishAttributes);
eventMgr.onPublishRemoved(fileDesc, publishAttributes);
}));
publishList.append(lineElement);
});
});
};
@ -54,6 +61,13 @@ define([
dialogManagePublication.onNewPublishSuccess = refreshDialog;
dialogManagePublication.onPublishRemoved = refreshDialog;
dialogManagePublication.onReady = function() {
var modalElt = document.querySelector(".modal-manage-publish");
publishListElt = modalElt.querySelector(".publish-list");
$msgPublishListElt = $(modalElt.querySelectorAll(".msg-publish-list"));
$msgNoPublishElt = $(modalElt.querySelectorAll(".msg-no-publish"));
};
return dialogManagePublication;
});

View File

@ -18,34 +18,39 @@ define([
};
var fileDesc = undefined;
var removeButtonTemplate = '<a class="btn btn-default" title="Remove this location"><i class="icon-trash"></i></a>';
var syncListElt = undefined;
var $msgSyncListElt = undefined;
var $msgNoSyncElt = undefined;
var refreshDialog = function(fileDescParameter) {
if(fileDescParameter !== undefined && fileDescParameter !== fileDesc) {
return;
}
var syncAttributesList = _.values(fileDesc.syncLocations);
$(".msg-no-sync, .msg-sync-list").addClass("hide");
var syncList = $("#manage-sync-list").empty();
if(syncAttributesList.length > 0) {
$(".msg-sync-list").removeClass("hide");
if(_.size(fileDesc.syncLocations) > 0) {
$msgSyncListElt.removeClass("hide");
$msgNoSyncElt.addClass("hide");
}
else {
$(".msg-no-sync").removeClass("hide");
$msgSyncListElt.addClass("hide");
$msgNoSyncElt.removeClass("hide");
}
_.each(syncAttributesList, function(syncAttributes) {
var syncDesc = syncAttributes.id || syncAttributes.path;
var lineElement = $(_.template(dialogManageSynchronizationLocationHTML, {
provider: syncAttributes.provider,
syncDesc: syncDesc,
isRealtime: syncAttributes.isRealtime
}));
lineElement.append($('<div class="input-group-btn">').append($(removeButtonTemplate).click(function() {
var syncListHtml = _.reduce(fileDesc.syncLocations, function(result, syncAttributes) {
return result + _.template(dialogManageSynchronizationLocationHTML, {
syncAttributes: syncAttributes,
syncDesc: syncAttributes.id || syncAttributes.path
});
}, '');
syncListElt.innerHTML = syncListHtml;
_.each(syncListElt.querySelectorAll('.remove-button'), function(removeButtonElt) {
var $removeButtonElt = $(removeButtonElt);
var syncAttributes = fileDesc.syncLocations[$removeButtonElt.data('syncIndex')];
$removeButtonElt.click(function() {
synchronizer.tryStopRealtimeSync();
fileDesc.removeSyncLocation(syncAttributes);
eventMgr.onSyncRemoved(fileDesc, syncAttributes);
})));
syncList.append(lineElement);
});
});
};
@ -58,16 +63,10 @@ define([
dialogManageSynchronization.onSyncRemoved = refreshDialog;
dialogManageSynchronization.onReady = function() {
// Handle enter key in the sync manual inputs
$(".sync-manual").each(function() {
var elt = $(this);
elt.find("input").keyup(function(e) {
if(e.which == 13) {
elt.find("a").click();
e.stopPropagation();
}
});
});
var modalElt = document.querySelector(".modal-manage-sync");
syncListElt = modalElt.querySelector(".sync-list");
$msgSyncListElt = $(modalElt.querySelectorAll(".msg-sync-list"));
$msgNoSyncElt = $(modalElt.querySelectorAll(".msg-no-sync"));
};
return dialogManageSynchronization;

View File

@ -113,7 +113,7 @@ define([
title: title,
mimeType: contentType
};
if(parentId !== undefined) {
if(parentId) {
// Specify the directory
metadata.parents = [
{
@ -124,7 +124,7 @@ define([
}
var path = '/upload/drive/v2/files';
var method = 'POST';
if(fileId !== undefined) {
if(fileId) {
// If it's an update
path += "/" + fileId;
method = 'PUT';

View File

@ -126,10 +126,9 @@
<ul class="nav">
<li><a href="#" data-toggle="modal"
data-target=".modal-settings"
class="action-load-settings list-group-item"><i class="icon-cog"></i>
class="action-load-settings"><i class="icon-cog"></i>
Settings</a></li>
<li><a href="#" data-toggle="modal" data-target=".modal-about"
class="list-group-item"><i class="icon-help-circled"></i> About</a></li>
<li><a href="#" data-toggle="modal" data-target=".modal-about"><i class="icon-help-circled"></i> About</a></li>
</ul>
</div>
@ -145,7 +144,7 @@
<div class="input-group">
<span class="input-group-addon"><i class="icon-search"></i></span><input
type="text" class="form-control"></input>
<button type="button" class="close" title="clear">&times;</button>
<button type="button" class="close" title="clear">&times;</button>
<div class="input-group-btn">
<a data-toggle="modal" data-target=".modal-document-manager"
class="btn btn-default" title="Manage documents"><i
@ -412,35 +411,45 @@
<h3 class="modal-title">Export to Google Drive</h3>
</div>
<div class="modal-body">
<blockquote class="muted">This will save the current
document to your Google Drive account and keep it synchronized.</blockquote>
<p>
Please specify a <b>folder ID</b> (optional):
</p>
<div class="input-prepend">
<span class="add-on"><i class="icon-provider-gdrive"></i></span><input
id="input-sync-export-gdrive-parentid" type="text"
class="col-lg-5 form-control" placeholder="FolderID"></input>
<p>This will save "<span class="file-title"></span>" to your Google Drive
account and keep it synchronized.</p>
<div class="form-horizontal">
<div class="form-group">
<label class="col-lg-3 control-label"
for="input-sync-export-gdrive-parentid">Folder ID
(optional)</label>
<div class="col-lg-8">
<input type="text" id="input-sync-export-gdrive-parentid"
placeholder="FolderID" class="form-control"> <span
class="help-block"> If no folder ID is supplied, the file
will be created in your root folder. </span>
</div>
</div>
<div class="form-group">
<div class="col-lg-3 control-label"></div>
<div class="col-lg-8">
<label> <input id="input-sync-export-gdrive-realtime"
type="checkbox"> Create a real time collaborative
document
</label>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label"
for="input-sync-export-gdrive-fileid">Existing file ID
(optional)</label>
<div class="col-lg-8">
<input type="text" id="input-sync-export-gdrive-fileid"
placeholder="FileID" class="form-control"> <span
class="help-block"> This will overwrite the existing file on the server. </span>
</div>
</div>
</div>
<br /> <br />
<blockquote class="muted">
<b>NOTE:</b>
<ul>
<li>If no folder ID is supplied, the file will be created in
your root folder.</li>
<li>You can move or rename the file afterwards within Google
Drive.</li>
</ul>
</blockquote>
<div class="checkbox">
<label> <input id="input-sync-export-gdrive-realtime"
type="checkbox"> Create a real time collaborative document
</label>
</div>
<br /> <br />
<blockquote class="muted">
<b>NOTE:</b>
<ul>
<li>Real time collaborative documents can't be open outside
StackEdit.</li>
<li>Real time collaborative documents can't have multiple
@ -468,18 +477,20 @@
<h3 class="modal-title">Export to Dropbox</h3>
</div>
<div class="modal-body">
<blockquote class="muted">This will save the current
document to your Dropbox account and keep it synchronized.</blockquote>
<p>
Please specify a <b>file path</b> for "<span class="file-title"></span>":
</p>
<div class="input-prepend">
<span class="add-on"><i class="icon-provider-dropbox"></i></span><input
id="input-sync-export-dropbox-path" type="text"
class="col-lg-5 form-control"
placeholder="/path/to/My Document.md"></input>
<p>This will save "<span class="file-title"></span>" to your Dropbox account
and keep it synchronized.</p>
<div class="form-horizontal">
<div class="form-group">
<label class="col-lg-3 control-label"
for="input-sync-export-dropbox-path">File path</label>
<div class="col-lg-8">
<input type="text" id="input-sync-export-dropbox-path"
placeholder="/path/to/My Document.md" class="form-control">
<span class="help-block"> File path is composed of both
folder and filename. </span>
</div>
</div>
</div>
<br /> <br />
<blockquote class="muted">
<b>NOTE:</b>
<ul>
@ -514,34 +525,17 @@
"<span class="file-title"></span>" is synchronized with the
following location(s):
</p>
<p id="manage-sync-list"></p>
<div class="msg-sync-list sync-list hide"></div>
<blockquote class="msg-sync-list hide muted">
<b>NOTE:</b> Removing a synchronized location will not delete any
file.
</blockquote>
<blockquote class="msg-no-sync hide muted">
"<span class="file-title"></span>" is not synchronized yet.
</blockquote>
<p>Add a synchronized location manually:</p>
<div class="input-prepend input-append sync-manual">
<span class="add-on" title="Google Drive"><i
class="icon-provider-gdrive"></i></span><input
id="input-sync-manual-gdrive-id" type="text"
class="col-lg-5 form-control" placeholder="GoogleDriveFileID"></input>
<a class="btn btn-default action-sync-manual-gdrive"
title="Add location" data-dismiss="modal"><i class="icon-ok"></i></a>
</div>
<div class="input-prepend input-append sync-manual">
<span class="add-on" title="Dropbox"><i
class="icon-provider-dropbox"></i></span><input
id="input-sync-manual-dropbox-path" type="text"
class="col-lg-5 form-control" placeholder="/dropbox/file/path"></input>
<a class="btn btn-default action-sync-manual-dropbox"
title="Add location" data-dismiss="modal"><i class="icon-ok"></i></a>
</div>
<blockquote class="muted">
<b>NOTE:</b> This will first upload the document and overwrite the
existing file on the server.
"<span class="file-title"></span>" is not synchronized yet. <br />
<br /> <b>NOTE:</b> You can add synchronized locations by
exporting your document using <i class="icon-provider-gdrive"></i>
Google Drive or <i class="icon-provider-dropbox"></i> Dropbox
sub-menu.
</blockquote>
</div>
<div class="modal-footer">
@ -794,7 +788,7 @@
"<span class="file-title"></span>" is published on the following
location(s):
</p>
<div id="manage-publish-list"></div>
<div class="msg-publish-list publish-list hide"></div>
<blockquote class="muted">
<div class="msg-no-publish hide">
"<span class="file-title"></span>" is not published yet. <br /> <br />

View File

@ -1,5 +1,11 @@
<div class="input-prepend input-append">
<span class="add-on" title="<%= provider.providerName %>"> <i
class="icon-provider-<%= provider.providerId %>"></i>
</span> <input class="span5" type="text" value="<%= publishDesc %>" disabled />
<div class="input-group">
<span class="input-group-addon" title="<%= publishAttributes.provider.providerName %>">
<i class="icon-provider-<%= publishAttributes.provider.providerId %>"></i>
</span> <input class="form-control" type="text"
value="<%= publishDesc %>" disabled />
<div class="input-group-btn">
<a class="btn btn-default remove-button" title="Remove this location"
data-publish-index="<%= publishAttributes.publishIndex %>"><i
class="icon-trash"></i></a>
</div>
</div>

View File

@ -1,5 +1,12 @@
<div class="input-group">
<span class="input-group-addon" title="<%= provider.providerName %><%= isRealtime ? ' (real time)' : '' %>"> <i
class="icon-provider-<%= provider.providerId %><%= isRealtime ? ' realtime' : '' %>"></i>
</span> <input class="col-lg-6 form-control" type="text" value="<%= syncDesc %>" disabled />
<span class="input-group-addon"
title="<%= syncAttributes.provider.providerName %><%= syncAttributes.isRealtime ? ' (real time)' : '' %>">
<i
class="icon-provider-<%= syncAttributes.provider.providerId %><%= syncAttributes.isRealtime ? ' realtime' : '' %>"></i>
</span> <input class="form-control" type="text"
value="<%= syncDesc %>" disabled />
<div class="input-group-btn">
<a class="btn btn-default remove-button" title="Remove this location"
data-sync-index="<%= syncAttributes.syncIndex %>"><i class="icon-trash"></i></a>
</div>
</div>

View File

@ -50,8 +50,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
var called = false, $el = this
$(this).one('webkitTransitionEnd', function () { called = true })
var callback = function () { if (!called) $($el).trigger('webkitTransitionEnd') }
$(this).one($.support.transition.end, function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}
@ -219,7 +219,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var $parent = this.$element.closest('[data-toggle="buttons"]')
if ($parent.length) {
var $input = this.$element.find('input').prop('checked', !this.$element.hasClass('active'))
var $input = this.$element.find('input')
.prop('checked', !this.$element.hasClass('active'))
.trigger('change')
if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
}
@ -235,7 +237,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$.fn.button = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('button')
var data = $this.data('bs.button')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.button', (data = new Button(this, options)))
@ -312,6 +314,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
Carousel.DEFAULTS = {
interval: 5000
, pause: 'hover'
, wrap: true
}
Carousel.prototype.cycle = function (e) {
@ -376,12 +379,15 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var fallback = type == 'next' ? 'first' : 'last'
var that = this
if (!$next.length) {
if (!this.options.wrap) return
$next = this.$element.find('.item')[fallback]()
}
this.sliding = true
isCycling && this.pause()
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
if ($next.hasClass('active')) return
@ -533,7 +539,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var actives = this.$parent && this.$parent.find('> .accordion-group > .in')
var actives = this.$parent && this.$parent.find('> .panel > .in')
if (actives && actives.length) {
var hasData = actives.data('bs.collapse')
@ -654,7 +660,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var $parent = parent && $(parent)
if (!data || !data.transitioning) {
if ($parent) $parent.find('[data-toggle=collapse][data-parent=' + parent + ']').not($this).addClass('collapsed')
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
}
@ -849,7 +855,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.$backdrop =
this.isShown = null
if (this.options.remote) this.$element.find('.modal-body').load(this.options.remote)
if (this.options.remote) this.$element.load(this.options.remote)
}
Modal.DEFAULTS = {
@ -858,13 +864,13 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
, show: true
}
Modal.prototype.toggle = function () {
return this[!this.isShown ? 'show' : 'hide']()
Modal.prototype.toggle = function (_relatedTarget) {
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
}
Modal.prototype.show = function () {
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event('show.bs.modal')
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
@ -893,13 +899,15 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
that.enforceFocus()
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
transition ?
that.$element
.one($.support.transition.end, function () {
that.$element.focus().trigger('shown.bs.modal')
that.$element.focus().trigger(e)
})
.emulateTransitionEnd(300) :
that.$element.focus().trigger('shown.bs.modal')
that.$element.focus().trigger(e)
})
}
@ -921,6 +929,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.$element
.removeClass('in')
.attr('aria-hidden', true)
.off('click.dismiss.modal')
$.support.transition && this.$element.hasClass('fade') ?
this.$element
@ -973,7 +982,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
this.$element.on('click', $.proxy(function (e) {
this.$element.on('click.dismiss.modal', $.proxy(function (e) {
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus.call(this.$element[0])
@ -1012,15 +1021,15 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var old = $.fn.modal
$.fn.modal = function (option) {
$.fn.modal = function (option, _relatedTarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.modal')
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]()
else if (options.show) data.show()
if (typeof option == 'string') data[option](_relatedTarget)
else if (options.show) data.show(_relatedTarget)
})
}
@ -1043,26 +1052,26 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
var option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
e.preventDefault()
$target
.modal(option)
.modal(option, this)
.one('hide', function () {
$this.is(':visible') && $this.focus()
})
})
var $body = $(document.body)
.on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') })
.on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') })
$(document)
.on('shown.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
}(window.jQuery);
/* ========================================================================
* Bootstrap: tooltip.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#affix
* http://twbs.github.com/bootstrap/javascript.html#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
* Copyright 2012 Twitter, Inc.
@ -1126,7 +1135,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
}
@ -1153,16 +1162,20 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
return options
}
Tooltip.prototype.enter = function (obj) {
var defaults = this.getDefaults()
Tooltip.prototype.getDelegateOptions = function () {
var options = {}
var defaults = this.getDefaults()
this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
})
return options
}
Tooltip.prototype.enter = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget)[this.type](options).data('bs.' + this.type)
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
@ -1176,7 +1189,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
Tooltip.prototype.leave = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget)[this.type](this._options).data('bs.' + this.type)
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
@ -1241,12 +1254,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
.addClass(placement)
}
var tp = placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
this.applyPlacement(tp, placement)
this.applyPlacement(calculatedOffset, placement)
this.$element.trigger('shown.bs.' + this.type)
}
}
@ -1258,25 +1268,33 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var height = $tip[0].offsetHeight
// manually read margins because getBoundingClientRect includes difference
offset.top = offset.top + parseInt($tip.css('margin-top'), 10)
offset.left = offset.left + parseInt($tip.css('margin-left'), 10)
var marginTop = parseInt($tip.css('margin-top'), 10)
var marginLeft = parseInt($tip.css('margin-left'), 10)
// we must check for NaN for ie 8/9
if (isNaN(marginTop)) marginTop = 0
if (isNaN(marginLeft)) marginLeft = 0
offset.top = offset.top + marginTop
offset.left = offset.left + marginLeft
$tip
.offset(offset)
.addClass('in')
// check to see if placing tip in new offset caused the tip to resize itself
var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight
if (placement == 'top' && actualHeight != height) {
replace = true
offset.top = offset.top + height - actualHeight
offset.top = offset.top + height - actualHeight
}
if (placement == 'bottom' || placement == 'top') {
if (/bottom|top/.test(placement)) {
var delta = 0
if (offset.left < 0){
if (offset.left < 0) {
delta = offset.left * -2
offset.left = 0
@ -1311,6 +1329,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var $tip = this.tip()
var e = $.Event('hide.bs.' + this.type)
function complete() { $tip.detach() }
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
@ -1319,9 +1339,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$.support.transition && this.$tip.hasClass('fade') ?
$tip
.one($.support.transition.end, $tip.detach)
.one($.support.transition.end, complete)
.emulateTransitionEnd(150) :
$tip.detach()
complete()
this.$element.trigger('hidden.bs.' + this.type)
@ -1347,6 +1367,13 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
}, this.$element.offset())
}
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
}
Tooltip.prototype.getTitle = function () {
var title
var $e = this.$element
@ -1362,8 +1389,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
return this.$tip = this.$tip || $(this.options.template)
}
Tooltip.prototype.arrow =function(){
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
Tooltip.prototype.arrow = function () {
return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
}
Tooltip.prototype.validate = function () {
@ -1387,7 +1414,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
}
Tooltip.prototype.toggle = function (e) {
var self = e ? $(e.currentTarget)[this.type](this._options).data('bs.' + this.type) : this
var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
}
@ -1485,7 +1512,9 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
$tip.removeClass('fade top bottom left right in')
$tip.find('.popover-title:empty').hide()
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
// this manually by checking the contents.
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
}
Popover.prototype.hasContent = function () {
@ -1502,15 +1531,15 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
o.content)
}
Popover.prototype.arrow = function () {
return this.$arrow = this.$arrow || this.tip().find('.arrow')
}
Popover.prototype.tip = function () {
if (!this.$tip) this.$tip = $(this.options.template)
return this.$tip
}
Popover.prototype.destroy = function () {
this.hide().$element.off('.' + this.type).removeData(this.type)
}
// POPOVER PLUGIN DEFINITION
// =========================

View File

@ -1,31 +0,0 @@
//
// Accordion
// --------------------------------------------------
// Parent container
.accordion {
margin-bottom: @line-height-computed;
}
// Group == heading + body
.accordion-group {
margin-bottom: 2px;
border: 1px solid @accordion-border-color;
border-radius: @border-radius-base;
}
.accordion-heading {
border-bottom: 0;
.accordion-toggle {
display: block;
padding: 8px 15px;
cursor: pointer;
}
}
// Inner needs the styles because you can't animate properly with any styles on the element
.accordion-inner {
padding: 9px 15px;
border-top: 1px solid @accordion-border-color;
}

View File

@ -7,7 +7,7 @@
// -------------------------
.alert {
padding: 10px 35px 10px 15px;
padding: @alert-padding;
margin-bottom: @line-height-computed;
color: @alert-text;
background-color: @alert-bg;
@ -26,10 +26,27 @@
}
// Provide class for links that match alerts
.alert-link {
font-weight: 500;
font-weight: @alert-link-font-weight;
color: darken(@alert-text, 10%);
}
// Improve alignment and spacing of inner content
> p,
> ul {
margin-bottom: 0;
}
> p + p {
margin-top: 5px;
}
}
// Dismissable alerts
//
// Expand the right padding and account for the close button's positioning.
.alert-dismissable {
padding-right: (@alert-padding + 20);
// Adjust close link position
.close {
position: relative;
@ -40,30 +57,15 @@
}
// Alternate styles
// -------------------------
//
// Generate contextual modifier classes for colorizing the alert.
.alert-success {
.alert-variant(@alert-success-bg, @alert-success-border, @alert-success-text);
.alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text);
}
.alert-danger {
.alert-variant(@alert-danger-bg, @alert-danger-border, @alert-danger-text);
.alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text);
}
.alert-info {
.alert-variant(@alert-info-bg, @alert-info-border, @alert-info-text);
}
// Block alerts
// -------------------------
.alert-block {
padding-top: 15px;
padding-bottom: 15px;
> p,
> ul {
margin-bottom: 0;
}
p + p {
margin-top: 5px;
}
.alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text);
}

View File

@ -9,16 +9,16 @@
min-width: 10px;
padding: 3px 7px;
font-size: @font-size-small;
font-weight: bold;
font-weight: @badge-font-weight;
color: @badge-color;
line-height: 1;
vertical-align: middle;
line-height: @badge-line-height;
vertical-align: baseline;
white-space: nowrap;
text-align: center;
background-color: @badge-bg;
border-radius: 10px;
border-radius: @badge-border-radius;
// Empty labels/badges collapse
// Empty badges collapse automatically (not available in IE8)
&:empty {
display: none;
}

View File

@ -28,6 +28,7 @@
// Components: common
@import "component-animations.less";
@import "input-groups.less";
@import "dropdowns.less";
@import "list-group.less";
@import "panels.less";
@ -54,7 +55,6 @@
@import "labels.less";
@import "badges.less";
@import "progress-bars.less";
@import "accordion.less";
@import "carousel.less";
@import "jumbotron.less";

View File

@ -3,11 +3,32 @@
// --------------------------------------------------
// Button carets
.btn .caret {
border-top-color: @btn-default-color;
//
// Match the button text color to the arrow/caret for indicating dropdown-ness.
.caret {
.btn-default & {
border-top-color: @btn-default-color;
}
.btn-primary &,
.btn-success &,
.btn-warning &,
.btn-danger &,
.btn-info & {
border-top-color: #fff;
}
}
.dropup .btn .caret {
border-bottom-color: @btn-default-color;
.dropup .caret {
.btn-default & {
border-bottom-color: @btn-default-color;
}
.btn-primary &,
.btn-success &,
.btn-warning &,
.btn-danger &,
.btn-info & {
border-bottom-color: #fff;
}
}
// Make the div behave like a button
@ -21,15 +42,26 @@
float: left;
// Bring the "active" button to the front
&:hover,
&:active {
&:focus,
&:active,
&.active {
z-index: 2;
}
&:focus {
// Remove focus outline when dropdown JS adds it after closing the menu
outline: none;
}
}
}
// Prevent double borders when buttons are next to each other
.btn-group .btn + .btn {
margin-left: -1px;
.btn-group {
.btn + .btn,
.btn + .btn-group,
.btn-group + .btn,
.btn-group + .btn-group {
margin-left: -1px;
}
}
// Optional: Group multiple button groups together for a toolbar
@ -90,6 +122,14 @@
}
// Sizing
//
// Remix the default button sizing classes into new ones for easier manipulation.
.btn-group-xs > .btn { .btn-xs(); }
.btn-group-sm > .btn { .btn-sm(); }
.btn-group-lg > .btn { .btn-lg(); }
// Split button dropdowns
// ----------------------
@ -99,7 +139,7 @@
padding-left: 8px;
padding-right: 8px;
}
.btn-group > .btn-large + .dropdown-toggle {
.btn-group > .btn-lg + .dropdown-toggle {
padding-left: 12px;
padding-right: 12px;
}
@ -116,38 +156,70 @@
margin-left: 0;
}
// Carets in other button sizes
.btn-large .caret {
border-width: 5px;
.btn-lg .caret {
border-width: @caret-width-large;
}
// Upside down carets for .dropup
.dropup .btn-large .caret {
border-bottom-width: 5px;
.dropup .btn-lg .caret {
border-bottom-width: @caret-width-large;
}
// Vertical button groups
// ----------------------
.btn-group-vertical > .btn {
display: block;
float: none;
width: 100%;
max-width: 100%;
+ .btn {
.btn-group-vertical {
> .btn,
> .btn-group {
display: block;
float: none;
width: 100%;
max-width: 100%;
}
// Clear floats so dropdown menus can be properly placed
> .btn-group {
.clearfix();
> .btn {
float: none;
}
}
> .btn + .btn,
> .btn + .btn-group,
> .btn-group + .btn,
> .btn-group + .btn-group {
margin-top: -1px;
margin-left: 0;
}
}
.btn-group-vertical .btn {
.btn-group-vertical > .btn {
&:not(:first-child):not(:last-child) {
border-radius: 0;
}
&:first-child {
&:first-child:not(:last-child) {
border-top-right-radius: @border-radius-base;
.border-bottom-radius(0);
}
&:last-child {
&:last-child:not(:first-child) {
border-bottom-left-radius: @border-radius-base;
.border-top-radius(0);
}
}
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
border-radius: 0;
}
.btn-group-vertical > .btn-group:first-child {
> .btn:last-child,
> .dropdown-toggle {
.border-bottom-radius(0);
}
}
.btn-group-vertical > .btn-group:last-child > .btn:first-child {
.border-top-radius(0);
}
// Justified button groups
@ -156,6 +228,8 @@
.btn-group-justified {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
.btn {
float: none;
display: table-cell;
@ -165,7 +239,7 @@
// Checkbox and radio options
.btn-group[data-toggle="buttons"] > .btn > input[type="radio"],
.btn-group[data-toggle="buttons"] > .btn > input[type="checkbox"] {
[data-toggle="buttons"] > .btn > input[type="radio"],
[data-toggle="buttons"] > .btn > input[type="checkbox"] {
display: none;
}

View File

@ -12,7 +12,7 @@
padding: @padding-base-vertical @padding-base-horizontal;
margin-bottom: 0; // For input.btn
font-size: @font-size-base;
font-weight: 500;
font-weight: @btn-font-weight;
line-height: @line-height-base;
text-align: center;
vertical-align: middle;
@ -20,6 +20,7 @@
border: 1px solid transparent;
border-radius: @border-radius-base;
white-space: nowrap;
.user-select(none);
&:focus {
.tab-focus();
@ -27,7 +28,7 @@
&:hover,
&:focus {
color: @btn-hover-color;
color: @btn-default-color;
text-decoration: none;
}
@ -53,26 +54,26 @@
// --------------------------------------------------
.btn-default {
.btn-pseudo-states(@btn-default-color, @btn-default-bg, @btn-default-border);
.button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);
}
.btn-primary {
.btn-pseudo-states(@btn-primary-color, @btn-primary-bg, @btn-primary-border);
.button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);
}
// Warning appears as orange
.btn-warning {
.btn-pseudo-states(@btn-warning-color, @btn-warning-bg, @btn-warning-border);
.button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border);
}
// Danger and error appear as red
.btn-danger {
.btn-pseudo-states(@btn-danger-color, @btn-danger-bg, @btn-danger-border);
.button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);
}
// Success appears as green
.btn-success {
.btn-pseudo-states(@btn-success-color, @btn-success-bg, @btn-success-border);
.button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);
}
// Info appears as blue-green
.btn-info {
.btn-pseudo-states(@btn-info-color, @btn-info-bg, @btn-info-border);
.button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);
}
@ -109,7 +110,7 @@
fieldset[disabled] & {
&:hover,
&:focus {
color: @gray-dark;
color: @btn-link-disabled-color;
text-decoration: none;
}
}
@ -119,16 +120,17 @@
// Button Sizes
// --------------------------------------------------
.btn-large {
padding: @padding-large-vertical @padding-large-horizontal;
font-size: @font-size-large;
border-radius: @border-radius-large;
.btn-lg {
// line-height: ensure even-numbered height of button next to large input
.button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
}
.btn-small {
padding: @padding-small-vertical @padding-small-horizontal;
font-size: @font-size-small;
line-height: 1.5; // ensure proper height of button next to small input
border-radius: @border-radius-small;
.btn-sm,
.btn-xs {
// line-height: ensure proper height of button next to small input
.button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
}
.btn-xs {
padding: 3px 5px;
}

View File

@ -69,9 +69,9 @@
top: 0;
left: 0;
bottom: 0;
width: 15%;
.opacity(.5);
font-size: 20px;
width: @carousel-control-width;
.opacity(@carousel-control-opacity);
font-size: @carousel-control-font-size;
color: @carousel-control-color;
text-align: center;
text-shadow: @carousel-text-shadow;
@ -81,13 +81,11 @@
// Set gradients for backgrounds
&.left {
#gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001));
background-color: transparent;
}
&.right {
left: auto;
right: 0;
#gradient > .horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5));
background-color: transparent;
}
// Hover/focus state
@ -99,7 +97,6 @@
}
// Toggles
.glyphicon,
.icon-prev,
.icon-next {
position: absolute;
@ -113,7 +110,7 @@
margin-left: -10px;
font-family: serif;
}
// Non-glyphicon toggles
.icon-prev {
&:before {
content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039)
@ -127,14 +124,17 @@
}
// Optional indicator pips
// -----------------------------
//
// Add an unordered list with the following class and add a list item for each
// slide your carousel holds.
.carousel-indicators {
position: absolute;
bottom: 10px;
left: 50%;
z-index: 15;
width: 120px;
margin-left: -60px;
width: 60%;
margin-left: -30%;
padding-left: 0;
list-style: none;
text-align: center;
@ -181,7 +181,6 @@
@media screen and (min-width: @screen-tablet) {
// Scale up the controls a smidge
.carousel-control .glyphicon,
.carousel-control .icon-prev,
.carousel-control .icon-next {
width: 30px;

View File

@ -6,7 +6,7 @@
.close {
float: right;
font-size: (@font-size-base * 1.5);
font-weight: bold;
font-weight: @close-font-weight;
line-height: 1;
color: @close-color;
text-shadow: @close-text-shadow;

View File

@ -16,7 +16,7 @@ code {
color: @code-color;
background-color: @code-bg;
white-space: nowrap;
border-radius: 4px;
border-radius: @border-radius-base;
}
// Blocks of code
@ -28,7 +28,7 @@ pre {
line-height: @line-height-base;
word-break: break-all;
word-wrap: break-word;
color: @gray-dark;
color: @pre-color;
background-color: @pre-bg;
border: 1px solid @pre-border-color;
border-radius: @border-radius-base;
@ -41,6 +41,7 @@ pre {
// Account for some code outputs that place code tags in pre tags
code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
@ -50,6 +51,6 @@ pre {
// Enable scrollable blocks of code
.pre-scrollable {
max-height: 340px;
max-height: @pre-scrollable-max-height;
overflow-y: scroll;
}

View File

@ -4,21 +4,29 @@
// Dropdown arrow/caret
// --------------------
.caret {
display: inline-block;
width: 0;
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: 4px solid @dropdown-caret-color;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
border-top: @caret-width-base solid @dropdown-caret-color;
border-right: @caret-width-base solid transparent;
border-left: @caret-width-base solid transparent;
content: "";
}
// The dropdown wrapper (div)
.dropdown {
position: relative;
}
// Prevent the focus on the dropdown toggle when closing dropdowns
.dropdown-toggle:focus {
outline: 0;
}
// The dropdown menu (ul)
// ----------------------
.dropdown-menu {
position: absolute;
top: 100%;
@ -30,12 +38,13 @@
padding: 5px 0;
margin: 2px 0 0; // override default ul
list-style: none;
font-size: @font-size-base;
background-color: @dropdown-bg;
border: 1px solid @dropdown-fallback-border; // IE8 fallback
border: 1px solid @dropdown-border;
border-radius: @border-radius-base;
.box-shadow(0 6px 12px rgba(0,0,0,.175));
.background-clip(padding-box);
background-clip: padding-box;
// Aligns the dropdown menu to right
&.pull-right {
@ -61,18 +70,17 @@
}
// Hover/Focus state
// -----------
.dropdown-menu > li > a {
&:hover,
&:focus {
text-decoration: none;
color: @dropdown-link-hover-color;
#gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));
background-color: darken(@dropdown-link-hover-bg, 5%);
}
}
// Active state
// ------------
.dropdown-menu > .active > a {
&,
&:hover,
@ -81,17 +89,19 @@
text-decoration: none;
outline: 0;
#gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));
background-color: darken(@dropdown-link-active-bg, 5%);
}
}
// Disabled state
// --------------
//
// Gray out text and ensure the hover/focus state remains gray
.dropdown-menu > .disabled > a {
&,
&:hover,
&:focus {
color: @gray-light;
color: @dropdown-link-disabled-color;
}
}
// Nuke hover/focus effects
@ -107,7 +117,6 @@
}
// Open state for the dropdown
// ---------------------------
.open {
// Show the menu
> .dropdown-menu {
@ -121,19 +130,15 @@
}
// Dropdown section headers
// ---------------------------
.dropdown-header {
display: block;
padding: 3px 20px;
font-size: @font-size-small;
line-height: @line-height-base;
color: @gray-light;
color: @dropdown-header-color;
}
// Backdrop to catch body clicks on mobile, etc.
// ---------------------------
.dropdown-backdrop {
position: fixed;
left: 0;
@ -144,16 +149,16 @@
}
// Right aligned dropdowns
// ---------------------------
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}
// Allow for dropdowns to go bottom up (aka, dropup-menu)
// ------------------------------------------------------
//
// Just add .dropup after the standard .dropdown class and you're set, bro.
// TODO: abstract this so that the navbar fixed styles are not placed here?
.dropup,
.navbar-fixed-bottom .dropdown {
// Reverse the caret

View File

@ -20,7 +20,7 @@ legend {
margin-bottom: @line-height-computed;
font-size: (@font-size-base * 1.5);
line-height: inherit;
color: @gray-dark;
color: @legend-color;
border: 0;
border-bottom: 1px solid @legend-border-color;
}
@ -77,7 +77,7 @@ input[type="checkbox"]:focus {
// See https://github.com/twbs/bootstrap/issues/8350 for more.
input[type="number"] {
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
&::-webkit-inner-spin-button {
height: auto;
}
}
@ -121,7 +121,7 @@ input[type="number"] {
padding: @padding-base-vertical @padding-base-horizontal;
font-size: @font-size-base;
line-height: @line-height-base;
color: @gray;
color: @input-color;
vertical-align: middle;
background-color: @input-bg;
border: 1px solid @input-border;
@ -129,11 +129,8 @@ input[type="number"] {
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
.transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
&:focus {
border-color: rgba(82,168,236,.8);
outline: 0;
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
}
// Customize the `:focus` state to imitate native WebKit styles.
.form-control-focus();
// Disabled and read-only inputs
// Note: HTML5 says that inputs under a fieldset > legend:first-child won't be
@ -211,36 +208,13 @@ input[type="number"] {
}
// Form control sizing
//
// Relative text size, padding, and border-radii changes for form controls. For
// horizontal sizing, wrap controls in the predefined grid classes. `<select>`
// element gets special love because it's special, and that's a fact!
.form-control {
&.input-large {
height: @input-height-large;
padding: @padding-large-vertical @padding-large-horizontal;
font-size: @font-size-large;
border-radius: @border-radius-large;
}
&.input-small {
height: @input-height-small;
padding: @padding-small-vertical @padding-small-horizontal;
font-size: @font-size-small;
border-radius: @border-radius-small;
}
.input-sm {
.input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
}
select {
&.input-large {
height: @input-height-large;
line-height: @input-height-large;
}
&.input-small {
height: @input-height-small;
line-height: @input-height-small;
}
.input-lg {
.input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
}
@ -250,15 +224,26 @@ select {
// Warning
.has-warning {
.form-control-validation(@state-warning-text, @state-warning-text, @state-warning-bg);
.form-control-validation(@state-warning-text; @state-warning-text; @state-warning-bg);
}
// Error
.has-error {
.form-control-validation(@state-danger-text, @state-danger-text, @state-danger-bg);
.form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);
}
// Success
.has-success {
.form-control-validation(@state-success-text, @state-success-text, @state-success-bg);
.form-control-validation(@state-success-text; @state-success-text; @state-success-bg);
}
// Static form control text
//
// Apply class to a `p` element to make any string of text align with labels in
// a horizontal form layout.
.form-control-static {
margin-bottom: 0; // Remove default margin from `p`
padding-top: @padding-base-vertical;
}
@ -276,137 +261,61 @@ select {
// Input groups
// --------------------------------------------------
// Base styles
// -------------------------
.input-group {
display: table;
border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
// Undo padding and float of grid classes
&.col {
float: none;
padding-left: 0;
padding-right: 0;
}
.form-control {
width: 100%;
margin-bottom: 0;
}
}
// Display as table-cell
// -------------------------
.input-group-addon,
.input-group-btn,
.input-group .form-control {
display: table-cell;
&:not(:first-child):not(:last-child) {
border-radius: 0;
}
}
// Addon and addon wrapper for buttons
.input-group-addon,
.input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle; // Match the inputs
}
// Text input groups
// -------------------------
.input-group-addon {
.box-sizing(border-box);
padding: @padding-base-vertical @padding-base-horizontal;
font-size: @font-size-base;
font-weight: normal;
line-height: @line-height-base;
text-align: center;
background-color: @gray-lighter;
border: 1px solid @input-group-addon-border-color;
border-radius: @border-radius-base;
&.input-small {
padding: @padding-small-vertical @padding-small-horizontal;
font-size: @font-size-small;
border-radius: @border-radius-small;
}
&.input-large {
padding: @padding-large-vertical @padding-large-horizontal;
font-size: @font-size-large;
border-radius: @border-radius-large;
}
}
// Reset rounded corners
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
.border-right-radius(0);
}
.input-group-addon:first-child {
border-right: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child) {
.border-left-radius(0);
}
.input-group-addon:last-child {
border-left: 0;
}
// Button input groups
// -------------------------
.input-group-btn {
position: relative;
white-space: nowrap;
}
.input-group-btn > .btn {
position: relative;
// Jankily prevent input button groups from wrapping
+ .btn {
margin-left: -4px;
}
// Bring the "active" button to the front
&:hover,
&:active {
z-index: 2;
}
}
// Inline forms
// --------------------------------------------------
//
// Make forms appear inline(-block) by adding the `.form-inline` class. Inline
// forms begin stacked on extra small (mobile) devices and then go inline when
// viewports reach <768px.
//
// Requires wrapping inputs and labels with `.form-group` for proper display of
// default HTML form controls and our custom form controls (e.g., input groups).
//
// Heads up! This is mixin-ed into `.navbar-form` in navbars.less.
.form-inline {
.form-control,
.radio,
.checkbox {
display: inline-block;
}
.radio,
.checkbox {
margin-top: 0;
margin-bottom: 0;
// Kick in the inline
@media (min-width: @screen-tablet) {
// Inline-block all the things for "inline"
.form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
}
// In navbar-form, allow folks to *not* use `.form-group`
.form-control {
display: inline-block;
}
// Remove default margin on radios/checkboxes that were used for stacking, and
// then undo the floating of radios and checkboxes to match (which also avoids
// a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969).
.radio,
.checkbox {
display: inline-block;
margin-top: 0;
margin-bottom: 0;
padding-left: 0;
}
.radio input[type="radio"],
.checkbox input[type="checkbox"] {
float: none;
margin-left: 0;
}
}
}
// Horizontal forms
// --------------------------------------------------
// Horizontal forms are built on grid classes.
//
// Horizontal forms are built on grid classes and allow you to create forms with
// labels on the left and inputs on the right.
.form-horizontal .control-label {
padding-top: 6px;
.form-horizontal .control-label,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
padding-top: @padding-base-vertical;
}
.form-horizontal {

View File

@ -2,6 +2,7 @@
// Grid system
// --------------------------------------------------
// Set the container width, and override it for fixed navbars in media queries
.container {
.container-fixed();
@ -13,18 +14,18 @@
}
// Common styles for small and large grid columns
.col-1,
.col-2,
.col-3,
.col-4,
.col-5,
.col-6,
.col-7,
.col-8,
.col-9,
.col-10,
.col-11,
.col-12,
.col-xs-1,
.col-xs-2,
.col-xs-3,
.col-xs-4,
.col-xs-5,
.col-xs-6,
.col-xs-7,
.col-xs-8,
.col-xs-9,
.col-xs-10,
.col-xs-11,
.col-xs-12,
.col-sm-1,
.col-sm-2,
.col-sm-3,
@ -37,6 +38,18 @@
.col-sm-10,
.col-sm-11,
.col-sm-12,
.col-md-1,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-5,
.col-md-6,
.col-md-7,
.col-md-8,
.col-md-9,
.col-md-10,
.col-md-11,
.col-md-12,
.col-lg-1,
.col-lg-2,
.col-lg-3,
@ -58,40 +71,49 @@
}
// Extra small grid
//
// Container and grid column sizing
// Grid classes for extra small devices like smartphones. No offset, push, or
// pull classes are present here due to the size of the target.
//
// Note that `.col-xs-12` doesn't get floated on purpose—there's no need since
// it's full-width.
// Tiny device columns (smartphones)
.col-1,
.col-2,
.col-3,
.col-4,
.col-5,
.col-6,
.col-7,
.col-8,
.col-9,
.col-10,
.col-11,
.col-12 {
.col-xs-1,
.col-xs-2,
.col-xs-3,
.col-xs-4,
.col-xs-5,
.col-xs-6,
.col-xs-7,
.col-xs-8,
.col-xs-9,
.col-xs-10,
.col-xs-11 {
float: left;
}
.col-1 { width: percentage((1 / @grid-columns)); }
.col-2 { width: percentage((2 / @grid-columns)); }
.col-3 { width: percentage((3 / @grid-columns)); }
.col-4 { width: percentage((4 / @grid-columns)); }
.col-5 { width: percentage((5 / @grid-columns)); }
.col-6 { width: percentage((6 / @grid-columns)); }
.col-7 { width: percentage((7 / @grid-columns)); }
.col-8 { width: percentage((8 / @grid-columns)); }
.col-9 { width: percentage((9 / @grid-columns)); }
.col-10 { width: percentage((10/ @grid-columns)); }
.col-11 { width: percentage((11/ @grid-columns)); }
.col-12 { width: 100%; }
.col-xs-1 { width: percentage((1 / @grid-columns)); }
.col-xs-2 { width: percentage((2 / @grid-columns)); }
.col-xs-3 { width: percentage((3 / @grid-columns)); }
.col-xs-4 { width: percentage((4 / @grid-columns)); }
.col-xs-5 { width: percentage((5 / @grid-columns)); }
.col-xs-6 { width: percentage((6 / @grid-columns)); }
.col-xs-7 { width: percentage((7 / @grid-columns)); }
.col-xs-8 { width: percentage((8 / @grid-columns)); }
.col-xs-9 { width: percentage((9 / @grid-columns)); }
.col-xs-10 { width: percentage((10/ @grid-columns)); }
.col-xs-11 { width: percentage((11/ @grid-columns)); }
.col-xs-12 { width: 100%; }
// Small grid
//
// Columns, offsets, pushes, and pulls for the small device range, from phones
// to tablets.
//
// Note that `.col-sm-12` doesn't get floated on purpose—there's no need since
// it's full-width.
// Small device columns (phones to tablets)
@media (min-width: @screen-tablet) {
.container {
max-width: @container-tablet;
@ -107,8 +129,7 @@
.col-sm-8,
.col-sm-9,
.col-sm-10,
.col-sm-11,
.col-sm-12 {
.col-sm-11 {
float: left;
}
.col-sm-1 { width: percentage((1 / @grid-columns)); }
@ -125,36 +146,134 @@
.col-sm-12 { width: 100%; }
// Push and pull columns for source order changes
.col-push-1 { left: percentage((1 / @grid-columns)); }
.col-push-2 { left: percentage((2 / @grid-columns)); }
.col-push-3 { left: percentage((3 / @grid-columns)); }
.col-push-4 { left: percentage((4 / @grid-columns)); }
.col-push-5 { left: percentage((5 / @grid-columns)); }
.col-push-6 { left: percentage((6 / @grid-columns)); }
.col-push-7 { left: percentage((7 / @grid-columns)); }
.col-push-8 { left: percentage((8 / @grid-columns)); }
.col-push-9 { left: percentage((9 / @grid-columns)); }
.col-push-10 { left: percentage((10/ @grid-columns)); }
.col-push-11 { left: percentage((11/ @grid-columns)); }
.col-sm-push-1 { left: percentage((1 / @grid-columns)); }
.col-sm-push-2 { left: percentage((2 / @grid-columns)); }
.col-sm-push-3 { left: percentage((3 / @grid-columns)); }
.col-sm-push-4 { left: percentage((4 / @grid-columns)); }
.col-sm-push-5 { left: percentage((5 / @grid-columns)); }
.col-sm-push-6 { left: percentage((6 / @grid-columns)); }
.col-sm-push-7 { left: percentage((7 / @grid-columns)); }
.col-sm-push-8 { left: percentage((8 / @grid-columns)); }
.col-sm-push-9 { left: percentage((9 / @grid-columns)); }
.col-sm-push-10 { left: percentage((10/ @grid-columns)); }
.col-sm-push-11 { left: percentage((11/ @grid-columns)); }
.col-pull-1 { right: percentage((1 / @grid-columns)); }
.col-pull-2 { right: percentage((2 / @grid-columns)); }
.col-pull-3 { right: percentage((3 / @grid-columns)); }
.col-pull-4 { right: percentage((4 / @grid-columns)); }
.col-pull-5 { right: percentage((5 / @grid-columns)); }
.col-pull-6 { right: percentage((6 / @grid-columns)); }
.col-pull-7 { right: percentage((7 / @grid-columns)); }
.col-pull-8 { right: percentage((8 / @grid-columns)); }
.col-pull-9 { right: percentage((9 / @grid-columns)); }
.col-pull-10 { right: percentage((10/ @grid-columns)); }
.col-pull-11 { right: percentage((11/ @grid-columns)); }
.col-sm-pull-1 { right: percentage((1 / @grid-columns)); }
.col-sm-pull-2 { right: percentage((2 / @grid-columns)); }
.col-sm-pull-3 { right: percentage((3 / @grid-columns)); }
.col-sm-pull-4 { right: percentage((4 / @grid-columns)); }
.col-sm-pull-5 { right: percentage((5 / @grid-columns)); }
.col-sm-pull-6 { right: percentage((6 / @grid-columns)); }
.col-sm-pull-7 { right: percentage((7 / @grid-columns)); }
.col-sm-pull-8 { right: percentage((8 / @grid-columns)); }
.col-sm-pull-9 { right: percentage((9 / @grid-columns)); }
.col-sm-pull-10 { right: percentage((10/ @grid-columns)); }
.col-sm-pull-11 { right: percentage((11/ @grid-columns)); }
// Offsets
.col-sm-offset-1 { margin-left: percentage((1 / @grid-columns)); }
.col-sm-offset-2 { margin-left: percentage((2 / @grid-columns)); }
.col-sm-offset-3 { margin-left: percentage((3 / @grid-columns)); }
.col-sm-offset-4 { margin-left: percentage((4 / @grid-columns)); }
.col-sm-offset-5 { margin-left: percentage((5 / @grid-columns)); }
.col-sm-offset-6 { margin-left: percentage((6 / @grid-columns)); }
.col-sm-offset-7 { margin-left: percentage((7 / @grid-columns)); }
.col-sm-offset-8 { margin-left: percentage((8 / @grid-columns)); }
.col-sm-offset-9 { margin-left: percentage((9 / @grid-columns)); }
.col-sm-offset-10 { margin-left: percentage((10/ @grid-columns)); }
.col-sm-offset-11 { margin-left: percentage((11/ @grid-columns)); }
}
// Medium and large device columns (desktop and up)
// Medium grid
//
// Columns, offsets, pushes, and pulls for the desktop device range.
//
// Note that `.col-md-12` doesn't get floated on purpose—there's no need since
// it's full-width.
@media (min-width: @screen-desktop) {
.container {
max-width: @container-desktop;
}
.col-md-1,
.col-md-2,
.col-md-3,
.col-md-4,
.col-md-5,
.col-md-6,
.col-md-7,
.col-md-8,
.col-md-9,
.col-md-10,
.col-md-11 {
float: left;
}
.col-md-1 { width: percentage((1 / @grid-columns)); }
.col-md-2 { width: percentage((2 / @grid-columns)); }
.col-md-3 { width: percentage((3 / @grid-columns)); }
.col-md-4 { width: percentage((4 / @grid-columns)); }
.col-md-5 { width: percentage((5 / @grid-columns)); }
.col-md-6 { width: percentage((6 / @grid-columns)); }
.col-md-7 { width: percentage((7 / @grid-columns)); }
.col-md-8 { width: percentage((8 / @grid-columns)); }
.col-md-9 { width: percentage((9 / @grid-columns)); }
.col-md-10 { width: percentage((10/ @grid-columns)); }
.col-md-11 { width: percentage((11/ @grid-columns)); }
.col-md-12 { width: 100%; }
// Push and pull columns for source order changes
.col-md-push-1 { left: percentage((1 / @grid-columns)); }
.col-md-push-2 { left: percentage((2 / @grid-columns)); }
.col-md-push-3 { left: percentage((3 / @grid-columns)); }
.col-md-push-4 { left: percentage((4 / @grid-columns)); }
.col-md-push-5 { left: percentage((5 / @grid-columns)); }
.col-md-push-6 { left: percentage((6 / @grid-columns)); }
.col-md-push-7 { left: percentage((7 / @grid-columns)); }
.col-md-push-8 { left: percentage((8 / @grid-columns)); }
.col-md-push-9 { left: percentage((9 / @grid-columns)); }
.col-md-push-10 { left: percentage((10/ @grid-columns)); }
.col-md-push-11 { left: percentage((11/ @grid-columns)); }
.col-md-pull-1 { right: percentage((1 / @grid-columns)); }
.col-md-pull-2 { right: percentage((2 / @grid-columns)); }
.col-md-pull-3 { right: percentage((3 / @grid-columns)); }
.col-md-pull-4 { right: percentage((4 / @grid-columns)); }
.col-md-pull-5 { right: percentage((5 / @grid-columns)); }
.col-md-pull-6 { right: percentage((6 / @grid-columns)); }
.col-md-pull-7 { right: percentage((7 / @grid-columns)); }
.col-md-pull-8 { right: percentage((8 / @grid-columns)); }
.col-md-pull-9 { right: percentage((9 / @grid-columns)); }
.col-md-pull-10 { right: percentage((10/ @grid-columns)); }
.col-md-pull-11 { right: percentage((11/ @grid-columns)); }
// Offsets
.col-md-offset-1 { margin-left: percentage((1 / @grid-columns)); }
.col-md-offset-2 { margin-left: percentage((2 / @grid-columns)); }
.col-md-offset-3 { margin-left: percentage((3 / @grid-columns)); }
.col-md-offset-4 { margin-left: percentage((4 / @grid-columns)); }
.col-md-offset-5 { margin-left: percentage((5 / @grid-columns)); }
.col-md-offset-6 { margin-left: percentage((6 / @grid-columns)); }
.col-md-offset-7 { margin-left: percentage((7 / @grid-columns)); }
.col-md-offset-8 { margin-left: percentage((8 / @grid-columns)); }
.col-md-offset-9 { margin-left: percentage((9 / @grid-columns)); }
.col-md-offset-10 { margin-left: percentage((10/ @grid-columns)); }
.col-md-offset-11 { margin-left: percentage((11/ @grid-columns)); }
}
// Large grid
//
// Columns, offsets, pushes, and pulls for the large desktop device range.
//
// Note that `.col-lg-12` doesn't get floated on purpose—there's no need since
// it's full-width.
@media (min-width: @screen-large-desktop) {
.container {
max-width: @container-large-desktop;
}
.col-lg-1,
.col-lg-2,
.col-lg-3,
@ -165,8 +284,7 @@
.col-lg-8,
.col-lg-9,
.col-lg-10,
.col-lg-11,
.col-lg-12 {
.col-lg-11 {
float: left;
}
.col-lg-1 { width: percentage((1 / @grid-columns)); }
@ -182,23 +300,41 @@
.col-lg-11 { width: percentage((11/ @grid-columns)); }
.col-lg-12 { width: 100%; }
// Offsets
.col-offset-1 { margin-left: percentage((1 / @grid-columns)); }
.col-offset-2 { margin-left: percentage((2 / @grid-columns)); }
.col-offset-3 { margin-left: percentage((3 / @grid-columns)); }
.col-offset-4 { margin-left: percentage((4 / @grid-columns)); }
.col-offset-5 { margin-left: percentage((5 / @grid-columns)); }
.col-offset-6 { margin-left: percentage((6 / @grid-columns)); }
.col-offset-7 { margin-left: percentage((7 / @grid-columns)); }
.col-offset-8 { margin-left: percentage((8 / @grid-columns)); }
.col-offset-9 { margin-left: percentage((9 / @grid-columns)); }
.col-offset-10 { margin-left: percentage((10/ @grid-columns)); }
.col-offset-11 { margin-left: percentage((11/ @grid-columns)); }
}
// Push and pull columns for source order changes
.col-lg-push-1 { left: percentage((1 / @grid-columns)); }
.col-lg-push-2 { left: percentage((2 / @grid-columns)); }
.col-lg-push-3 { left: percentage((3 / @grid-columns)); }
.col-lg-push-4 { left: percentage((4 / @grid-columns)); }
.col-lg-push-5 { left: percentage((5 / @grid-columns)); }
.col-lg-push-6 { left: percentage((6 / @grid-columns)); }
.col-lg-push-7 { left: percentage((7 / @grid-columns)); }
.col-lg-push-8 { left: percentage((8 / @grid-columns)); }
.col-lg-push-9 { left: percentage((9 / @grid-columns)); }
.col-lg-push-10 { left: percentage((10/ @grid-columns)); }
.col-lg-push-11 { left: percentage((11/ @grid-columns)); }
// Large desktops and up
@media (min-width: @screen-large-desktop) {
.container {
max-width: @container-large-desktop;
}
.col-lg-pull-1 { right: percentage((1 / @grid-columns)); }
.col-lg-pull-2 { right: percentage((2 / @grid-columns)); }
.col-lg-pull-3 { right: percentage((3 / @grid-columns)); }
.col-lg-pull-4 { right: percentage((4 / @grid-columns)); }
.col-lg-pull-5 { right: percentage((5 / @grid-columns)); }
.col-lg-pull-6 { right: percentage((6 / @grid-columns)); }
.col-lg-pull-7 { right: percentage((7 / @grid-columns)); }
.col-lg-pull-8 { right: percentage((8 / @grid-columns)); }
.col-lg-pull-9 { right: percentage((9 / @grid-columns)); }
.col-lg-pull-10 { right: percentage((10/ @grid-columns)); }
.col-lg-pull-11 { right: percentage((11/ @grid-columns)); }
// Offsets
.col-lg-offset-1 { margin-left: percentage((1 / @grid-columns)); }
.col-lg-offset-2 { margin-left: percentage((2 / @grid-columns)); }
.col-lg-offset-3 { margin-left: percentage((3 / @grid-columns)); }
.col-lg-offset-4 { margin-left: percentage((4 / @grid-columns)); }
.col-lg-offset-5 { margin-left: percentage((5 / @grid-columns)); }
.col-lg-offset-6 { margin-left: percentage((6 / @grid-columns)); }
.col-lg-offset-7 { margin-left: percentage((7 / @grid-columns)); }
.col-lg-offset-8 { margin-left: percentage((8 / @grid-columns)); }
.col-lg-offset-9 { margin-left: percentage((9 / @grid-columns)); }
.col-lg-offset-10 { margin-left: percentage((10/ @grid-columns)); }
.col-lg-offset-11 { margin-left: percentage((11/ @grid-columns)); }
}

View File

@ -0,0 +1,127 @@
//
// Input groups
// --------------------------------------------------
// Base styles
// -------------------------
.input-group {
position: relative; // For dropdowns
display: table;
border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
// Undo padding and float of grid classes
&.col {
float: none;
padding-left: 0;
padding-right: 0;
}
.form-control {
width: 100%;
margin-bottom: 0;
}
}
// Sizing options
//
// Remix the default form control sizing classes into new ones for easier
// manipulation.
.input-group-lg > .form-control,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .btn { .input-lg(); }
.input-group-sm > .form-control,
.input-group-sm > .input-group-addon,
.input-group-lg > .input-group-btn > .btn { .input-sm(); }
// Display as table-cell
// -------------------------
.input-group-addon,
.input-group-btn,
.input-group .form-control {
display: table-cell;
&:not(:first-child):not(:last-child) {
border-radius: 0;
}
}
// Addon and addon wrapper for buttons
.input-group-addon,
.input-group-btn {
width: 1%;
white-space: nowrap;
vertical-align: middle; // Match the inputs
}
// Text input groups
// -------------------------
.input-group-addon {
padding: @padding-base-vertical @padding-base-horizontal;
font-size: @font-size-base;
font-weight: normal;
line-height: 1;
text-align: center;
background-color: @input-group-addon-bg;
border: 1px solid @input-group-addon-border-color;
border-radius: @border-radius-base;
// Sizing
&.input-sm {
padding: @padding-small-vertical @padding-small-horizontal;
font-size: @font-size-small;
border-radius: @border-radius-small;
}
&.input-lg {
padding: @padding-large-vertical @padding-large-horizontal;
font-size: @font-size-large;
border-radius: @border-radius-large;
}
// Nuke default margins from checkboxes and radios to vertically center within.
input[type="radio"],
input[type="checkbox"] {
margin-top: 0;
}
}
// Reset rounded corners
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
.border-right-radius(0);
}
.input-group-addon:first-child {
border-right: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child) {
.border-left-radius(0);
}
.input-group-addon:last-child {
border-left: 0;
}
// Button input groups
// -------------------------
.input-group-btn {
position: relative;
white-space: nowrap;
}
.input-group-btn > .btn {
position: relative;
// Jankily prevent input button groups from wrapping
+ .btn {
margin-left: -4px;
}
// Bring the "active" button to the front
&:hover,
&:active {
z-index: 2;
}
}

View File

@ -6,13 +6,12 @@
display: inline;
padding: .25em .6em;
font-size: 75%;
font-weight: 500;
font-weight: bold;
line-height: 1;
color: @label-color;
text-align: center;
white-space: nowrap;
vertical-align: middle;
background-color: @gray-light;
vertical-align: baseline;
border-radius: .25em;
// Add hover effects, but only for links
@ -22,13 +21,22 @@
color: @label-link-hover-color;
text-decoration: none;
cursor: pointer;
background-color: darken(@gray-light, 10%);
}
}
// Empty labels collapse automatically (not available in IE8)
&:empty {
display: none;
}
}
// Colors
// Contextual variations (linked labels get darker on :hover)
.label-default {
.label-variant(@label-default-bg);
}
.label-danger {
.label-variant(@label-danger-bg);
}

View File

@ -9,7 +9,6 @@
// No need to set list-style: none; since .list-group-item is block level
margin-bottom: 20px;
padding-left: 0; // reset padding because ul and ol
background-color: @list-group-bg;
}
// Individual list items
@ -18,61 +17,49 @@
.list-group-item {
position: relative;
display: block;
padding: 10px 30px 10px 15px;
padding: 10px 15px;
// Place the border on the list items and negative margin up for better styling
margin-bottom: -1px;
background-color: @list-group-bg;
border: 1px solid @list-group-border;
// Round the first and last items
&:first-child {
.border-top-radius(@border-radius-base);
.border-top-radius(@list-group-border-radius);
}
&:last-child {
margin-bottom: 0;
.border-bottom-radius(@border-radius-base);
.border-bottom-radius(@list-group-border-radius);
}
// Align badges within list items
> .badge {
float: right;
margin-right: -15px;
}
}
// Custom content options
// -------------------------
.list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}
// Linked list items
// -------------------------
// Custom content within linked items
a.list-group-item {
// Colorize content accordingly
.list-group-item-heading {
color: @list-group-link-heading-color;
> .badge + .badge {
margin-right: 5px;
}
.list-group-item-text {
// Linked list items
a& {
color: @list-group-link-color;
}
// Hover state
&:hover,
&:focus {
text-decoration: none;
background-color: @list-group-hover-bg;
.list-group-item-heading {
color: @list-group-link-heading-color;
}
// Hover state
&:hover,
&:focus {
text-decoration: none;
background-color: @list-group-hover-bg;
}
}
// Active class on item itself, not parent
&.active {
&.active,
&.active:hover,
&.active:focus {
z-index: 2; // Place active items above their siblings for proper border styling
color: @list-group-active-color;
background-color: @list-group-active-bg;
@ -87,3 +74,15 @@ a.list-group-item {
}
}
}
// Custom content options
// -------------------------
.list-group-item-heading {
margin-top: 0;
margin-bottom: 5px;
}
.list-group-item-text {
margin-bottom: 0;
line-height: 1.3;
}

View File

@ -44,12 +44,12 @@
}
// Sizing shortcuts
.size(@width, @height) {
.size(@width; @height) {
width: @width;
height: @height;
}
.square(@size) {
.size(@size, @size);
.size(@size; @size);
}
// Placeholder text
@ -130,25 +130,25 @@
// Transformations
.rotate(@degrees) {
-webkit-transform: rotate(@degrees);
-ms-transform: rotate(@degrees);
-ms-transform: rotate(@degrees); // IE9+
transform: rotate(@degrees);
}
.scale(@ratio) {
-webkit-transform: scale(@ratio);
-ms-transform: scale(@ratio);
-ms-transform: scale(@ratio); // IE9+
transform: scale(@ratio);
}
.translate(@x, @y) {
.translate(@x; @y) {
-webkit-transform: translate(@x, @y);
-ms-transform: translate(@x, @y);
-ms-transform: translate(@x, @y); // IE9+
transform: translate(@x, @y);
}
.skew(@x, @y) {
.skew(@x; @y) {
-webkit-transform: skew(@x, @y);
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
transform: skew(@x, @y);
}
.translate3d(@x, @y, @z) {
.translate3d(@x; @y; @z) {
-webkit-transform: translate3d(@x, @y, @z);
transform: translate3d(@x, @y, @z);
}
@ -158,19 +158,9 @@
// Default value is `visible`, but can be changed to `hidden`
// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
.backface-visibility(@visibility){
-webkit-backface-visibility: @visibility;
-moz-backface-visibility: @visibility;
backface-visibility: @visibility;
}
// Background clipping
.background-clip(@clip) {
background-clip: @clip;
}
// Background sizing
.background-size(@size) {
background-size: @size;
-webkit-backface-visibility: @visibility;
-moz-backface-visibility: @visibility;
backface-visibility: @visibility;
}
// Box sizing
@ -185,7 +175,7 @@
.user-select(@select) {
-webkit-user-select: @select;
-moz-user-select: @select;
-ms-user-select: @select;
-ms-user-select: @select; // IE10+
-o-user-select: @select;
user-select: @select;
}
@ -197,7 +187,7 @@
}
// CSS3 Content Columns
.content-columns(@column-count, @column-gap: @grid-gutter-width) {
.content-columns(@column-count; @column-gap: @grid-gutter-width) {
-webkit-column-count: @column-count;
-moz-column-count: @column-count;
column-count: @column-count;
@ -211,7 +201,7 @@
word-wrap: break-word;
-webkit-hyphens: @mode;
-moz-hyphens: @mode;
-ms-hyphens: @mode;
-ms-hyphens: @mode; // IE10+
-o-hyphens: @mode;
hyphens: @mode;
}
@ -235,8 +225,7 @@
//
// Creates two color stops, start and end, by specifying a color and position for each color stop.
// Color stops are not available in IE9 and below.
.horizontal(@start-color: #555; @start-percent: 0%; @end-color: #333; @end-percent: 100%) {
background-color: @end-color;
.horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
background-image: -webkit-gradient(linear, @start-percent top, @end-percent top, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1+, Chrome 10+
background-image: -moz-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
@ -249,8 +238,7 @@
//
// Creates two color stops, start and end, by specifying a color and position for each color stop.
// Color stops are not available in IE9 and below.
.vertical(@start-color: #555; @start-percent: 0%; @end-color: #333; @end-percent: 100%) {
background-color: @end-color;
.vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
background-image: -webkit-gradient(linear, left @start-percent, left @end-percent, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(top, @start-color, @start-percent, @end-color, @end-percent); // Safari 5.1+, Chrome 10+
background-image: -moz-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
@ -259,15 +247,13 @@
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down
}
.directional(@start-color: #555, @end-color: #333, @deg: 45deg) {
background-color: @end-color;
.directional(@start-color: #555; @end-color: #333; @deg: 45deg) {
background-repeat: repeat-x;
background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1+, Chrome 10+
background-image: -moz-linear-gradient(@deg, @start-color, @end-color); // FF 3.6+
background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10
}
.horizontal-three-colors(@start-color: #00b3ee, @mid-color: #7a43b6, @color-stop: 50%, @end-color: #c3325f) {
background-color: mix(@mid-color, @end-color, 80%);
.horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
background-image: -moz-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
@ -275,9 +261,7 @@
background-repeat: no-repeat;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
}
.vertical-three-colors(@start-color: #00b3ee, @mid-color: #7a43b6, @color-stop: 50%, @end-color: #c3325f) {
background-color: mix(@mid-color, @end-color, 80%);
.vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);
background-image: -moz-linear-gradient(top, @start-color, @mid-color @color-stop, @end-color);
@ -285,16 +269,14 @@
background-repeat: no-repeat;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
}
.radial(@inner-color: #555, @outer-color: #333) {
background-color: @outer-color;
.radial(@inner-color: #555; @outer-color: #333) {
background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@inner-color), to(@outer-color));
background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);
background-image: -moz-radial-gradient(circle, @inner-color, @outer-color);
background-image: radial-gradient(circle, @inner-color, @outer-color);
background-repeat: no-repeat;
}
.striped(@color: #555, @angle: 45deg) {
background-color: @color;
.striped(@color: #555; @angle: 45deg) {
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
@ -316,7 +298,7 @@
// --------------------------------------------------
// Short retina mixin for setting background-image and -size
.img-retina(@file-1x, @file-2x, @width-1x, @height-1x) {
.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
background-image: url("@{file-1x}");
@media
@ -345,9 +327,28 @@
background-color: @color;
}
// Panels
// -------------------------
.panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) {
border-color: @border;
& > .panel-heading {
color: @heading-text-color;
background-color: @heading-bg-color;
border-color: @heading-border;
+ .panel-collapse .panel-body {
border-top-color: @border;
}
}
& > .panel-footer {
+ .panel-collapse .panel-body {
border-bottom-color: @border;
}
}
}
// Alerts
// -------------------------
.alert-variant(@background, @border, @text-color) {
.alert-variant(@background; @border; @text-color) {
background-color: @background;
border-color: @border;
color: @text-color;
@ -359,11 +360,40 @@
}
}
// Button pseudo states
// Tables
// -------------------------
.table-row-variant(@state; @background; @border) {
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.
.table > thead > tr,
.table > tbody > tr,
.table > tfoot > tr {
> td.@{state},
> th.@{state},
&.@{state} > td,
&.@{state} > th {
background-color: @background;
border-color: @border;
}
}
// Hover states for `.table-hover`
// Note: this is not available for cells or rows within `thead` or `tfoot`.
.table-hover > tbody > tr {
> td.@{state}:hover,
> th.@{state}:hover,
&.@{state}:hover > td {
background-color: darken(@background, 5%);
border-color: darken(@border, 5%);
}
}
}
// Button variants
// -------------------------
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
.btn-pseudo-states(@color, @background, @border) {
.button-variant(@color; @background; @border) {
color: @color;
background-color: @background;
border-color: @border;
@ -372,8 +402,9 @@
&:focus,
&:active,
&.active {
background-color: darken(@background, 5%);
border-color: darken(@border, 10%);
color: @color;
background-color: darken(@background, 8%);
border-color: darken(@border, 12%);
}
&.disabled,
@ -390,6 +421,39 @@
}
}
// Button sizes
// -------------------------
.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
padding: @padding-vertical @padding-horizontal;
font-size: @font-size;
line-height: @line-height;
border-radius: @border-radius;
}
// Pagination
// -------------------------
.pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) {
> li {
> a,
> span {
padding: @padding-vertical @padding-horizontal;
font-size: @font-size;
}
&:first-child {
> a,
> span {
.border-left-radius(@border-radius);
}
}
&:last-child {
> a,
> span {
.border-right-radius(@border-radius);
}
}
}
}
// Labels
// -------------------------
.label-variant(@color) {
@ -405,7 +469,7 @@
// Navbar vertical align
// -------------------------
// Vertically center elements in the navbar.
// Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
.navbar-vertical-align(@element-height) {
margin-top: ((@navbar-height - @element-height) / 2);
margin-bottom: ((@navbar-height - @element-height) / 2);
@ -448,65 +512,34 @@
}
// Creates a wrapper for a series of columns
.make-row() {
.make-row(@gutter: @grid-gutter-width) {
// Then clear the floated columns
.clearfix();
@media (min-width: @screen-small) {
margin-left: (@grid-gutter-width / -2);
margin-right: (@grid-gutter-width / -2);
.container & {
@media (min-width: @screen-small) {
margin-left: (@gutter / -2);
margin-right: (@gutter / -2);
}
}
// Negative margin nested rows out to align the content of columns
.row {
margin-left: (@grid-gutter-width / -2);
margin-right: (@grid-gutter-width / -2);
margin-left: (@gutter / -2);
margin-right: (@gutter / -2);
}
}
// Generate the columns
.make-column(@columns) {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@grid-gutter-width / 2);
padding-right: (@grid-gutter-width / 2);
// Calculate width based on number of columns available
@media (min-width: @grid-float-breakpoint) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
// Generate the column offsets
.make-column-offset(@columns) {
@media (min-width: @grid-float-breakpoint) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-column-push(@columns) {
@media (min-width: @grid-float-breakpoint) {
left: percentage((@columns / @grid-columns));
}
}
.make-column-pull(@columns) {
@media (min-width: @grid-float-breakpoint) {
right: percentage((@columns / @grid-columns));
}
}
// Generate the small columns
.make-small-column(@columns) {
// Generate the extra small columns
.make-xs-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
float: left;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@grid-gutter-width / 2);
padding-right: (@grid-gutter-width / 2);
@max-width: (@grid-float-breakpoint - 1);
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
@max-width: (@screen-small - 1);
// Calculate width based on number of columns available
@media (max-width: @max-width) {
@ -514,13 +547,112 @@
}
}
// Generate the small columns
.make-sm-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
// Calculate width based on number of columns available
@media (min-width: @screen-small) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
// Generate the small column offsets
.make-sm-column-offset(@columns) {
@media (min-width: @screen-small) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-sm-column-push(@columns) {
@media (min-width: @screen-small) {
left: percentage((@columns / @grid-columns));
}
}
.make-sm-column-pull(@columns) {
@media (min-width: @screen-small) {
right: percentage((@columns / @grid-columns));
}
}
// Generate the medium columns
.make-md-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
// Calculate width based on number of columns available
@media (min-width: @screen-medium) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
// Generate the large column offsets
.make-md-column-offset(@columns) {
@media (min-width: @screen-medium) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-md-column-push(@columns) {
@media (min-width: @screen-medium) {
left: percentage((@columns / @grid-columns));
}
}
.make-md-column-pull(@columns) {
@media (min-width: @screen-medium) {
right: percentage((@columns / @grid-columns));
}
}
// Generate the large columns
.make-lg-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
// Calculate width based on number of columns available
@media (min-width: @screen-large) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
// Generate the large column offsets
.make-lg-column-offset(@columns) {
@media (min-width: @screen-large) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-lg-column-push(@columns) {
@media (min-width: @screen-large) {
left: percentage((@columns / @grid-columns));
}
}
.make-lg-column-pull(@columns) {
@media (min-width: @screen-large) {
right: percentage((@columns / @grid-columns));
}
}
// Form validation states
//
// Used in forms.less to generate the form validation CSS for warnings, errors,
// and successes.
.form-control-validation(@text-color: #555, @border-color: #ccc, @background-color: #f5f5f5) {
.form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {
// Color the label and help text
.help-block,
.control-label {
@ -528,7 +660,6 @@
}
// Set the border and box shadow on specific inputs to match
.form-control {
padding-right: 32px; // to account for the feedback icon
border-color: @border-color;
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
&:focus {
@ -544,3 +675,48 @@
background-color: @background-color;
}
}
// Form control focus state
//
// Generate a customized focus state and for any input with the specified color,
// which defaults to the `@input-focus-border` variable.
//
// We highly encourage you to not customize the default value, but instead use
// this to tweak colors on an as-needed basis. This aesthetic change is based on
// WebKit's default styles, but applicable to a wider range of browsers. Its
// usability and accessibility should be taken into account with any change.
//
// Example usage: change the default blue border and shadow to white for better
// contrast against a dark gray background.
.form-control-focus(@color: @input-border-focus) {
@color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
&:focus {
border-color: @color;
outline: 0;
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
}
}
// Form control sizing
//
// Relative text size, padding, and border-radii changes for form controls. For
// horizontal sizing, wrap controls in the predefined grid classes. `<select>`
// element gets special love because it's special, and that's a fact!
.input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
height: @input-height;
padding: @padding-vertical @padding-horizontal;
font-size: @font-size;
line-height: @line-height;
border-radius: @border-radius;
select& {
height: @input-height;
line-height: @input-height;
}
textarea& {
height: auto;
}
}

View File

@ -29,15 +29,13 @@
.translate(0, -25%);
.transition-transform(~"0.3s ease-out");
}
&.fade.in .modal-dialog { .translate(0, 0)}
&.in .modal-dialog { .translate(0, 0)}
}
// Shell div to position the modal with bottom padding
.modal-dialog {
position: relative;
top: 0;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
width: auto;
padding: 10px;
z-index: (@zindex-modal-background + 10);
@ -51,7 +49,7 @@
border: 1px solid @modal-content-border-color;
border-radius: @border-radius-large;
.box-shadow(0 3px 9px rgba(0,0,0,.5));
.background-clip(padding-box);
background-clip: padding-box;
// Remove focus outline from opened modal
outline: none;
}
@ -67,7 +65,7 @@
background-color: @modal-backdrop-bg;
// Fade for backdrop
&.fade { .opacity(0); }
&.fade.in { .opacity(.5); }
&.in { .opacity(.5); }
}
// Modal header
@ -124,8 +122,7 @@
.modal-dialog {
left: 50%;
right: auto;
width: 560px;
margin-left: -280px;
width: 600px;
padding-top: 30px;
padding-bottom: 30px;
}

View File

@ -2,34 +2,185 @@
// Navbars
// --------------------------------------------------
// Wrapper and base class
//
// Provide a static navbar from which we expand to create full-width, fixed, and
// other navbar variations.
.navbar {
position: relative;
min-height: @navbar-height; // Ensure a navbar always shows (e.g., without a .navbar-brand in collapsed mode)
margin-bottom: 20px;
padding-left: @navbar-padding-horizontal;
padding-right: @navbar-padding-horizontal;
margin-bottom: @navbar-margin-bottom;
background-color: @navbar-bg;
border-radius: @border-radius-base;
border: 1px solid @navbar-border;
// Prevent floats from breaking the navbar
.clearfix();
@media (min-width: @grid-float-breakpoint) {
border-radius: @navbar-border-radius;
}
}
// Navbar heading
//
// Groups `.navbar-brand` and `.navbar-toggle` into a single component for easy
// styling of responsive aspects.
.navbar-header {
padding-left: @navbar-padding-horizontal;
padding-right: @navbar-padding-horizontal;
.clearfix();
@media (min-width: @grid-float-breakpoint) {
float: left;
}
}
// Navbar collapse (body)
//
// Group your navbar content into this for easy collapsing and expanding across
// various device sizes. By default, this content is collapsed when <768px, but
// will expand past that for a horizontal display.
//
// To start (on mobile devices) the navbar links, forms, and buttons are stacked
// vertically and include a `max-height` to overflow in case you have too much
// content for the user's viewport.
.navbar-collapse {
padding: 5px @navbar-padding-horizontal;
border-top: 1px solid darken(@navbar-bg, 7%);
box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
// Clear floated elements and prevent collapsing of padding
.clearfix();
// This is not automatically added to the `.navbar-fixed-top` because it causes
// z-index bugs in iOS7 (possibly earlier).
max-height: 340px;
overflow-x: visible;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
@media (min-width: @grid-float-breakpoint) {
width: auto;
padding: 0;
border-top: 0;
box-shadow: none;
}
}
//
// Navbar alignment options
//
// Display the navbar across the entirity of the page or fixed it to the top or
// bottom of the page.
// Static top (unfixed, but 100% wide) navbar
.navbar-static-top {
@media (min-width: @grid-float-breakpoint) {
border-width: 0 0 1px;
border-radius: 0;
}
}
// Fix the top/bottom navbars when screen real estate supports it
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: @zindex-navbar-fixed;
border-width: 0 0 1px;
// Undo the rounded corners
@media (min-width: @grid-float-breakpoint) {
border-radius: 0;
}
}
.navbar-fixed-top {
top: 0;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0; // override .navbar defaults
}
// Brand/project name
.navbar-brand {
float: left;
margin-right: (@navbar-padding-horizontal / 2);
padding-top: @navbar-padding-vertical;
padding-bottom: @navbar-padding-vertical;
font-size: @font-size-large;
line-height: @line-height-computed;
color: @navbar-brand-color;
&:hover,
&:focus {
color: @navbar-brand-hover-color;
text-decoration: none;
background-color: @navbar-brand-hover-bg;
}
}
// Navbar toggle
//
// Custom button for toggling the `.navbar-collapse`, powered by the collapse
// JavaScript plugin.
.navbar-toggle {
position: relative;
float: right;
padding: 9px 10px;
.navbar-vertical-align(34px);
background-color: transparent;
border: 1px solid @navbar-toggle-border-color;
border-radius: @border-radius-base;
&:hover,
&:focus {
background-color: @navbar-toggle-hover-bg;
}
// Bars
.icon-bar {
display: block;
width: 22px;
height: 2px;
background-color: @navbar-toggle-icon-bar-bg;
border-radius: 1px;
}
.icon-bar + .icon-bar {
margin-top: 4px;
}
}
// Navbar nav links
// -------------------------
//
// Builds on top of the `.nav` components with it's own modifier class to make
// the nav the full height of the horizontal nav (above 768px).
.navbar-nav {
// Space out from .navbar .brand and .btn-navbar when stacked in mobile views
margin-top: 10px;
margin-bottom: 15px;
margin-left: -@navbar-padding-horizontal;
margin-right: -@navbar-padding-horizontal;
@media (min-width: @grid-float-breakpoint) {
margin-left: 0;
margin-right: 0;
}
> li > a {
padding-top: ((@navbar-height - @line-height-computed) / 2);
padding-bottom: ((@navbar-height - @line-height-computed) / 2);
padding-top: 10px;
padding-bottom: 10px;
color: @navbar-link-color;
line-height: 20px;
border-radius: @border-radius-base;
line-height: @line-height-computed;
&:hover,
&:focus {
color: @navbar-link-hover-color;
@ -53,115 +204,115 @@
}
}
// Right aligned contents
// Make them full width first so that they align properly on mobile
&.pull-right {
width: 100%;
@media (max-width: @screen-phone-max) {
// Dropdowns get custom display
.open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none;
> li > a,
.dropdown-header {
padding: 5px 15px 5px 25px;
}
> li > a {
color: @navbar-link-color;
line-height: @line-height-computed;
&:hover,
&:focus {
color: @navbar-link-hover-color;
background-color: @navbar-link-hover-bg;
background-image: none;
}
}
> .active > a {
&,
&:hover,
&:focus {
color: @navbar-link-active-color;
background-color: @navbar-link-active-bg;
}
}
> .disabled > a {
&,
&:hover,
&:focus {
color: @navbar-link-disabled-color;
background-color: @navbar-link-disabled-bg;
}
}
}
}
}
// Component alignment
//
// Navbar alignment options
// --------------------------------------------------
// Repurpose the pull utilities as their own navbar utilities to avoid specifity
// issues with parents and chaining. Only do this when the navbar is uncollapsed
// though so that navbar contents properly stack and align in mobile.
// Static navbar
.navbar-static-top {
border-radius: 0;
}
// Fix the top/bottom navbars when screen real estate supports it
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: @zindex-navbar-fixed;
border-radius: 0;
}
.navbar-fixed-top {
top: 0;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0; // override .navbar defaults
}
//
// Navbar optional components
// --------------------------------------------------
// Brand/project name
.navbar-brand {
display: block;
max-width: 200px;
margin-left: auto;
margin-right: auto;
padding: @navbar-padding-vertical @navbar-padding-horizontal;
font-size: @font-size-large;
font-weight: 500;
line-height: @line-height-computed;
color: @navbar-brand-color;
text-align: center;
&:hover,
&:focus {
color: @navbar-brand-hover-color;
text-decoration: none;
background-color: @navbar-brand-hover-bg;
@media (min-width: @grid-float-breakpoint) {
.navbar-left { .pull-left(); }
.navbar-right {
.pull-right();
.dropdown-menu {
.pull-right > .dropdown-menu();
}
}
}
// Collapsible navbar toggle
.navbar-toggle {
position: absolute;
top: floor((@navbar-height - 32) / 2);
right: 10px;
width: 48px;
height: 32px;
padding: 8px 12px;
background-color: transparent;
border: 1px solid @navbar-toggle-border-color;
border-radius: @border-radius-base;
&:hover,
&:focus {
background-color: @navbar-toggle-hover-bg;
}
// Bars
.icon-bar {
display: block;
width: 22px;
height: 2px;
background-color: @navbar-toggle-icon-bar-bg;
border-radius: 1px;
}
.icon-bar + .icon-bar {
margin-top: 4px;
}
}
// Navbar form
//
// Extension of the `.form-inline` with some extra flavor for optimum display in
// our navbars.
.navbar-form {
margin-left: -@navbar-padding-horizontal;
margin-right: -@navbar-padding-horizontal;
padding: 10px @navbar-padding-horizontal;
border-top: 1px solid darken(@navbar-bg, 7%);
border-bottom: 1px solid darken(@navbar-bg, 7%);
// Mixin behavior for optimum display
.form-inline();
.navbar-vertical-align(@input-height-base); // Vertically center in navbar
.form-group {
@media (max-width: @screen-phone-max) {
margin-bottom: 5px;
}
}
// Vertically center in expanded, horizontal navbar
.navbar-vertical-align(@input-height-base);
// Undo 100% width for pull classes
@media (min-width: @grid-float-breakpoint) {
width: auto;
border: 0;
margin-left: 0;
margin-right: 0;
padding-top: 0;
padding-bottom: 0;
}
}
// Dropdown menus
// Menu position and menu carets
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
.border-top-radius(0);
}
// Menu position and menu caret support for dropups via extra dropup class
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
.border-bottom-radius(0);
}
// Dropdown menu items and carets
@ -206,6 +357,7 @@
.navbar-inverse {
background-color: @navbar-inverse-bg;
border-color: @navbar-inverse-border;
.navbar-brand {
color: @navbar-inverse-brand-color;
@ -260,6 +412,10 @@
}
}
.navbar-collapse {
border-top-color: darken(@navbar-inverse-bg, 7%);
}
// Dropdowns
.navbar-nav {
> .open > a {
@ -288,7 +444,41 @@
}
}
}
@media (max-width: @screen-phone-max) {
// Dropdowns get custom display
.open .dropdown-menu {
> .dropdown-header {
border-color: @navbar-inverse-border;
}
> li > a {
color: @navbar-inverse-link-color;
&:hover,
&:focus {
color: @navbar-inverse-link-hover-color;
background-color: @navbar-inverse-link-hover-bg;
}
}
> .active > a {
&,
&:hover,
&:focus {
color: @navbar-inverse-link-active-color;
background-color: @navbar-inverse-link-active-bg;
}
}
> .disabled > a {
&,
&:hover,
&:focus {
color: @navbar-inverse-link-disabled-color;
background-color: @navbar-inverse-link-disabled-bg;
}
}
}
}
}
}
@ -298,11 +488,6 @@
@media screen and (min-width: @grid-float-breakpoint) {
.navbar-brand {
float: left;
margin-left: -(@navbar-padding-horizontal);
margin-right: 5px;
}
.navbar-nav {
float: left;
// undo margin to make nav extend full height of navbar
@ -312,14 +497,10 @@
> li {
float: left;
> a {
border-radius: 0;
padding-top: ((@navbar-height - @line-height-computed) / 2);
padding-bottom: ((@navbar-height - @line-height-computed) / 2);
}
}
&.pull-right {
float: right;
width: auto;
}
}
// Required to make the collapsing navbar work on regular desktops
@ -329,9 +510,10 @@
left: auto;
display: none;
}
.nav-collapse.collapse {
.navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0; // Override default setting
overflow: visible !important;
}
@ -354,6 +536,7 @@
// Add a class to make any element properly align itself vertically within the navbars.
.navbar-text {
float: left;
.navbar-vertical-align(@line-height-computed);
}

View File

@ -39,11 +39,6 @@
cursor: not-allowed;
}
}
// Space the headers out when they follow another list item (link)
+ .nav-header {
margin-top: 9px;
}
}
// Open dropdowns
@ -61,23 +56,19 @@
}
}
// Redeclare pull classes because of specificity
// Todo: consider making these utilities !important to avoid this bullshit
> .pull-right {
float: right;
}
// Dividers (basically an hr) within the dropdown
.nav-divider {
.nav-divider();
}
// Prevent IE8 from misplacing imgs
// See https://github.com/h5bp/html5-boilerplate/issues/984#issuecomment-3985989
> li > a > img {
max-width: none;
}
}
// Nav variations
// --------------------------------------------------
// Tabs
// -------------------------
@ -153,14 +144,16 @@
> li {
float: none;
+ li {
> a {
margin-top: 2px;
margin-left: 0; // no need for this gap between nav items
}
margin-top: 2px;
margin-left: 0; // no need for this gap between nav items
}
}
}
// Nav variations
// --------------------------------------------------
// Justified nav links
// -------------------------
@ -188,11 +181,9 @@
> .active > a {
border-bottom-color: @nav-tabs-justified-active-link-border-color;
}
}
// Tabbable tabs
// -------------------------

View File

@ -12,7 +12,7 @@
> a,
> span {
float: left; // Collapse white-space
padding: 4px 12px;
padding: @padding-base-vertical @padding-base-horizontal;
line-height: @line-height-base;
text-decoration: none;
background-color: @pagination-bg;
@ -62,47 +62,11 @@
// --------------------------------------------------
// Large
.pagination-large {
> li {
> a,
> span {
padding: @padding-large-vertical @padding-large-horizontal;
font-size: @font-size-large;
}
&:first-child {
> a,
> span {
.border-left-radius(@border-radius-large);
}
}
&:last-child {
> a,
> span {
.border-right-radius(@border-radius-large);
}
}
}
.pagination-lg {
.pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large);
}
// Small
.pagination-small {
> li {
> a,
> span {
padding: @padding-small-vertical @padding-small-horizontal;
font-size: @font-size-small;
}
&:first-child {
> a,
> span {
.border-left-radius(@border-radius-small);
}
}
&:last-child {
> a,
> span {
.border-right-radius(@border-radius-small);
}
}
}
.pagination-sm {
.pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small);
}

View File

@ -5,22 +5,54 @@
// Base class
.panel {
padding: 15px;
margin-bottom: 20px;
margin-bottom: @line-height-computed;
background-color: @panel-bg;
border: 1px solid @panel-border;
border-radius: @panel-border-radius;
.box-shadow(0 1px 1px rgba(0,0,0,.05));
}
// Panel contents
.panel-body {
padding: 15px;
}
// List groups in panels
//
// By default, space out list group content from panel headings to account for
// any kind of custom content between the two.
.panel {
.list-group {
margin-bottom: 0;
.list-group-item {
border-width: 1px 0;
// Remove border radius for top one
&:first-child {
.border-top-radius(0);
}
// But keep it for the last one
&:last-child {
border-bottom: 0;
}
}
}
}
// Collapse space between when there's no additional content.
.panel-heading + .list-group {
.list-group-item:first-child {
border-top-width: 0;
}
}
// Optional heading
.panel-heading {
margin: -15px -15px 15px;
padding: 10px 15px;
background-color: @panel-heading-bg;
border-bottom: 1px solid @panel-border;
border-top-left-radius: (@panel-border-radius - 1);
border-top-right-radius: (@panel-border-radius - 1);
.border-top-radius(@panel-border-radius - 1);
}
// Within heading, strip any `h*` tag of it's default margins for spacing.
@ -28,75 +60,69 @@
margin-top: 0;
margin-bottom: 0;
font-size: (@font-size-base * 1.25);
font-weight: 500;
> a {
color: inherit;
}
}
// Optional footer (stays gray in every modifier class)
.panel-footer {
margin: 15px -15px -15px;
padding: 10px 15px;
background-color: @panel-footer-bg;
border-top: 1px solid @panel-border;
border-bottom-left-radius: (@panel-border-radius - 1);
border-bottom-right-radius: (@panel-border-radius - 1);
.border-bottom-radius(@panel-border-radius - 1);
}
// Collapsable panels (aka, accordion)
//
// Wrap a series of panels in `.panel-group` to turn them into an accordion with
// the help of our collapse JavaScript plugin.
.panel-group {
// Tighten up margin so it's only between panels
.panel {
margin-bottom: 0;
border-radius: @panel-border-radius;
overflow: hidden; // crop contents when collapsed
+ .panel {
margin-top: 5px;
}
}
.panel-heading {
border-bottom: 0;
+ .panel-collapse .panel-body {
border-top: 1px solid @panel-border;
}
}
.panel-footer {
border-top: 0;
+ .panel-collapse .panel-body {
border-bottom: 1px solid @panel-border;
}
}
// New subcomponent for wrapping collapsable content for proper animations
.panel-collapse {
}
}
// Contextual variations
.panel-primary {
border-color: @panel-primary-border;
.panel-heading {
color: @panel-primary-text;
background-color: @panel-primary-heading-bg;
border-color: @panel-primary-border;
}
.panel-variant(@panel-primary-border; @panel-primary-text; @panel-primary-heading-bg; @panel-primary-border);
}
.panel-success {
border-color: @panel-success-border;
.panel-heading {
color: @panel-success-text;
background-color: @panel-success-heading-bg;
border-color: @panel-success-border;
}
.panel-variant(@panel-success-border; @panel-success-text; @panel-success-heading-bg; @panel-success-border);
}
.panel-warning {
border-color: @panel-warning-border;
.panel-heading {
color: @panel-warning-text;
background-color: @panel-warning-heading-bg;
border-color: @panel-warning-border;
}
.panel-variant(@panel-warning-border; @panel-warning-text; @panel-warning-heading-bg; @panel-warning-border);
}
.panel-danger {
border-color: @panel-danger-border;
.panel-heading {
color: @panel-danger-text;
background-color: @panel-danger-heading-bg;
border-color: @panel-danger-border;
}
.panel-variant(@panel-danger-border; @panel-danger-text; @panel-danger-heading-bg; @panel-danger-border);
}
.panel-info {
border-color: @panel-info-border;
.panel-heading {
color: @panel-info-text;
background-color: @panel-info-heading-bg;
border-color: @panel-info-border;
}
}
// List groups in panels
.list-group-flush {
margin: 15px -15px -15px;
.list-group-item {
border-width: 1px 0;
// Remove border radius for top one
&:first-child {
.border-top-radius(0);
}
// But keep it for the last one
&:last-child {
border-bottom: 0;
}
}
.panel-variant(@panel-info-border; @panel-info-text; @panel-info-heading-bg; @panel-info-border);
}

View File

@ -13,8 +13,6 @@
padding: 1px;
text-align: left; // Reset given new insertion method
background-color: @popover-bg;
-webkit-bg-clip: padding-box;
-moz-bg-clip: padding;
background-clip: padding-box;
border: 1px solid @popover-fallback-border-color;
border: 1px solid @popover-border-color;

View File

@ -18,19 +18,13 @@
to { background-position: 0 0; }
}
// IE9
@-ms-keyframes progress-bar-stripes {
from { background-position: 40px 0; }
to { background-position: 0 0; }
}
// Opera
@-o-keyframes progress-bar-stripes {
from { background-position: 0 0; }
to { background-position: 40px 0; }
}
// Spec
// Spec and IE10+
@keyframes progress-bar-stripes {
from { background-position: 40px 0; }
to { background-position: 0 0; }
@ -67,7 +61,7 @@
// Striped bars
.progress-striped .progress-bar {
#gradient > .striped(@progress-bar-bg);
.background-size(40px 40px);
background-size: 40px 40px;
}
// Call animation for the active one

View File

@ -35,70 +35,100 @@
// Visibility utilities
// For Phones
.visible-sm {
.visible-xs {
.responsive-visibility();
@media (min-width: @screen-tablet) and (max-width: @screen-tablet-max) {
.responsive-invisibility();
}
@media (min-width: @screen-desktop) and (max-width: @screen-desktop-max) {
.responsive-invisibility();
}
@media (min-width: @screen-large-desktop) {
.responsive-invisibility();
}
}
.visible-sm {
.responsive-invisibility();
@media (min-width: @screen-tablet) and (max-width: @screen-tablet-max) {
.responsive-visibility();
}
@media (min-width: @screen-desktop) and (max-width: @screen-desktop-max) {
.responsive-invisibility();
}
@media (min-width: @screen-large-desktop) {
.responsive-invisibility();
}
}
.visible-md {
.responsive-invisibility();
@media (min-width: @screen-tablet) and (max-width: @screen-tablet-max) {
.responsive-invisibility();
}
@media (min-width: @screen-desktop) and (max-width: @screen-desktop-max) {
.responsive-visibility();
}
@media (min-width: @screen-large-desktop) {
.responsive-invisibility();
}
}
.visible-lg {
.responsive-invisibility();
@media (min-width: @screen-tablet) and (max-width: @screen-tablet-max) {
.responsive-invisibility();
}
@media (min-width: @screen-desktop) and (max-width: @screen-desktop-max) {
.responsive-invisibility();
}
@media (min-width: @screen-large-desktop) {
.responsive-visibility();
}
}
.hidden-sm {
.hidden-xs {
.responsive-invisibility();
@media (min-width: @screen-tablet) and (max-width: @screen-tablet-max) {
.responsive-visibility();
}
@media (min-width: @screen-desktop) and (max-width: @screen-desktop-max) {
.responsive-visibility();
}
@media (min-width: @screen-large-desktop) {
.responsive-visibility();
}
}
.hidden-sm {
.responsive-visibility();
@media (min-width: @screen-tablet) and (max-width: @screen-tablet-max) {
.responsive-invisibility();
}
@media (min-width: @screen-desktop) and (max-width: @screen-desktop-max) {
.responsive-visibility();
}
@media (min-width: @screen-large-desktop) {
.responsive-visibility();
}
}
.hidden-md {
.responsive-visibility();
@media (min-width: @screen-tablet) and (max-width: @screen-tablet-max) {
.responsive-visibility();
}
@media (min-width: @screen-desktop) and (max-width: @screen-desktop-max) {
.responsive-invisibility();
}
@media (min-width: @screen-large-desktop) {
.responsive-visibility();
}
}
.hidden-lg {
.responsive-visibility();
}
// Tablets & small desktops only
@media (min-width: @screen-tablet) and (max-width: @screen-tablet-max) {
.visible-sm {
.responsive-invisibility();
}
.visible-md {
@media (min-width: @screen-tablet) and (max-width: @screen-tablet-max) {
.responsive-visibility();
}
.visible-lg {
.responsive-invisibility();
}
.hidden-sm {
@media (min-width: @screen-desktop) and (max-width: @screen-desktop-max) {
.responsive-visibility();
}
.hidden-md {
.responsive-invisibility();
}
.hidden-lg {
.responsive-visibility();
}
}
// For desktops
@media (min-width: @screen-desktop) {
.visible-sm {
.responsive-invisibility();
}
.visible-md {
.responsive-invisibility();
}
.visible-lg {
.responsive-visibility();
}
.hidden-sm {
.responsive-visibility();
}
.hidden-md {
.responsive-visibility();
}
.hidden-lg {
@media (min-width: @screen-large-desktop) {
.responsive-invisibility();
}
}

View File

@ -6,7 +6,9 @@
// Reset the box-sizing
// -------------------------
* {
*,
*:before,
*:after {
.box-sizing(border-box);
}
@ -79,7 +81,7 @@ img {
// Perfect circle
.img-circle {
border-radius: 500px; // crank the border-radius so it works with most reasonably sized images
border-radius: 50%; // set radius in percents
}
@ -93,3 +95,17 @@ hr {
border-top: 1px solid @hr-border;
}
// Only display content to screen readers
// See: http://a11yproject.com/posts/how-to-hide-content/
// -------------------------
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0;
}

View File

@ -162,50 +162,14 @@ table {
> th.active,
&.active > td,
&.active > th {
background-color: @table-bg-hover;
}
> td.success,
> th.success,
&.success > td,
&.success > th {
background-color: @state-success-bg;
border-color: @state-success-border;
}
> td.danger,
> th.danger,
&.danger > td,
&.danger > th {
background-color: @state-danger-bg;
border-color: @state-danger-border;
}
> td.warning,
> th.warning,
&.warning > td,
&.warning > th {
background-color: @state-warning-bg;
border-color: @state-warning-border;
background-color: @table-bg-active;
}
}
// Hover states for `.table-hover`
// Note: this is not available for cells or rows within `thead` or `tfoot`.
.table-hover > tbody > tr {
> td.success:hover,
> th.success:hover,
&.success:hover > td {
background-color: darken(@state-success-bg, 5%);
border-color: darken(@state-success-border, 5%);
}
> td.danger:hover,
> th.danger:hover,
&.danger:hover > td {
background-color: darken(@state-danger-bg, 5%);
border-color: darken(@state-danger-border, 5%);
}
> td.warning:hover,
> th.warning:hover,
&.warning:hover > td {
background-color: darken(@state-warning-bg, 5%);
border-color: darken(@state-warning-border, 5%);
}
}
// Contextual variants
// -------------------
.table-row-variant(success; @state-success-bg; @state-success-border);
.table-row-variant(danger; @state-danger-bg; @state-danger-border);
.table-row-variant(warning; @state-warning-bg; @state-warning-border);

View File

@ -10,7 +10,7 @@
// Can be `a`, `div`, or `img`
.thumbnail,
.img-thumbnail {
padding: 4px;
padding: @thumbnail-padding;
line-height: @line-height-base;
background-color: @thumbnail-bg;
border: 1px solid @thumbnail-border;
@ -37,6 +37,6 @@ a.thumbnail:focus {
margin-right: auto;
}
.thumbnail .caption {
padding: 9px;
padding: @thumbnail-caption-padding;
color: @thumbnail-caption-color;
}

View File

@ -13,7 +13,7 @@
line-height: 1.4;
.opacity(0);
&.in { .opacity(1); }
&.in { .opacity(.9); }
&.top { margin-top: -3px; padding: 5px 0; }
&.right { margin-left: 3px; padding: 0 5px; }
&.bottom { margin-top: 3px; padding: 5px 0; }

View File

@ -141,18 +141,25 @@ dt {
dd {
margin-left: 0; // Undo browser default
}
// Horizontal layout (like forms)
.dl-horizontal {
dt {
float: left;
width: (@component-offset-horizontal - 20);
clear: left;
text-align: right;
.text-overflow();
}
dd {
.clearfix(); // Clear the floated `dt` if an empty `dd` is present
margin-left: @component-offset-horizontal;
// Horizontal description lists
//
// Defaults to being stacked without any of the below styles applied, until the
// grid breakpoint is reached (default of ~768px).
@media (min-width: @grid-float-breakpoint) {
.dl-horizontal {
dt {
float: left;
width: (@component-offset-horizontal - 20);
clear: left;
text-align: right;
.text-overflow();
}
dd {
margin-left: @component-offset-horizontal;
.clearfix(); // Clear the floated `dt` if an empty `dd` is present
}
}
}
@ -195,7 +202,6 @@ blockquote {
// Float right with text-align: right
&.pull-right {
float: right;
padding-right: 15px;
padding-left: 0;
border-right: 5px solid @blockquote-border-color;

View File

@ -10,10 +10,10 @@
.clearfix();
}
.pull-right {
float: right;
float: right !important;
}
.pull-left {
float: left;
float: left !important;
}

View File

@ -60,21 +60,26 @@
// -------------------------
// Based on 14px font-size and 1.428 line-height (~20px to start)
@padding-base-vertical: 8px;
@padding-base-vertical: 6px;
@padding-base-horizontal: 12px;
@padding-large-vertical: 14px;
@padding-large-vertical: 10px;
@padding-large-horizontal: 16px;
@padding-small-vertical: 5px;
@padding-small-horizontal: 10px;
@line-height-large: 1.33;
@line-height-small: 1.5;
@border-radius-base: 4px;
@border-radius-large: 6px;
@border-radius-small: 3px;
@component-active-bg: @brand-primary;
@caret-width-base: 4px;
@caret-width-large: 5px;
// Tables
// -------------------------
@ -93,31 +98,33 @@
// Buttons
// -------------------------
@btn-default-color: #fff;
@btn-default-bg: #474949;
@btn-default-border: @btn-default-bg;
@btn-font-weight: bold;
@btn-primary-color: @btn-default-color;
@btn-default-color: #333;
@btn-default-bg: #fff;
@btn-default-border: #ccc;
@btn-primary-color: #fff;
@btn-primary-bg: @brand-primary;
@btn-primary-border: @btn-primary-bg;
@btn-primary-border: darken(@btn-primary-bg, 5%);
@btn-success-color: @btn-default-color;
@btn-success-color: #fff;
@btn-success-bg: @brand-success;
@btn-success-border: @btn-success-bg;
@btn-success-border: darken(@btn-success-bg, 5%);
@btn-warning-color: @btn-default-color;
@btn-warning-color: #fff;
@btn-warning-bg: @brand-warning;
@btn-warning-border: @btn-warning-bg;
@btn-warning-border: darken(@btn-warning-bg, 5%);
@btn-danger-color: @btn-default-color;
@btn-danger-color: #fff;
@btn-danger-bg: @brand-danger;
@btn-danger-border: @btn-danger-bg;
@btn-danger-border: darken(@btn-danger-bg, 5%);
@btn-info-color: @btn-default-color;
@btn-info-color: #fff;
@btn-info-bg: @brand-info;
@btn-info-border: @btn-info-bg;
@btn-info-border: darken(@btn-info-bg, 5%);
@btn-hover-color: @btn-default-color;
@btn-link-disabled-color: @gray-light;
// Forms
@ -126,17 +133,21 @@
@input-bg: #fff;
@input-bg-disabled: @gray-lighter;
@input-color: @gray;
@input-border: #ccc;
@input-border-radius: @border-radius-base;
@input-border-focus: #66afe9;
@input-color-placeholder: @gray-light;
@input-height-base: (@line-height-computed + (@padding-base-vertical * 2) + 2);
@input-height-large: (ceil(@font-size-large * @line-height-base) + (@padding-large-vertical * 2) + 2);
@input-height-small: (ceil(@font-size-small * @line-height-base) + (@padding-small-vertical * 2) + 2);
@input-height-large: (floor(@font-size-large * @line-height-large) + (@padding-large-vertical * 2) + 2);
@input-height-small: (floor(@font-size-small * @line-height-small) + (@padding-small-vertical * 2) + 2);
@legend-color: @gray-dark;
@legend-border-color: #e5e5e5;
@input-group-addon-bg: @gray-lighter;
@input-group-addon-border-color: @input-border;
@ -155,6 +166,10 @@
@dropdown-link-hover-color: #fff;
@dropdown-link-hover-bg: @dropdown-link-active-bg;
@dropdown-link-disabled-color: @gray-light;
@dropdown-header-color: @gray-light;
@dropdown-caret-color: #000;
@ -174,15 +189,54 @@
@zindex-modal-background: 1040;
@zindex-modal: 1050;
// Media queries breakpoints
// --------------------------------------------------
// Extra small screen / phone
@screen-xsmall: 480px;
@screen-phone: @screen-xsmall;
// Small screen / tablet
@screen-small: 768px;
@screen-tablet: @screen-small;
// Medium screen / desktop
@screen-medium: 992px;
@screen-desktop: @screen-medium;
// Large screen / wide desktop
@screen-large: 1200px;
@screen-large-desktop: @screen-large;
// So media queries don't overlap when required, provide a maximum
@screen-phone-max: (@screen-small - 1);
@screen-small-max: (@screen-medium - 1);
@screen-tablet-max: (@screen-desktop - 1);
@screen-desktop-max: (@screen-large-desktop - 1);
// Grid system
// --------------------------------------------------
// Number of columns in the grid system
@grid-columns: 12;
// Padding, to be divided by two and applied to the left and right of all columns
@grid-gutter-width: 30px;
// Point at which the navbar stops collapsing
@grid-float-breakpoint: @screen-tablet;
// Navbar
// -------------------------
// Basics of a navbar
@navbar-height: 50px;
@navbar-margin-bottom: @line-height-computed;
@navbar-color: #777;
@navbar-bg: #eee;
@navbar-padding-horizontal: floor(@grid-gutter-width / 2); // ~15px
@navbar-bg: #f8f8f8;
@navbar-border: darken(@navbar-bg, 6.5%);
@navbar-border-radius: @border-radius-base;
@navbar-padding-horizontal: floor(@grid-gutter-width / 2);
@navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2);
// Navbar links
@ -190,7 +244,7 @@
@navbar-link-hover-color: #333;
@navbar-link-hover-bg: transparent;
@navbar-link-active-color: #555;
@navbar-link-active-bg: darken(@navbar-bg, 10%);
@navbar-link-active-bg: darken(@navbar-bg, 6.5%);
@navbar-link-disabled-color: #ccc;
@navbar-link-disabled-bg: transparent;
@ -210,6 +264,7 @@
// Reset inverted navbar basics
@navbar-inverse-color: @gray-light;
@navbar-inverse-bg: #222;
@navbar-inverse-border: darken(@navbar-inverse-bg, 10%);
// Inverted navbar links
@navbar-inverse-link-color: @gray-light;
@ -314,7 +369,7 @@
// -------------------------
@tooltip-max-width: 200px;
@tooltip-color: #fff;
@tooltip-bg: rgba(0,0,0,.9);
@tooltip-bg: #000;
@tooltip-arrow-width: 5px;
@tooltip-arrow-color: @tooltip-bg;
@ -339,6 +394,8 @@
// Labels
// -------------------------
@label-default-bg: @gray-light;
@label-success-bg: @brand-success;
@label-info-bg: @brand-info;
@label-warning-bg: @brand-warning;
@ -366,10 +423,13 @@
// Alerts
// -------------------------
@alert-padding: 15px;
@alert-border-radius: @border-radius-base;
@alert-link-font-weight: bold;
@alert-bg: @state-warning-bg;
@alert-text: @state-warning-text;
@alert-border: @state-warning-border;
@alert-border-radius: @border-radius-base;
@alert-success-bg: @state-success-bg;
@alert-success-text: @state-success-text;
@ -442,31 +502,33 @@
// Thumbnails
// -------------------------
@thumbnail-caption-color: @text-color;
@thumbnail-padding: 4px;
@thumbnail-bg: @body-bg;
@thumbnail-border: #ddd;
@thumbnail-border-radius: @border-radius-base;
@thumbnail-caption-color: @text-color;
@thumbnail-caption-padding: 9px;
// Wells
// -------------------------
@well-bg: #f5f5f5;
// Accordion
// -------------------------
@accordion-border-color: #e5e5e5;
// Badges
// -------------------------
@badge-color: #fff;
@badge-link-hover-color: #fff;
@badge-bg: @gray-light;
@badge-active-color: @link-color;
@badge-active-bg: #fff;
@badge-font-weight: bold;
@badge-line-height: 1;
@badge-border-radius: 10px;
// Breadcrumbs
// -------------------------
@ -477,12 +539,16 @@
// Carousel
// ------------------------
@carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6);
@carousel-control-color: #fff;
@carousel-control-width: 15%;
@carousel-control-opacity: .5;
@carousel-control-font-size: 20px;
@carousel-indicator-border-color: #fff;
@carousel-indicator-active-bg: #fff;
@carousel-indicator-border-color: #fff;
@carousel-caption-color: #fff;
@ -490,6 +556,7 @@
// Close
// ------------------------
@close-color: #000;
@close-font-weight: bold;
@close-text-shadow: 0 1px 0 #fff;
@ -499,7 +566,9 @@
@code-bg: #f9f2f4;
@pre-bg: #f5f5f5;
@pre-color: @gray-dark;
@pre-border-color: #ccc;
@pre-scrollable-max-height: 340px;
// Type
// ------------------------
@ -520,49 +589,14 @@
@component-offset-horizontal: 180px;
// Media queries breakpoints
// --------------------------------------------------
// Tiny screen / phone
@screen-tiny: 480px;
@screen-phone: @screen-tiny;
// Small screen / tablet
@screen-small: 768px;
@screen-tablet: @screen-small;
// Medium screen / desktop
@screen-medium: 992px;
@screen-desktop: @screen-medium;
// So media queries don't overlap when required, provide a maximum
@screen-small-max: (@screen-medium - 1);
@screen-tablet-max: @screen-small-max;
// Large screen / wide desktop
@screen-large: 1200px;
@screen-large-desktop: @screen-large;
// Container sizes
// --------------------------------------------------
// Small screen / tablet
@container-tablet: 728px;
@container-tablet: 720px;
// Medium screen / desktop
@container-desktop: 940px;
// Large screen / wide desktop
@container-large-desktop: 1170px;
// Grid system
// --------------------------------------------------
// Number of columns in the grid system
@grid-columns: 12;
// Padding, to be divided by two and applied to the left and right of all columns
@grid-gutter-width: 30px;
// Point at which the navbar stops collapsing
@grid-float-breakpoint: @screen-tablet;
@container-large-desktop: 1140px;

View File

@ -19,11 +19,11 @@
}
// Sizes
.well-large {
.well-lg {
padding: 24px;
border-radius: @border-radius-large;
}
.well-small {
.well-sm {
padding: 9px;
border-radius: @border-radius-small;
}

View File

@ -84,13 +84,14 @@ define([
});
};
function exportFileToPath(path, title, content, callback) {
dropboxProvider.exportFile = function(event, title, content, callback) {
var path = utils.getInputTextValue("#input-sync-export-dropbox-path", event);
path = checkPath(path);
if(path === undefined) {
callback(true);
return;
}
// Check that file is not synchronized with an other one
// Check that file is not synchronized with another one
var syncIndex = createSyncIndex(path);
var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex);
if(fileDesc !== undefined) {
@ -107,16 +108,6 @@ define([
var syncAttributes = createSyncAttributes(result.path, result.versionTag, content);
callback(undefined, syncAttributes);
});
}
dropboxProvider.exportFile = function(event, title, content, callback) {
var path = utils.getInputTextValue("#input-sync-export-dropbox-path", event);
exportFileToPath(path, title, content, callback);
};
dropboxProvider.exportManual = function(event, title, content, callback) {
var path = utils.getInputTextValue("#input-sync-manual-dropbox-path", event);
exportFileToPath(path, title, content, callback);
};
dropboxProvider.syncUp = function(uploadContent, uploadContentCRC, uploadTitle, uploadTitleCRC, syncAttributes, callback) {

View File

@ -78,8 +78,19 @@ define([
};
gdriveProvider.exportFile = function(event, title, content, callback) {
var fileId = utils.getInputTextValue("#input-sync-export-gdrive-fileid");
if(fileId) {
// Check that file is not synchronized with another an existing document
var syncIndex = createSyncIndex(fileId);
var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex);
if(fileDesc !== undefined) {
eventMgr.onError('File ID is already synchronized with "' + fileDesc.title + '".');
callback(true);
return;
}
}
var parentId = utils.getInputTextValue("#input-sync-export-gdrive-parentid");
googleHelper.upload(undefined, parentId, title, content, undefined, function(error, result) {
googleHelper.upload(fileId, parentId, title, content, undefined, function(error, result) {
if(error) {
callback(error);
return;
@ -101,29 +112,6 @@ define([
});
};
gdriveProvider.exportManual = function(event, title, content, callback) {
var id = utils.getInputTextValue("#input-sync-manual-gdrive-id", event);
if(!id) {
return;
}
// Check that file is not synchronized with another an existing document
var syncIndex = createSyncIndex(id);
var fileDesc = fileMgr.getFileFromSyncIndex(syncIndex);
if(fileDesc !== undefined) {
eventMgr.onError('File ID is already synchronized with "' + fileDesc.title + '".');
callback(true);
return;
}
googleHelper.upload(id, undefined, title, content, undefined, function(error, result) {
if(error) {
callback(error);
return;
}
var syncAttributes = createSyncAttributes(result.id, result.etag, content, title);
callback(undefined, syncAttributes);
});
};
gdriveProvider.syncUp = function(uploadContent, uploadContentCRC, uploadTitle, uploadTitleCRC, syncAttributes, callback) {
var syncContentCRC = syncAttributes.contentCRC;
var syncTitleCRC = syncAttributes.titleCRC;
@ -401,6 +389,14 @@ define([
};
eventMgr.addListener("onReady", function() {
// On export, disable file ID input if realtime is checked
var $realtimeCheckboxElt = $('#input-sync-export-gdrive-realtime');
var $fileIdInputElt = $('#input-sync-export-gdrive-fileid');
$('#input-sync-export-gdrive-realtime').change(function() {
$fileIdInputElt.prop('disabled', $realtimeCheckboxElt.prop('checked'));
});
var state = utils.retrieveIgnoreError(PROVIDER_GDRIVE + ".state");
if(state === undefined) {
return;

View File

@ -13,13 +13,16 @@
/* Bootstrap */
@body-bg: #f5f5f5;
@input-border: #ddd;
@input-height-base: 38px;
@dropdown-border: #ddd;
@pre-border-color: #ddd;
@navbar-bg: #ddd;
@navbar-border: @transparent;
@nav-disabled-link-color: #ccc;
@nav-disabled-link-hover-color: #bbb;
@dropdown-link-hover-bg: #888;
@dropdown-link-active-color: #fff;
@list-group-link-color: #333;
@list-group-border: @transparent;
@list-group-active-bg: @dropdown-link-hover-bg;
@input-color-placeholder: #ccc;
@ -74,7 +77,6 @@ body {
.list-group-item {
padding: 10px 15px;
.list-group & {
color: @btn-default-color;
border-radius: 0;
}
&.active:hover {
@ -255,7 +257,7 @@ body {
width: 43px;
height: 11px;
background-position: 0 0;
margin: 15px 10px 0;
margin-top: 15px;
&.show {
background-image: url("../../img/ajax-loader.gif") !important;
}
@ -281,6 +283,7 @@ body {
}
.panel-content {
overflow: auto;
padding-bottom: 30px;
height: 100%;
a > i {
margin-right: 3px;
@ -297,6 +300,9 @@ body {
-moz-transition: margin-left 0.35s ease;
-o-transition: margin-left 0.35s ease;
transition: margin-left 0.35s ease;
.sub-menu {
background-color: @list-group-bg;
}
&.in {
margin-left: 0;
.collapse-button {
@ -312,16 +318,11 @@ body {
}
.panel-content {
padding-top: 6px;
padding-bottom: 25px;
border-right: 5px solid @preview-bg-light;
.nav {
margin-bottom: 20px;
}
}
}
.document-panel {
background-color: @list-group-bg;
right: 0;
width: @document-panel-width !important;
margin-right: (-@document-panel-width - 32);
@ -346,6 +347,8 @@ body {
}
}
.panel-content {
background-color: @list-group-bg;
padding-top: 80px;
border-left: 5px solid @preview-bg-light;
.icon-layers {
font-size: 135%;
@ -355,7 +358,7 @@ body {
position: absolute;
background-color: @panel-bg;
margin: -10px 25px 0;
padding: 20px 5px 10px 20px;
padding: 20px 5px 10px 15px;
z-index: 3;
border: 1px solid #e8e8e8;
border-top: 0;
@ -369,6 +372,7 @@ body {
margin-left: -30px;
margin-top: 5px;
padding: 8px;
font-weight: normal;
}
}
.list-group-item {
@ -381,8 +385,6 @@ body {
border-bottom-color: @modal-content-separator-color;
}
.list-group {
padding-top: 70px;
padding-bottom: 30px;
margin: 0;
.nav {
border: 0;
@ -636,6 +638,25 @@ body {
}
/********************************
* Publish/Sync dialogs
********************************/
.modal-manage-sync .sync-list {
margin-bottom: 20px;
.input-group {
margin-bottom: 10px;
}
}
.modal-manage-publish .publish-list {
margin-bottom: 20px;
.input-group {
margin-bottom: 10px;
}
}
/*********************************
* UI Layout
*********************************/

View File

@ -345,21 +345,6 @@ define([
});
localStorage[provider.providerId + ".exportPreferences"] = JSON.stringify(exportPreferences);
});
// Provider's manual export button
$(".action-sync-manual-" + provider.providerId).click(function(event) {
var fileDesc = fileMgr.currentFile;
if(_.size(fileDesc.syncLocations) > 0 && _.first(_.values(fileDesc.syncLocations)).isRealtime) {
eventMgr.onError("Real time collaborative document can't be synchronized with multiple locations");
return;
}
provider.exportManual(event, fileDesc.title, fileDesc.content, function(error, syncAttributes) {
if(error) {
return;
}
fileDesc.addSyncLocation(syncAttributes);
eventMgr.onSyncExportSuccess(fileDesc, syncAttributes);
});
});
});
});

View File

@ -138,7 +138,7 @@ define([
// Reset input control in all modals
utils.resetModalInputs = function() {
$(".modal input[type=text]:not([disabled]), .modal input[type=password], .modal textarea").val("");
$(".modal input[type=checkbox]").prop("checked", false);
$(".modal input[type=checkbox]").prop("checked", false).change();
};
// Basic trim function