1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Cleaned some form styling

Removed uppercasing of labels to make a little friendlier.
Extracted out toggleswitch JS into own component.
Improved basic code input for html-head-input area.
This commit is contained in:
Dan Brown
2018-03-18 15:13:46 +00:00
parent 2c8d7da885
commit ecdeb545e0
6 changed files with 31 additions and 16 deletions

View File

@@ -16,6 +16,7 @@ let componentMapping = {
'editor-toolbox': require('./editor-toolbox'),
'image-picker': require('./image-picker'),
'collapsible': require('./collapsible'),
'toggle-switch': require('./toggle-switch'),
};
window.components = {};

View File

@@ -0,0 +1,19 @@
class ToggleSwitch {
constructor(elem) {
this.elem = elem;
this.input = elem.querySelector('input');
this.elem.onclick = this.onClick.bind(this);
}
onClick(event) {
let checked = this.input.value !== 'true';
this.input.value = checked ? 'true' : 'false';
checked ? this.elem.classList.add('active') : this.elem.classList.remove('active');
}
}
module.exports = ToggleSwitch;

View File

@@ -98,7 +98,6 @@ label {
font-size: 0.94em;
font-weight: 400;
color: #999;
text-transform: uppercase;
padding-bottom: 2px;
margin-bottom: 0.2em;
&.inline {
@@ -192,6 +191,13 @@ input:checked + .toggle-switch {
}
}
.simple-code-input {
background-color: #F8F8F8;
font-family: monospace;
font-size: 12px;
min-height: 100px;
}
.form-group {
.text-pos, .text-neg {
padding: $-xs 0;