Skip to content

Commit

Permalink
colibris: introduce skin variants, in order to customize the rendering
Browse files Browse the repository at this point in the history
This provide a nice way to change the colors of main containers from settings file. See comment inside settings for how it works
  • Loading branch information
seballot authored and muxator committed Apr 19, 2020
1 parent 913d5fd commit 709e5d2
Show file tree
Hide file tree
Showing 13 changed files with 418 additions and 20 deletions.
24 changes: 24 additions & 0 deletions settings.json.docker
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,30 @@
*/
"skinName": "${SKIN_NAME:colibris}",

/*
* Skin Variants
*
* For the colibris skin only, you can choose how to render the three main
* containers:
* - toolbar (top menu with icons)
* - editor (containing the text of the pad)
* - background (area outside of editor, mostly visible when using page style)
*
* For each of the 3 containers you can choose 4 color combinations:
* super-light, light, dark, super-dark.
*
* For example, to make the toolbar dark, you will include "dark-toolbar" into
* skinVariants.
*
* You can provide multiple skin variants separated by spaces. Default
* skinVariant is "super-light-toolbar super-light-editor light-background".
*
* For the editor container, you can also make it full width by adding
* "full-width-editor" variant (by default editor is rendered as a page, with
* a max-width of 900px).
*/
"skinVariants": "super-light-toolbar super-light-editor light-background",

/*
* IP and port which Etherpad should bind at.
*
Expand Down
24 changes: 24 additions & 0 deletions settings.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,30 @@
*/
"skinName": "colibris",

/*
* Skin Variants
*
* For the colibris skin only, you can choose how to render the three main
* containers:
* - toolbar (top menu with icons)
* - editor (containing the text of the pad)
* - background (area outside of editor, mostly visible when using page style)
*
* For each of the 3 containers you can choose 4 color combinations:
* super-light, light, dark, super-dark.
*
* For example, to make the toolbar dark, you will include "dark-toolbar" into
* skinVariants.
*
* You can provide multiple skin variants separated by spaces. Default
* skinVariant is "super-light-toolbar super-light-editor light-background".
*
* For the editor container, you can also make it full width by adding
* "full-width-editor" variant (by default editor is rendered as a page, with
* a max-width of 900px).
*/
"skinVariants": "super-light-toolbar super-light-editor light-background",

/*
* IP and port which Etherpad should bind at.
*
Expand Down
1 change: 1 addition & 0 deletions src/node/handler/PadMessageHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,7 @@ async function handleClientReady(client, message)
// mile wide...
var clientVars = {
"skinName": settings.skinName,
"skinVariants": settings.skinVariants,
"accountPrivs": {
"maxRevisions": 100
},
Expand Down
2 changes: 2 additions & 0 deletions src/node/utils/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ exports.faviconTimeslider = "../../" + exports.favicon;
*/
exports.skinName = null;

exports.skinVariants = "super-light-toolbar super-light-editor light-background";

/**
* The IP ep-lite should listen to
*/
Expand Down
4 changes: 2 additions & 2 deletions src/static/js/ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function Ace2Editor()
var iframeHTML = [];

iframeHTML.push(doctype);
iframeHTML.push("<html class='inner-editor'><head>");
iframeHTML.push("<html class='inner-editor " + clientVars.skinVariants + "'><head>");

// calls to these functions ($$INCLUDE_...) are replaced when this file is processed
// and compressed, putting the compressed code from the named file directly into the
Expand Down Expand Up @@ -316,7 +316,7 @@ window.onload = function () {\n\
}, 0);\n\
}';

var outerHTML = [doctype, '<html class="inner-editor outerdoc"><head>']
var outerHTML = [doctype, '<html class="inner-editor outerdoc ' + clientVars.skinVariants + '"><head>']

var includedCSS = [];
var $$INCLUDE_CSS = function(filename) {includedCSS.push(filename)};
Expand Down
26 changes: 17 additions & 9 deletions src/static/skins/colibris/pad.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
@import url("src/plugins/tables2.css");
@import url("src/plugins/author_hover.css");

@import url("src/pad-variants.css");

html {
font-size: 15px;
}
Expand All @@ -30,18 +32,24 @@ html {
*/

:root {
--dark-color: #374256;
--dark-soft-color: #576273;
--super-dark-color: #374256;
--dark-color: #576273; /*#4d5d77*/
--dark-soft-color: #6d7684; /*#606978;*/

--primary-color: #64d29b;
--middle-color: #d2d2d2; /* between light-soft-color and dark-soft-color, use for border for examples */
--light-soft-color: #f2f3f4; /*#f9f9f9;*/
--light-color: white;

--text-color: var(--dark-color);
--text-soft-color: var(--dark-soft-color);
--light-soft-color: #d8dade;
--light-color: #f2f3f4; /*#f9f9f9;*/
--super-light-color: white;
}

html {
--text-color: var(--super-dark-color);
--text-soft-color: var(--dark-color);
--border-color: var(--middle-color);
--bg-soft-color: var(--light-soft-color);
--bg-color: var(--light-color);
--bg-soft-color: var(--light-color);
--bg-color: var(--super-light-color);

--main-font-family: Quicksand, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}
Expand All @@ -60,5 +68,5 @@ h1 {

/* BACKGROUND COLOR */
#editorcontainerbox {
background-color: var(--bg-soft-color);
background-color: #f2f3f4; /* default */
}
6 changes: 5 additions & 1 deletion src/static/skins/colibris/src/components/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#chatbox.stickyChat {
border: none;
background-color: var(--bg-soft-color);
}

#chatbox.stickyChat.chatAndUsersChat{
Expand All @@ -36,6 +37,8 @@

#chattext {
border-bottom: 1px solid var(--border-color);
background-color: var(--bg-color);
color: var(--text-color);
}

.plugin-ep_author_neat #chattext {
Expand All @@ -60,9 +63,10 @@
}

#chaticon {
box-shadow: 0 0 0 1px rgba(99, 114, 130, 0.16), 0 8px 16px rgba(27, 39, 51, 0.08);
border: none;
padding: 10px 20px;
background-color: var(--bg-soft-color);
color: var(--text-color);
right: 30px;
}

Expand Down
8 changes: 4 additions & 4 deletions src/static/skins/colibris/src/components/scrollbars.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
}

.thin-scrollbar::-webkit-scrollbar-track {
background-color: var(--bg-soft-color);
background-color: var(--scrollbar-track);
border-radius: 10px;
border: 5px solid var(--bg-color);
border: 5px solid var(--scrollbar-bg);
}

.thin-scrollbar::-webkit-scrollbar {
Expand All @@ -28,6 +28,6 @@

.thin-scrollbar::-webkit-scrollbar-thumb {
border-radius: 7px;
background-color: var(--border-color);
border: 5px solid var(--bg-color);
background-color: var(--scrollbar-thumb);
border: 5px solid var(--scrollbar-bg);
}
1 change: 1 addition & 0 deletions src/static/skins/colibris/src/components/users.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ table#otheruserstable {
height: 250px;
border-left: none;
transition: none;
border-bottom-color: var(--border-color)
}
.popup#users.chatAndUsers #mycolorpicker.popup {
right: calc(100% + 30px);
Expand Down
3 changes: 2 additions & 1 deletion src/static/skins/colibris/src/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
box-shadow: 0 0 0 0.5px rgba(209, 209, 209, 0.32), 0 0 7pt 0pt rgba(204, 204, 204, 0.52);
border: 0;
border-radius: 5px;
background-color: white;
background-color: var(--bg-color);
color: var(--text-color);
}
#sidediv {
padding-top: 55px; /* = #innerdocbody iframe padding-top */
Expand Down
6 changes: 4 additions & 2 deletions src/static/skins/colibris/src/pad-editor.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#innerdocbody, #innerdocbody {
#innerdocbody {
font-size: 15px;
line-height: 25px;
padding: 0;
background: transparent;
color: var(--text-color);
}

#innerdocbody span, #innerdocbody span {
Expand All @@ -26,5 +28,5 @@ option {
}

#innerdocbody a {
color: #3f51b5;
color: var(--primary-color);
}
Loading

0 comments on commit 709e5d2

Please sign in to comment.