2013-11-16 06:21:12 +08:00
|
|
|
//
|
|
|
|
// Mixins
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
// UTILITY MIXINS
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
// Clearfix
|
|
|
|
// --------
|
|
|
|
// For clearing floats like a boss h5bp.com/q
|
|
|
|
.clearfix {
|
|
|
|
&:before,
|
|
|
|
&:after {
|
|
|
|
display: table;
|
|
|
|
content: "";
|
|
|
|
// Fixes Opera/contenteditable bug:
|
|
|
|
// http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
|
|
|
|
line-height: 0;
|
|
|
|
}
|
|
|
|
&:after {
|
|
|
|
clear: both;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Webkit-style focus
|
|
|
|
// ------------------
|
|
|
|
.tab-focus() {
|
|
|
|
// Default
|
|
|
|
outline: thin dotted #333;
|
|
|
|
// Webkit
|
|
|
|
outline: 5px auto -webkit-focus-ring-color;
|
|
|
|
outline-offset: -2px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FORMS
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
2020-09-04 18:05:17 +08:00
|
|
|
// Block level inputs
|
|
|
|
.input-block-level {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
min-height: 30px; // Make inputs at least the height of their button counterpart
|
|
|
|
box-sizing: border-box; // Makes inputs behave like true block-level elements
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-16 06:21:12 +08:00
|
|
|
// Mixin for form field states
|
|
|
|
.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
|
|
|
|
// Set the text color
|
|
|
|
> label,
|
2021-02-02 05:54:19 +08:00
|
|
|
.help-block {
|
2013-11-16 06:21:12 +08:00
|
|
|
color: @textColor;
|
|
|
|
}
|
|
|
|
// Style inputs accordingly
|
|
|
|
input,
|
|
|
|
select,
|
|
|
|
textarea {
|
|
|
|
color: @textColor;
|
|
|
|
border-color: @borderColor;
|
2020-09-03 03:30:23 +08:00
|
|
|
box-shadow: inset 0 1px 1px rgba(0,0,0,.075); // Redeclare so transitions work
|
2013-11-16 06:21:12 +08:00
|
|
|
&:focus {
|
|
|
|
border-color: darken(@borderColor, 10%);
|
|
|
|
// Write out in full since the lighten() function isn't easily escaped
|
2020-09-03 03:30:23 +08:00
|
|
|
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%);
|
2013-11-16 06:21:12 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Give a small background color for input-prepend/-append
|
|
|
|
.input-append .add-on {
|
|
|
|
color: @textColor;
|
|
|
|
background-color: @backgroundColor;
|
|
|
|
border-color: @textColor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// COMPONENT MIXINS
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
// Grid System
|
|
|
|
// -----------
|
|
|
|
|
|
|
|
// Table columns
|
|
|
|
.tableColumns(@columnSpan: 1) {
|
|
|
|
float: none; // undo default grid column styles
|
|
|
|
width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells
|
|
|
|
margin-left: 0; // undo default grid column styles
|
|
|
|
}
|
|
|
|
|
|
|
|
// The Grid
|
|
|
|
#grid {
|
|
|
|
|
|
|
|
.core (@gridColumnWidth, @gridGutterWidth) {
|
|
|
|
|
|
|
|
.spanX (@index) when (@index > 0) {
|
2014-06-17 03:56:11 +08:00
|
|
|
// (~".span@{index}") { .span(@index); }
|
|
|
|
.span@{index} { .span(@index); }
|
2013-11-16 06:21:12 +08:00
|
|
|
.spanX(@index - 1);
|
|
|
|
}
|
|
|
|
.spanX (0) {}
|
|
|
|
|
|
|
|
.offsetX (@index) when (@index > 0) {
|
2014-06-17 03:56:11 +08:00
|
|
|
// (~".offset@{index}") { .offset(@index); }
|
|
|
|
.offset@{index} { .offset(@index); }
|
2013-11-16 06:21:12 +08:00
|
|
|
.offsetX(@index - 1);
|
|
|
|
}
|
|
|
|
.offsetX (0) {}
|
|
|
|
|
|
|
|
.offset (@columns) {
|
|
|
|
margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns + 1));
|
|
|
|
}
|
|
|
|
|
|
|
|
.span (@columns) {
|
|
|
|
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
|
|
|
|
}
|
|
|
|
|
|
|
|
.row {
|
|
|
|
margin-left: @gridGutterWidth * -1;
|
|
|
|
.clearfix();
|
|
|
|
}
|
|
|
|
|
|
|
|
[class*="span"] {
|
|
|
|
float: left;
|
|
|
|
margin-left: @gridGutterWidth;
|
|
|
|
}
|
|
|
|
|
2020-09-02 23:06:35 +08:00
|
|
|
// Set the container width
|
|
|
|
.container { .span(@gridColumns); }
|
2013-11-16 06:21:12 +08:00
|
|
|
|
|
|
|
// generate .spanX and .offsetX
|
|
|
|
.spanX (@gridColumns);
|
|
|
|
.offsetX (@gridColumns);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
|
|
|
|
|
|
|
|
.spanX (@index) when (@index > 0) {
|
2014-06-17 03:56:11 +08:00
|
|
|
// (~".span@{index}") { .span(@index); }
|
|
|
|
.span@{index} { .span(@index); }
|
2013-11-16 06:21:12 +08:00
|
|
|
.spanX(@index - 1);
|
|
|
|
}
|
|
|
|
.spanX (0) {}
|
|
|
|
|
|
|
|
.offsetX (@index) when (@index > 0) {
|
2014-06-17 03:56:11 +08:00
|
|
|
// (~'.offset@{index}') { .offset(@index); }
|
|
|
|
// (~'.offset@{index}:first-child') { .offsetFirstChild(@index); }
|
|
|
|
.offset@{index} { .offset(@index); }
|
|
|
|
.offset@{index}:first-child { .offsetFirstChild(@index); }
|
2013-11-16 06:21:12 +08:00
|
|
|
.offsetX(@index - 1);
|
|
|
|
}
|
|
|
|
.offsetX (0) {}
|
|
|
|
|
|
|
|
.offset (@columns) {
|
|
|
|
margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth*2);
|
|
|
|
}
|
|
|
|
|
|
|
|
.offsetFirstChild (@columns) {
|
|
|
|
margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth);
|
|
|
|
}
|
|
|
|
|
|
|
|
.span (@columns) {
|
|
|
|
width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1));
|
|
|
|
}
|
|
|
|
|
|
|
|
.row-fluid {
|
|
|
|
width: 100%;
|
|
|
|
.clearfix();
|
|
|
|
[class*="span"] {
|
2020-09-03 03:30:23 +08:00
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
min-height: 30px; // Make inputs at least the height of their button counterpart
|
|
|
|
box-sizing: border-box; // Makes inputs behave like true block-level elements
|
2013-11-16 06:21:12 +08:00
|
|
|
float: left;
|
|
|
|
margin-left: @fluidGridGutterWidth;
|
|
|
|
}
|
|
|
|
[class*="span"]:first-child {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// generate .spanX and .offsetX
|
|
|
|
.spanX (@gridColumns);
|
|
|
|
.offsetX (@gridColumns);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.input(@gridColumnWidth, @gridGutterWidth) {
|
|
|
|
|
|
|
|
.spanX (@index) when (@index > 0) {
|
2014-06-17 03:56:11 +08:00
|
|
|
// (~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); }
|
|
|
|
input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index} { .span(@index); }
|
2013-11-16 06:21:12 +08:00
|
|
|
.spanX(@index - 1);
|
|
|
|
}
|
|
|
|
.spanX (0) {}
|
|
|
|
|
|
|
|
.span(@columns) {
|
|
|
|
width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 14;
|
|
|
|
}
|
|
|
|
|
|
|
|
input,
|
|
|
|
textarea,
|
|
|
|
.uneditable-input {
|
|
|
|
margin-left: 0; // override margin-left from core grid system
|
|
|
|
}
|
|
|
|
|
|
|
|
// Space grid-sized controls properly if multiple per line
|
|
|
|
.controls-row [class*="span"] + [class*="span"] {
|
|
|
|
margin-left: @gridGutterWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
// generate .spanX
|
|
|
|
.spanX (@gridColumns);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|