Split admin css from app.css

Cleanup normalize and bootstrap css
Removed almost all css float
Removed CKEditor from app.css
This commit is contained in:
djmaze 2021-02-18 21:06:19 +01:00
parent 6dacfb3cf4
commit b6d8fa5b3f
74 changed files with 455 additions and 1014 deletions

View file

@ -16,6 +16,17 @@
const t = e.target, href = t.href || (t.parentNode && t.parentNode.href);
(href && href.slice(-1) === '#') && e.preventDefault();
},
open = bool => {
menu && menu.classList.toggle('show', bool);
parent.classList.toggle('show', bool);
element.setAttribute('aria-expanded', bool);
element.open = bool;
if (bool) {
element.removeEventListener('click',clickHandler);
} else {
setTimeout(() => element.addEventListener('click',clickHandler), 1);
}
},
toggleEvents = () => {
let action = (element.open ? 'add' : 'remove') + 'EventListener';
doc[action]('click',dismissHandler);
@ -63,28 +74,19 @@
menu = parent.querySelector('.dropdown-menu');
menuItems = [...menu.querySelectorAll('A')].filter(item => 'none' != item.parentNode.style.display);
!('tabindex' in menu) && menu.setAttribute('tabindex', '0');
menu.classList.add('show');
parent.classList.add('show');
element.setAttribute('aria-expanded',true);
element.open = true;
element.removeEventListener('click',clickHandler);
open(true);
setTimeout(() => {
setFocus( menu.getElementsByTagName('INPUT')[0] || element );
toggleEvents();
},1);
};
self.hide = () => {
menu.classList.remove('show');
parent.classList.remove('show');
element.setAttribute('aria-expanded',false);
element.open = false;
open(false);
toggleEvents();
setFocus(element);
setTimeout(() => element.Dropdown && element.addEventListener('click',clickHandler), 1);
};
self.toggle = () => element.open ? self.hide() : self.show();
element.addEventListener('click',clickHandler);
element.open = false;
open(false);
element.Dropdown = self;
},

View file

@ -5,9 +5,11 @@
// Inline and block code styles
code,
kbd,
samp,
pre {
padding: 0 3px 2px;
font-family: @monoFontFamily;
font-family: var(--fontMono);
font-size: @baseFontSize;
font-weight: normal;
line-height: @baseLineHeight;

View file

@ -19,10 +19,8 @@
width: 0;
height: 0;
vertical-align: top;
border-top: 4px solid @black;
border-right: 4px solid transparent;
border-left: 4px solid transparent;
content: "";
border: 4px solid transparent;
border-top-color: @black;
}
// Place the caret
@ -39,7 +37,6 @@
left: 0;
z-index: @zindexDropdown;
display: none; // none by default, but block on "open" of the menu
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0; // override default ul
@ -108,10 +105,3 @@
display: block;
}
}
// Right aligned dropdowns
// ---------------------------
.pull-right > .dropdown-menu {
right: 0;
left: auto;
}

View file

@ -36,29 +36,28 @@ legend {
}
}
// Set font for forms
label,
input,
button,
select,
textarea {
font-size: @baseFontSize;
font-weight: normal;
line-height: @baseLineHeight;
}
input,
button,
select,
textarea {
font-family: @baseFontFamily; // And only set font-family here for those that need it (note the missing label element)
}
// Identify controls by their labels
label {
display: block;
font-size: @baseFontSize;
font-weight: normal;
line-height: @baseLineHeight;
margin-bottom: 5px;
}
// Set font for forms
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
font-size: @baseFontSize;
line-height: @baseLineHeight;
margin: 0;
text-transform: none;
}
// Form controls
// -------------------------
@ -66,12 +65,11 @@ label {
select,
textarea,
input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]) {
box-sizing: border-box;
display: inline-block;
height: @baseLineHeight;
height: @baseLineHeight + 10;
padding: 4px 6px;
margin-bottom: 9px;
font-size: @baseFontSize;
line-height: @baseLineHeight;
color: @gray;
border-radius: @inputBorderRadius;
}
@ -118,13 +116,6 @@ input[type="checkbox"] {
width: auto; // Override of generic input selector
}
// Set the height of select and file controls to match text inputs
select,
input[type="file"] {
height: 30px;
line-height: 30px;
}
// Make select elements obey height by applying a border
select {
width: 223px; // default input width + 10px of padding that doesn't get applied
@ -169,7 +160,6 @@ textarea::placeholder {
input[class*="span"],
select[class*="span"],
textarea[class*="span"] {
float: none;
margin-left: 0;
}
// Ensure input-prepend/append never wraps
@ -179,14 +169,6 @@ textarea[class*="span"] {
// GRID SIZING FOR INPUTS
// ----------------------
// Grid sizes
#grid > .input(@gridColumnWidth, @gridGutterWidth);
// DISABLED STATE
// --------------
@ -214,18 +196,10 @@ input[type="checkbox"][readonly] {
// FORM FIELD FEEDBACK STATES
// --------------------------
// Warning
.control-group.warning {
.formFieldState(@warningText, @warningText, @warningBackground);
}
// Error
.control-group.error {
.formFieldState(@errorText, @errorText, @errorBackground);
}
// Success
.control-group.success {
.formFieldState(@successText, @successText, @successBackground);
}
// HTML5 invalid states
// Shares styles with the .control-group.error above
@ -242,15 +216,6 @@ select:focus:required:invalid {
// HELP TEXT
// ---------
.help-block {
color: lighten(@textColor, 15%); // lighten the text some for contrast
display: block; // account for any element using help-block
margin-bottom: @baseLineHeight / 2;
}
// INPUT GROUPS
// ------------
@ -266,7 +231,7 @@ select:focus:required:invalid {
margin-bottom: 0; // prevent bottom margin from screwing up alignment in stacked forms
font-size: @baseFontSize;
vertical-align: top;
border-radius: 0 @inputBorderRadius @inputBorderRadius 0;
border-radius: @inputBorderRadius;
// Make input on top when focused so blue border and shadow always show
&:focus {
z-index: 2;
@ -296,12 +261,6 @@ select:focus:required:invalid {
background-color: lighten(@green, 30);
border-color: @green;
}
}
.input-append {
input,
select {
border-radius: @inputBorderRadius 0 0 @inputBorderRadius;
}
.add-on:last-child,
.btn:last-child {
border-radius: 0 @inputBorderRadius @inputBorderRadius 0;
@ -359,11 +318,10 @@ legend + .control-group {
// Increase spacing between groups
.control-group {
margin-bottom: @baseLineHeight;
.clearfix();
}
// Float the labels left
.control-label {
float: left;
display: inline-block;
width: 140px;
padding-top: 5px;
text-align: right;
@ -372,11 +330,8 @@ legend + .control-group {
.controls {
// Super jank IE7 fix to ensure the inputs in .input-append and input-prepend
// don't inherit the margin of the parent, in this case .controls
margin-left: 160px;
}
// Remove bottom margin on block level help text since that's accounted for on .control-group
.help-block {
margin-top: @baseLineHeight / 2;
margin-bottom: 0;
display: inline-block;
margin-left: 20px;
vertical-align: top;
}
}

View file

@ -2,9 +2,5 @@
// Grid system
// --------------------------------------------------
// Fixed (940px)
#grid > .core(@gridColumnWidth, @gridGutterWidth);
// Fluid (940px)
#grid > .fluid(@fluidGridColumnWidth, @fluidGridGutterWidth);

View file

@ -10,15 +10,13 @@
// --------
// For clearing floats like a boss h5bp.com/q
.clearfix {
&:before,
&:after {
&::before,
&::after {
display: table;
content: "";
// Fixes Opera/contenteditable bug:
// http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
line-height: 0;
}
&:after {
clear: both;
}
}
@ -49,8 +47,7 @@
// Mixin for form field states
.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
// Set the text color
> label,
.help-block {
> label {
color: @textColor;
}
// Style inputs accordingly
@ -84,9 +81,7 @@
// 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
@ -101,119 +96,25 @@
}
.spanX (0) {}
.offsetX (@index) when (@index > 0) {
// (~".offset@{index}") { .offset(@index); }
.offset@{index} { .offset(@index); }
.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;
display: inline-block;
margin-left: @gridGutterWidth;
vertical-align: top;
}
// Set the container width
.container { .span(@gridColumns); }
// generate .spanX and .offsetX
.spanX (@gridColumns);
.offsetX (@gridColumns);
}
.fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
.spanX (@index) when (@index > 0) {
// (~".span@{index}") { .span(@index); }
.span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
.offsetX (@index) when (@index > 0) {
// (~'.offset@{index}') { .offset(@index); }
// (~'.offset@{index}:first-child') { .offsetFirstChild(@index); }
.offset@{index} { .offset(@index); }
.offset@{index}:first-child { .offsetFirstChild(@index); }
.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"] {
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
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) {
// (~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); }
input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index} { .span(@index); }
.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);
}
}

View file

@ -21,11 +21,6 @@
background-color: @grayLighter;
}
// Redeclare pull classes because of specifity
.nav > .pull-right {
float: right;
}
// TABS
@ -42,6 +37,7 @@
}
// Actual tabs (as links)
.nav-tabs > li > a {
color: #555;
padding-top: 8px 12px;
margin-right: 2px;
line-height: 14px; // keeps the overall height an even number
@ -64,65 +60,6 @@
}
// DROPDOWNS
// ---------
.nav-tabs .dropdown-menu {
border-radius: 0 0 6px 6px; // remove the top rounded corners here since there is a hard edge above the menu
}
// Default dropdown links
// -------------------------
// Make carets use linkColor to start
.nav .dropdown-toggle .caret {
border-top-color: @linkColor;
border-bottom-color: @linkColor;
margin-top: 6px;
}
.nav .dropdown-toggle:hover .caret {
border-top-color: @linkColorHover;
border-bottom-color: @linkColorHover;
}
/* move down carets for tabs */
.nav-tabs .dropdown-toggle .caret {
margin-top: 8px;
}
// Active dropdown links
// -------------------------
.nav .active .dropdown-toggle .caret {
border-top-color: #fff;
border-bottom-color: #fff;
}
.nav-tabs .active .dropdown-toggle .caret {
border-top-color: @gray;
border-bottom-color: @gray;
}
// Active:hover dropdown links
// -------------------------
.nav > .dropdown.active > a:hover {
cursor: pointer;
}
// Open dropdowns
// -------------------------
.nav-tabs .open .dropdown-toggle,
.nav > li.dropdown.open.active > a:hover {
color: @white;
background-color: @grayLight;
border-color: @grayLight;
}
.nav li.dropdown.open .caret,
.nav li.dropdown.open.active .caret,
.nav li.dropdown.open a:hover .caret {
border-top-color: @white;
border-bottom-color: @white;
opacity: 1;
}
// TABBABLE
// --------
@ -141,18 +78,3 @@
.tab-content > .active {
display: block;
}
// DISABLED STATES
// ---------------
// Gray out text
.nav > .disabled > a {
color: @grayLight;
}
// Nuke hover effects
.nav > .disabled > a:hover {
text-decoration: none;
background-color: transparent;
cursor: default;
}

View file

@ -37,8 +37,6 @@
vertical-align: bottom;
}
// Remove top border from thead by default
caption + thead tr:first-child th,
caption + thead tr:first-child td,
colgroup + thead tr:first-child th,
colgroup + thead tr:first-child td,
thead:first-child tr:first-child th,
@ -66,9 +64,6 @@
border-left: 1px solid @tableBorder;
}
// Prevent a double border
caption + thead tr:first-child th,
caption + tbody tr:first-child th,
caption + tbody tr:first-child td,
colgroup + thead tr:first-child th,
colgroup + tbody tr:first-child th,
colgroup + tbody tr:first-child td,
@ -99,14 +94,10 @@
}
// Special fixes to round the left border on the first td/th
caption + thead tr:first-child th:first-child,
caption + tbody tr:first-child td:first-child,
colgroup + thead tr:first-child th:first-child,
colgroup + tbody tr:first-child td:first-child {
border-radius: 4px 0 0 0;
}
caption + thead tr:first-child th:last-child,
caption + tbody tr:first-child td:last-child,
colgroup + thead tr:first-child th:last-child,
colgroup + tbody tr:first-child td:last-child {
border-radius: 0 4px 0 0;
@ -148,10 +139,8 @@
// -----------------
// Reset default grid behavior
table [class*=span],
.row-fluid table [class*=span] {
table [class*=span] {
display: table-cell;
float: none; // undo default grid column styles
margin-left: 0; // undo default grid column styles
}
@ -163,39 +152,6 @@ table {
.span4 { .tableColumns(4); }
.span5 { .tableColumns(5); }
.span6 { .tableColumns(6); }
.span7 { .tableColumns(7); }
.span8 { .tableColumns(8); }
.span9 { .tableColumns(9); }
.span10 { .tableColumns(10); }
.span11 { .tableColumns(11); }
.span12 { .tableColumns(12); }
.span13 { .tableColumns(13); }
.span14 { .tableColumns(14); }
.span15 { .tableColumns(15); }
.span16 { .tableColumns(16); }
.span17 { .tableColumns(17); }
.span18 { .tableColumns(18); }
.span19 { .tableColumns(19); }
.span20 { .tableColumns(20); }
.span21 { .tableColumns(21); }
.span22 { .tableColumns(22); }
.span23 { .tableColumns(23); }
.span24 { .tableColumns(24); }
}
// TABLE BACKGROUNDS
// -----------------
// Exact selectors below required to override .table-striped
.table {
tbody tr.success td {
background-color: @successBackground;
}
tbody tr.error td {
background-color: @errorBackground;
}
tbody tr.info td {
background-color: @infoBackground;
}
}

View file

@ -15,10 +15,10 @@ p {
// -------------------------
small {
font-size: 85%; // Ex: 14px base font * 85% = about 12px
font-size: 80%; // Ex: 14px base font * 85% = about 12px
}
strong {
font-weight: bold;
b, strong {
font-weight: bolder;
}
em {
font-style: italic;
@ -36,16 +36,8 @@ cite {
h1, h2, h3, h4, h5, h6 {
margin: (@baseLineHeight / 2) 0;
font-family: @headingsFontFamily;
font-weight: @headingsFontWeight;
line-height: 1;
color: @headingsColor;
text-rendering: optimizelegibility; // Fix the character spacing for headings
small {
font-weight: normal;
line-height: 1;
color: @grayLight;
}
}
h1 { font-size: 36px; line-height: 40px; }
h2 { font-size: 30px; line-height: 40px; }
@ -54,11 +46,6 @@ h4 { font-size: 18px; line-height: 20px; }
h5 { font-size: 14px; line-height: 20px; }
h6 { font-size: 12px; line-height: 20px; }
h1 small { font-size: 24px; }
h2 small { font-size: 18px; }
h3 small { font-size: 14px; }
h4 small { font-size: 14px; }
// Lists
// --------------------------------------------------
@ -77,26 +64,6 @@ ol ul {
li {
line-height: @baseLineHeight;
}
ul.unstyled,
ol.unstyled {
margin-left: 0;
list-style: none;
}
// Description Lists
dl {
margin-bottom: @baseLineHeight;
}
dt,
dd {
line-height: @baseLineHeight;
}
dt {
font-weight: bold;
}
dd {
margin-left: @baseLineHeight / 2;
}
// MISC
// ----
@ -107,16 +74,15 @@ hr {
border: 0;
border-top: 1px solid @hrBorder;
border-bottom: 1px solid @white;
box-sizing: content-box;
height: 0;
}
// Abbreviations and acronyms
abbr[title] {
cursor: help;
border-bottom: 1px dotted @grayLight;
}
abbr.initialism {
font-size: 90%;
text-transform: uppercase;
text-decoration: none;
}
// Blockquotes
@ -126,46 +92,15 @@ blockquote {
border-left: 5px solid @grayLighter;
p {
margin-bottom: 0;
font-size: 16px;
font-weight: 300;
line-height: @baseLineHeight * 1.25;
}
small {
display: block;
line-height: @baseLineHeight;
color: @grayLight;
&:before {
content: '\2014 \00A0';
}
}
// Float right with text-align: right
&.pull-right {
float: right;
padding-right: 15px;
padding-left: 0;
border-right: 5px solid @grayLighter;
border-left: 0;
p,
small {
text-align: right;
}
small {
&:before {
content: '';
}
&:after {
content: '\00A0 \2014';
}
}
}
}
// Quotes
q:before,
q:after,
blockquote:before,
blockquote:after {
q::before,
q::after,
blockquote::before,
blockquote::after {
content: "";
}

View file

@ -44,19 +44,8 @@
// Typography
// -------------------------
@sansFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;
@serifFontFamily: Georgia, "Times New Roman", Times, serif;
@monoFontFamily: Monaco, Menlo, Consolas, "Courier New", monospace;
@baseFontSize: 14px;
@baseFontFamily: @sansFontFamily;
@baseLineHeight: 20px;
@altFontFamily: @serifFontFamily;
@headingsFontFamily: inherit; // empty to use BS default, @baseFontFamily
@headingsFontWeight: bold; // instead of browser default, bold
@headingsColor: inherit; // empty to use BS default, @textColor
// Tables
// -------------------------