1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Rolled dark mode out to the editors

- Updated editor, and other area, styles to look okay in dark mode.
- Used tinyMCE theme generator to create dark mode theme.
- Updated tinymce to latest 4x version.
This commit is contained in:
Dan Brown
2020-04-11 15:48:08 +01:00
parent 067cb9c5b7
commit b0b28e7b5e
50 changed files with 5286 additions and 69 deletions

View File

@ -24,29 +24,29 @@
}
&.success {
border-left-color: $positive;
background-color: lighten($positive, 68%);
color: darken($positive, 16%);
@include lightDark(background-color, lighten($positive, 68%), darken($positive, 22%));
@include lightDark(color, darken($positive, 16%), lighten($positive, 5%));
}
&.success:before {
background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMzNzZjMzkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6Ii8+PC9zdmc+");
}
&.danger {
border-left-color: $negative;
background-color: lighten($negative, 56%);
color: darken($negative, 20%);
@include lightDark(background-color, lighten($negative, 56%), darken($negative, 30%));
@include lightDark(color, darken($negative, 20%), lighten($negative, 5%));
}
&.danger:before {
background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiOTE4MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0xNS43MyAzSDguMjdMMyA4LjI3djcuNDZMOC4yNyAyMWg3LjQ2TDIxIDE1LjczVjguMjdMMTUuNzMgM3pNMTIgMTcuM2MtLjcyIDAtMS4zLS41OC0xLjMtMS4zIDAtLjcyLjU4LTEuMyAxLjMtMS4zLjcyIDAgMS4zLjU4IDEuMyAxLjMgMCAuNzItLjU4IDEuMy0xLjMgMS4zem0xLTQuM2gtMlY3aDJ2NnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==");
}
&.info {
border-left-color: $info;
background-color: lighten($info, 50%);
color: darken($info, 20%);
@include lightDark(color, darken($info, 20%), lighten($info, 10%));
@include lightDark(background-color, lighten($info, 50%), darken($info, 35%));
}
&.warning {
border-left-color: $warning;
background-color: lighten($warning, 50%);
color: darken($warning, 20%);
@include lightDark(background-color, lighten($warning, 50%), darken($warning, 36%));
@include lightDark(color, darken($warning, 20%), $warning);
}
&.warning:before {
background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiNjUzMWMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEgMjFoMjJMMTIgMiAxIDIxem0xMi0zaC0ydi0yaDJ2MnptMC00aC0ydi00aDJ2NHoiLz48L3N2Zz4=");
@ -89,6 +89,8 @@
.card.drag-card {
border: 1px solid #DDD;
@include lightDark(border-color, #ddd, #000);
@include lightDark(background-color, #fff, #333);
border-radius: 4px;
display: flex;
padding: 0 0 0 ($-s + 28px);
@ -117,7 +119,7 @@
width: 100%;
}
.handle {
background-color: #EEE;
@include lightDark(background-color, #eee, #2d2d2d);
left: 0;
position: absolute;
top: 0;
@ -134,6 +136,7 @@
display: flex;
flex-direction: column;
border: 1px solid #ddd;
@include lightDark(border-color, #ddd, #000);
margin-bottom: $-l;
border-radius: 4px;
overflow: hidden;
@ -143,7 +146,7 @@
&:hover {
color: $text-dark;
text-decoration: none;
box-shadow: $bs-card;
@include lightDark(box-shadow, $bs-card, $bs-card-dark);
}
h2 {
width: 100%;
@ -218,19 +221,19 @@
font-size: 0.85em;
a, a:hover, a:active {
padding: 4px 8px;
color: #777;
@include lightDark(color, #777, #999);
transition: background-color ease-in-out 80ms;
text-decoration: none;
}
a:hover {
background-color: rgba(255, 255, 255, 0.7);
@include lightDark(background-color, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3));
}
svg {
fill: #888;
}
.tag-value {
border-inline-start: 1px solid #DDD;
background-color: rgba(255, 255, 255, 0.5);
@include lightDark(background-color, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2))
}
}

View File

@ -85,7 +85,9 @@ button {
font-size: 0.75rem;
line-height: 1.4em;
color: var(--color-primary);
fill: var(--color-primary);
@include whenDark {
color: #AAA;
}
&:active {
outline: 0;
}

View File

@ -7,6 +7,12 @@
}
.primary-background-light {
background-color: var(--color-primary-light);
@include whenDark {
background: #000;
.text-primary {
color: #AAA !important;
}
}
}
/*
@ -83,4 +89,10 @@
}
.bg-shelf {
background-color: var(--color-bookshelf);
}
}
.bg-shelf, .bg-book {
@include whenDark {
filter: brightness(67%) saturate(80%);
}
}

View File

@ -6,6 +6,7 @@
margin: $-xl;
padding: $-m $-l;
background-color: #FFF;
@include lightDark(background-color, #fff, #444);
border-radius: 4px;
border-inline-start: 6px solid currentColor;
box-shadow: $bs-large;
@ -33,12 +34,15 @@
margin-top: -8px;
svg {
height: 1.0rem;
color: #444;
@include lightDark(color, #444, #888);
}
}
span {
vertical-align: middle;
line-height: 1.3;
@include whenDark {
color: #BBB;
}
}
&.pos {
color: $positive;
@ -78,7 +82,7 @@
}
[overlay] {
background-color: rgba(0, 0, 0, 0.333);
@include lightDark(background-color, rgba(0, 0, 0, 0.333), rgba(0, 0, 0, 0.6));
position: fixed;
z-index: 95536;
width: 100%;
@ -99,7 +103,7 @@
}
.popup-body {
background-color: #FFF;
@include lightDark(background-color, #fff, #333);
max-height: 90%;
max-width: 1200px;
width: 90%;
@ -175,7 +179,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
.dropzone-container {
position: relative;
background-color: #EEE;
@include lightDark(background-color, #eee, #222);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23a9a9a9' fill-opacity='0.52' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
}
@ -188,7 +192,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
cursor: pointer;
width: (100%/6);
height: auto;
border: 1px solid #DDD;
@include lightDark(border-color, #ddd, #000);
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
transition: all cubic-bezier(.4, 0, 1, 1) 160ms;
overflow: hidden;
@ -230,7 +234,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
#image-manager .load-more {
display: block;
text-align: center;
background-color: #EEE;
@include lightDark(background-color, #EEE, #444);
padding: $-s $-m;
color: #AAA;
clear: both;
@ -244,6 +248,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
overflow-y: auto;
overflow-x: hidden;
border-inline-start: 1px solid #DDD;
@include lightDark(border-color, #ddd, #000);
.inner {
padding: $-m;
}
@ -265,6 +270,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
}
.dropzone-container {
border-bottom: 1px solid #DDD;
@include lightDark(border-color, #ddd, #000);
}
}
@ -577,10 +583,11 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
.tab-container .nav-tabs {
text-align: start;
border-bottom: 1px solid #DDD;
@include lightDark(border-color, #ddd, #444);
margin-bottom: $-m;
.tab-item {
padding: $-s;
color: #666;
@include lightDark(color, #666, #999);
&.selected {
border-bottom-width: 3px;
}
@ -592,8 +599,7 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
a, .tab-item {
padding: $-m;
display: inline-block;
color: #666;
fill: #666;
@include lightDark(color, #666, #999);
cursor: pointer;
&.selected {
border-bottom: 2px solid var(--color-primary);
@ -628,9 +634,10 @@ body.flexbox-support #entity-selector-wrap .popup-body .form-group {
}
.comment-box {
border: 1px solid #DDD;
border-radius: 4px;
background-color: #FFF;
border: 1px solid #DDD;
@include lightDark(border-color, #ddd, #000);
@include lightDark(background-color, #FFF, #222);
.content {
font-size: 0.666em;
p, ul, ol {

View File

@ -63,6 +63,7 @@
display: flex;
flex-direction: column;
border: 1px solid #DDD;
@include lightDark(border-color, #ddd, #000);
width: 50%;
max-width: 50%;
}
@ -112,17 +113,24 @@
}
.markdown-editor-display {
background-color: #FFFFFF;
background-color: #fff;
body {
background-color: #FFFFFF;
background-color: #fff;
padding-inline-start: 16px;
pmargin-inline-end: 16px;
margin-inline-end: 16px;
}
[drawio-diagram]:hover {
outline: 2px solid var(--color-primary);
}
}
html.markdown-editor-display.dark-mode {
background-color: #222;
body {
background-color: #222;
}
}
.editor-toolbar {
width: 100%;
padding: $-xs $-m;
@ -130,12 +138,19 @@
line-height: 1.6;
border-bottom: 1px solid #DDD;
background-color: #EEE;
@include lightDark(background-color, #eee, #111);
@include lightDark(border-color, #ddd, #000);
flex: none;
&:after {
content: '';
display: block;
clear: both;
}
@include whenDark {
button {
color: #AAA;
}
}
}
@ -334,6 +349,7 @@ input[type=color] {
.title-input.page-title {
font-size: 0.8em;
@include lightDark(background-color, #fff, #333);
.input {
border: 0;
margin-bottom: -1px;
@ -360,6 +376,7 @@ input[type=color] {
div[editor-type="markdown"] .title-input.page-title input[type="text"] {
max-width: 100%;
border-radius: 0;
}
.search-box {

View File

@ -494,8 +494,7 @@ ul.pagination {
}
.svg-icon {
color: #FFF;
fill: #FFF;
@include lightDark(color, #fff, rgba(255, 255, 255, 0.6));
font-size: 1.66rem;
margin-inline-end: 0;
position: absolute;
@ -626,8 +625,7 @@ ul.pagination {
.featured-image-container-wrap {
position: relative;
.svg-icon {
color: #FFF;
fill: #FFF;
@include lightDark(color, #fff, rgba(255, 255, 255, 0.6));
font-size: 2rem;
margin-inline-end: 0;
position: absolute;

View File

@ -3,7 +3,6 @@
flex-direction: column;
align-items: stretch;
overflow: hidden;
background-color: #FFF;
.edit-area {
flex: 1;
@ -223,8 +222,9 @@ body.mce-fullscreen, body.markdown-fullscreen {
// Attribute form
.floating-toolbox {
background-color: #FFF;
border: 1px solid #DDD;
@include lightDark(background-color, #fff, #222);
@include lightDark(border-color, #DDD, #000);
right: $-xl*2;
width: 48px;
overflow: hidden;
@ -256,15 +256,16 @@ body.mce-fullscreen, body.markdown-fullscreen {
.tabs {
display: block;
border-inline-end: 1px solid #DDD;
@include lightDark(border-color, #ddd, #000);
width: 48px;
flex: 0 1 auto;
}
.tabs svg {
fill: rgba(0, 0, 0, 0.5);
padding: 0;
margin: 0;
}
.tabs > button {
@include lightDark(color, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.5));
display: block;
cursor: pointer;
padding: $-s $-m;
@ -273,7 +274,7 @@ body.mce-fullscreen, body.markdown-fullscreen {
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
&.open .tabs > button.active {
fill: #444;
@include lightDark(color, #444, #EEE);
background-color: rgba(0, 0, 0, 0.1);
}
div[toolbox-tab-content] {
@ -281,7 +282,7 @@ body.mce-fullscreen, body.markdown-fullscreen {
display: flex;
flex: 1;
flex-direction: column;
min-height: 0px;
min-height: 0;
overflow-y: scroll;
}
h4 {

View File

@ -2,7 +2,7 @@ table {
min-width: 100px;
max-width: 100%;
thead {
background-color: #F8F8F8;
@include lightDark(background-color, #f8f8f8, #333);
font-weight: 500;
}
td, th {

View File

@ -204,7 +204,7 @@ blockquote {
display: block;
position: relative;
border-left: 4px solid var(--color-primary);
background-color: #F8F8F8;
@include lightDark(background-color, #f8f8f8, #333);
padding: $-s $-m $-s $-xl;
&:before {
content: "\201C";

View File

@ -10,10 +10,10 @@
.mce-tinymce {
.mce-panel {
background-color: #FFF;
@include lightDark(background-color, #fff, #333);
}
.mce-btn {
background-color: #FFF;
@include lightDark(background-color, #fff, #333);
}
}

View File

@ -67,4 +67,5 @@ $bs-dark: 0 0 4px 1px rgba(0, 0, 0, 0.5);
$bs-med: 0 1px 3px 1px rgba(76, 76, 76, 0.26);
$bs-large: 0 1px 6px 1px rgba(22, 22, 22, 0.2);
$bs-card: 0 1px 6px -1px rgba(0, 0, 0, 0.1);
$bs-card-dark: 0 1px 6px -1px rgba(0, 0, 0, 0.5);
$bs-hover: 0 2px 2px 1px rgba(0,0,0,.13);

View File

@ -36,7 +36,7 @@ body.dragging, body.dragging * {
// User Avatar Images
.avatar {
border-radius: 100%;
background-color: #EEE;
@include lightDark(background-color, #eee, #000);
width: 30px;
height: 30px;
&.med {
@ -137,7 +137,7 @@ $btt-size: 40px;
display: flex;
input, button {
border-radius: 0;
border: 1px solid #DDD;
@include lightDark(border-color, #ddd, #000);
margin-inline-start: -1px;
}
input {
@ -257,12 +257,13 @@ $btt-size: 40px;
grid-template-columns: minmax(120px, max-content) 40px;
font-size: 0.9rem;
border: 2px solid #DDD;
@include lightDark(border-color, #ddd, #444);
border-radius: 4px;
}
.list-sort-label {
font-weight: bold;
display: inline-block;
color: #555;
@include lightDark(color, #555, #888);
}
.list-sort-type {
text-align: start;
@ -273,7 +274,8 @@ $btt-size: 40px;
}
.list-sort-dir {
border-inline-start: 2px solid #DDD;
fill: #888;
color: #888;
@include lightDark(border-color, #ddd, #444);
.svg-icon {
transition: transform ease-in-out 120ms;
}