Sfoglia il codice sorgente

Merge pull request #717 from ellisonbg/less-is-more

Less is more
Afshin Darian 8 anni fa
parent
commit
af5608bdfd
42 ha cambiato i file con 183 aggiunte e 70 eliminazioni
  1. 2 0
      .gitignore
  2. 1 0
      examples/console/src/index.ts
  3. 1 0
      examples/filebrowser/src/index.ts
  4. 2 0
      examples/lab/index.js
  5. 1 0
      examples/notebook/src/index.ts
  6. 1 0
      examples/terminal/src/index.ts
  7. 2 0
      jupyterlab/index.js
  8. 7 3
      package.json
  9. 32 12
      src/basestyle/application.less
  10. 15 0
      src/basestyle/index.less
  11. 0 0
      src/basestyle/phosphor.less
  12. 0 0
      src/console/base.less
  13. 0 0
      src/default-theme/about.less
  14. 90 0
      src/default-theme/application.less
  15. 0 0
      src/default-theme/codemirror.less
  16. 0 0
      src/default-theme/commandpalette.less
  17. 0 0
      src/default-theme/completion.less
  18. 0 0
      src/default-theme/console.less
  19. 0 0
      src/default-theme/csvwidget.less
  20. 0 0
      src/default-theme/dialog.less
  21. 0 0
      src/default-theme/editorwidget.less
  22. 0 0
      src/default-theme/faq.less
  23. 0 0
      src/default-theme/filebrowser.less
  24. 0 0
      src/default-theme/help.less
  25. 0 0
      src/default-theme/images.less
  26. 0 0
      src/default-theme/imagewidget.less
  27. 0 38
      src/default-theme/index.css
  28. 29 0
      src/default-theme/index.less
  29. 0 0
      src/default-theme/inspector.less
  30. 0 0
      src/default-theme/landing.less
  31. 0 0
      src/default-theme/mainmenu.less
  32. 0 0
      src/default-theme/markdownwidget.less
  33. 0 0
      src/default-theme/notebook.less
  34. 0 0
      src/default-theme/rendermime.less
  35. 0 0
      src/default-theme/running.less
  36. 0 0
      src/default-theme/terminal.less
  37. 0 17
      src/default-theme/theme.css
  38. 0 0
      src/dialog/base.less
  39. 0 0
      src/filebrowser/base.less
  40. 0 0
      src/iframe/base.less
  41. 0 0
      src/notebook/base.less
  42. 0 0
      src/running/base.less

+ 2 - 0
.gitignore

@@ -33,6 +33,8 @@ coverage
 lib
 build
 docs
+src/basestyle/index.css
+src/default-theme/index.css
 
 .ipynb_checkpoints
 Unititled*

+ 1 - 0
examples/console/src/index.ts

@@ -42,6 +42,7 @@ import {
   Widget
 } from 'phosphor/lib/ui/widget';
 
+import 'jupyterlab/lib/basestyle/index.css';
 import 'jupyterlab/lib/default-theme/index.css';
 
 let TITLE = 'Console';

+ 1 - 0
examples/filebrowser/src/index.ts

@@ -49,6 +49,7 @@ import {
   Widget
 } from 'phosphor/lib/ui/widget';
 
+import 'jupyterlab/lib/basestyle/index.css';
 import 'jupyterlab/lib/default-theme/index.css';
 
 

+ 2 - 0
examples/lab/index.js

@@ -7,8 +7,10 @@ var JupyterLab = require('jupyterlab/lib/application').JupyterLab;
 require('es6-promise').polyfill();
 
 require('font-awesome/css/font-awesome.min.css');
+require('jupyterlab/lib/basestyle/index.css');
 require('jupyterlab/lib/default-theme/index.css');
 
+
 var lab = new JupyterLab();
 
 lab.registerPlugins([

+ 1 - 0
examples/notebook/src/index.ts

@@ -59,6 +59,7 @@ import {
   Widget
 } from 'phosphor/lib/ui/widget';
 
+import 'jupyterlab/lib/basestyle/index.css';
 import 'jupyterlab/lib/default-theme/index.css';
 
 

+ 1 - 0
examples/terminal/src/index.ts

@@ -17,6 +17,7 @@ import {
   Widget
 } from 'phosphor/lib/ui/widget';
 
+import 'jupyterlab/lib/basestyle/index.css';
 import 'jupyterlab/lib/default-theme/index.css';
 
 

+ 2 - 0
jupyterlab/index.js

@@ -8,6 +8,8 @@ require('es6-promise').polyfill();
 
 require('font-awesome/css/font-awesome.min.css');
 require('material-design-icons/iconfont/material-icons.css');
+
+require('jupyterlab/lib/basestyle/index.css');
 require('jupyterlab/lib/default-theme/index.css');
 
 var lab = new JupyterLab();

+ 7 - 3
package.json

@@ -15,6 +15,7 @@
     "jquery-ui": "^1.10.5 <1.12",
     "jupyter-js-services": "^0.18.0",
     "leaflet": "^0.7.7",
+    "less": "^2.7.1",
     "marked": "^0.3.5",
     "moment": "^2.11.2",
     "phosphor": "^0.6.1",
@@ -50,12 +51,15 @@
     "webpack": "^1.12.11"
   },
   "scripts": {
-    "build": "npm run build:src",
-    "build:all": "npm run build:src && npm run build:serverextension",
+    "build": "npm run build:css && npm run build:src",
+    "build:all": "npm run build:css && npm run build:src && npm run build:serverextension",
     "build:examples": "node scripts/buildexamples.js",
     "build:src": "tsc --project src && node scripts/copyfiles.js",
     "build:test": "tsc --project test/src && webpack --config test/webpack.conf.js",
-    "build:serverextension": "cd jupyterlab && npm run build && cd ..",
+    "build:serverextension": "npm run build:css && cd jupyterlab && npm run build && cd ..",
+    "build:css": "concurrently \"npm run build:css:base\" \"npm run build:css:theme\"",
+    "build:css:base": "lessc src/basestyle/index.less src/basestyle/index.css",
+    "build:css:theme": "lessc src/default-theme/index.less src/default-theme/index.css",
     "clean": "rimraf docs && rimraf lib && rimraf test/build && rimraf test/coverage",
     "clean:examples": "node scripts/cleanexamples.js",
     "docs": "typedoc --mode modules --module commonjs --excludeNotExported --target es5 --moduleResolution node --out docs/ src",

+ 32 - 12
src/default-theme/shell.css → src/basestyle/application.less

@@ -3,6 +3,25 @@
 | Distributed under the terms of the Modified BSD License.
 |----------------------------------------------------------------------------*/
 
+/*-----------------------------------------------------------------------------
+| General
+|----------------------------------------------------------------------------*/
+
+
+body {
+  margin: 0;
+  padding: 0;
+  background: white;
+  overflow: hidden;
+  font-family: sans-serif;
+}
+
+
+/*-----------------------------------------------------------------------------
+| Shell
+|----------------------------------------------------------------------------*/
+
+
 .jp-ApplicationShell {
   position: absolute;
   top: 0;
@@ -18,7 +37,7 @@
 
 
 #jp-top-panel {
-  border-bottom: 1px solid #BDBDBD;
+  border-bottom: 1px solid black;
   background: white;
   display: flex;
   min-height: 28px;
@@ -31,21 +50,22 @@
 
 
 #jp-right-stack {
-  border-left: 1px solid #BDBDBD;
+  border-left: 1px solid black;
 }
 
+
 #jp-left-stack {
-  border-right: 1px solid #BDBDBD;
+  border-right: 1px solid black;
 }
 
 
 #jp-main-dock-panel .p-TabBar-tab.jp-mod-current {
-  border-top: 1px solid #2196F3;
+  border-top: 1px solid black;
 }
 
 
 .jp-SideBar.p-TabBar {
-  color: #777777;
+  color: black;
   background: white;
   font-size: 14px;
   min-width: 36px;
@@ -56,12 +76,12 @@
 
 
 .jp-SideBar.p-TabBar.jp-mod-left {
-  border-right: 1px solid #BDBDBD;
+  border-right: 1px solid black;
 }
 
 
 .jp-SideBar.p-TabBar.jp-mod-right {
-  border-left: 1px solid #BDBDBD;
+  border-left: 1px solid black;
 }
 
 
@@ -103,21 +123,21 @@
 
 
 .jp-SideBar .p-TabBar-tab:hover:not(.p-mod-current) {
-  background: #FAFAFA;
+  background: white;
 }
 
 
 .jp-SideBar .p-TabBar-tab.p-mod-current {
-  color: #2196F3;
-  background: #FAFAFA;
+  color: black;
+  background: white;
 }
 
 
 .jp-SideBar.jp-mod-left .p-TabBar-tab {
-  border-left: 1px solid #BDBDBD;
+  border-left: 1px solid black;
 }
 
 
 .jp-SideBar.jp-mod-right .p-TabBar-tab {
-  border-right: 1px solid #BDBDBD;
+  border-right: 1px solid black;
 }

+ 15 - 0
src/basestyle/index.less

@@ -0,0 +1,15 @@
+/*-----------------------------------------------------------------------------
+| Copyright (c) Jupyter Development Team.
+| Distributed under the terms of the Modified BSD License.
+|----------------------------------------------------------------------------*/
+@import url('~phosphor/styles/base.css');
+
+@import './phosphor.less';
+@import './application.less';
+
+@import '../console/base.less';
+@import '../dialog/base.less';
+@import '../filebrowser/base.less';
+@import '../iframe/base.less';
+@import '../notebook/base.less';
+@import '../running/base.less';

+ 0 - 0
src/default-theme/phosphor.css → src/basestyle/phosphor.less


+ 0 - 0
src/console/base.css → src/console/base.less


+ 0 - 0
src/default-theme/about.css → src/default-theme/about.less


+ 90 - 0
src/default-theme/application.less

@@ -0,0 +1,90 @@
+/*-----------------------------------------------------------------------------
+| Copyright (c) Jupyter Development Team.
+| Distributed under the terms of the Modified BSD License.
+|----------------------------------------------------------------------------*/
+
+
+/*-----------------------------------------------------------------------------
+| General
+|----------------------------------------------------------------------------*/
+
+
+body {
+  margin: 0;
+  padding: 0;
+  background: #E0E0E0;
+  overflow: hidden;
+  font-family: sans-serif;
+}
+
+
+/*-----------------------------------------------------------------------------
+| Shell
+|----------------------------------------------------------------------------*/
+
+
+#jp-main-dock-panel {
+  padding: 8px;
+}
+
+
+#jp-top-panel {
+  border-bottom: 1px solid #BDBDBD;
+}
+
+
+#jp-right-stack {
+  border-left: 1px solid #BDBDBD;
+}
+
+
+#jp-left-stack {
+  border-right: 1px solid #BDBDBD;
+}
+
+
+#jp-main-dock-panel .p-TabBar-tab.jp-mod-current {
+  border-top: 1px solid #2196F3;
+}
+
+
+.jp-SideBar.p-TabBar {
+  color: #777777;
+  background: white;
+}
+
+
+.jp-SideBar.p-TabBar.jp-mod-left {
+  border-right: 1px solid #BDBDBD;
+}
+
+
+.jp-SideBar.p-TabBar.jp-mod-right {
+  border-left: 1px solid #BDBDBD;
+}
+
+
+.jp-SideBar .p-TabBar-tab {
+  background: white;
+}
+
+
+.jp-SideBar .p-TabBar-tab:hover:not(.p-mod-current) {
+  background: #FAFAFA;
+}
+
+
+.jp-SideBar .p-TabBar-tab.p-mod-current {
+  color: #2196F3;
+  background: #FAFAFA;
+}
+
+
+.jp-SideBar.jp-mod-left .p-TabBar-tab {
+  border-left: 1px solid #BDBDBD;
+}
+
+
+.jp-SideBar.jp-mod-right .p-TabBar-tab {
+  border-right: 1px solid #BDBDBD;
+}

+ 0 - 0
src/default-theme/codemirror.css → src/default-theme/codemirror.less


+ 0 - 0
src/default-theme/commandpalette.css → src/default-theme/commandpalette.less


+ 0 - 0
src/default-theme/completion.css → src/default-theme/completion.less


+ 0 - 0
src/default-theme/console.css → src/default-theme/console.less


+ 0 - 0
src/default-theme/csvwidget.css → src/default-theme/csvwidget.less


+ 0 - 0
src/default-theme/dialog.css → src/default-theme/dialog.less


+ 0 - 0
src/default-theme/editorwidget.css → src/default-theme/editorwidget.less


+ 0 - 0
src/default-theme/faq.css → src/default-theme/faq.less


+ 0 - 0
src/default-theme/filebrowser.css → src/default-theme/filebrowser.less


+ 0 - 0
src/default-theme/help.css → src/default-theme/help.less


+ 0 - 0
src/default-theme/images.css → src/default-theme/images.less


+ 0 - 0
src/default-theme/imagewidget.css → src/default-theme/imagewidget.less


+ 0 - 38
src/default-theme/index.css

@@ -1,38 +0,0 @@
-/*-----------------------------------------------------------------------------
-| Copyright (c) Jupyter Development Team.
-| Distributed under the terms of the Modified BSD License.
-|----------------------------------------------------------------------------*/
-@import url('~phosphor/styles/base.css');
-@import './phosphor.css';
-
-@import '../console/base.css';
-@import '../dialog/base.css';
-@import '../filebrowser/base.css';
-@import '../iframe/base.css';
-@import '../notebook/base.css';
-@import '../running/base.css';
-
-@import './theme.css';
-
-@import './about.css';
-@import './codemirror.css';
-@import './commandpalette.css';
-@import './completion.css';
-@import './console.css';
-@import './csvwidget.css';
-@import './dialog.css';
-@import './editorwidget.css';
-@import './faq.css';
-@import './filebrowser.css';
-@import './help.css';
-@import './images.css';
-@import './imagewidget.css';
-@import './inspector.css';
-@import './landing.css';
-@import './mainmenu.css';
-@import './markdownwidget.css';
-@import './notebook.css';
-@import './rendermime.css';
-@import './running.css';
-@import './shell.css';
-@import './terminal.css';

+ 29 - 0
src/default-theme/index.less

@@ -0,0 +1,29 @@
+/*-----------------------------------------------------------------------------
+| Copyright (c) Jupyter Development Team.
+| Distributed under the terms of the Modified BSD License.
+|----------------------------------------------------------------------------*/
+
+
+@import './application.less';
+
+@import './about.less';
+@import './codemirror.less';
+@import './commandpalette.less';
+@import './completion.less';
+@import './console.less';
+@import './csvwidget.less';
+@import './dialog.less';
+@import './editorwidget.less';
+@import './faq.less';
+@import './filebrowser.less';
+@import './help.less';
+@import './images.less';
+@import './imagewidget.less';
+@import './inspector.less';
+@import './landing.less';
+@import './mainmenu.less';
+@import './markdownwidget.less';
+@import './notebook.less';
+@import './rendermime.less';
+@import './running.less';
+@import './terminal.less';

+ 0 - 0
src/default-theme/inspector.css → src/default-theme/inspector.less


+ 0 - 0
src/default-theme/landing.css → src/default-theme/landing.less


+ 0 - 0
src/default-theme/mainmenu.css → src/default-theme/mainmenu.less


+ 0 - 0
src/default-theme/markdownwidget.css → src/default-theme/markdownwidget.less


+ 0 - 0
src/default-theme/notebook.css → src/default-theme/notebook.less


+ 0 - 0
src/default-theme/rendermime.css → src/default-theme/rendermime.less


+ 0 - 0
src/default-theme/running.css → src/default-theme/running.less


+ 0 - 0
src/default-theme/terminal.css → src/default-theme/terminal.less


+ 0 - 17
src/default-theme/theme.css

@@ -1,17 +0,0 @@
-/*-----------------------------------------------------------------------------
-| Copyright (c) Jupyter Development Team.
-| Distributed under the terms of the Modified BSD License.
-|----------------------------------------------------------------------------*/
-
-
-/*-----------------------------------------------------------------------------
-| General
-|----------------------------------------------------------------------------*/
-
-body {
-  margin: 0;
-  padding: 0;
-  background: #E0E0E0;
-  overflow: hidden;
-  font-family: sans-serif;
-}

+ 0 - 0
src/dialog/base.css → src/dialog/base.less


+ 0 - 0
src/filebrowser/base.css → src/filebrowser/base.less


+ 0 - 0
src/iframe/base.css → src/iframe/base.less


+ 0 - 0
src/notebook/base.css → src/notebook/base.less


+ 0 - 0
src/running/base.css → src/running/base.less