Quellcode durchsuchen

fixed var/setting names, changed isScrollbar -> themeScrollbars

telamonian vor 6 Jahren
Ursprung
Commit
e6982d6051

+ 17 - 16
packages/application/style/scrollbar.css

@@ -8,14 +8,14 @@
  */
 
 /* use standard opaque scrollbars for most nodes */
-div.jp-LabShell[data-theme-scrollbar='true'] {
+div.jp-LabShell[data-theme-scrollbars='true'] {
   scrollbar-color: rgb(var(--jp-scrollbar-thumb-color))
     var(--jp-scrollbar-background-color);
 }
 
 /* for code nodes, use a transparent style of scrollbar */
-[data-theme-scrollbar='true'] .CodeMirror-hscrollbar,
-[data-theme-scrollbar='true'] .CodeMirror-vscrollbar {
+[data-theme-scrollbars='true'] .CodeMirror-hscrollbar,
+[data-theme-scrollbars='true'] .CodeMirror-vscrollbar {
   scrollbar-color: rgba(var(--jp-scrollbar-thumb-color), 0.5) transparent;
 }
 
@@ -25,26 +25,26 @@ div.jp-LabShell[data-theme-scrollbar='true'] {
 
 /* use standard opaque scrollbars for most nodes */
 
-[data-theme-scrollbar='true'] ::-webkit-scrollbar,
-[data-theme-scrollbar='true'] ::-webkit-scrollbar-corner {
+[data-theme-scrollbars='true'] ::-webkit-scrollbar,
+[data-theme-scrollbars='true'] ::-webkit-scrollbar-corner {
   background: var(--jp-scrollbar-background-color);
 }
 
-[data-theme-scrollbar='true'] ::-webkit-scrollbar-thumb {
+[data-theme-scrollbars='true'] ::-webkit-scrollbar-thumb {
   background: rgb(var(--jp-scrollbar-thumb-color));
   border: var(--jp-scrollbar-thumb-margin) solid transparent;
   background-clip: content-box;
   border-radius: var(--jp-scrollbar-thumb-radius);
 }
 
-[data-theme-scrollbar='true'] ::-webkit-scrollbar-track:horizontal {
+[data-theme-scrollbars='true'] ::-webkit-scrollbar-track:horizontal {
   border-left: var(--jp-scrollbar-endpad) solid
     var(--jp-scrollbar-background-color);
   border-right: var(--jp-scrollbar-endpad) solid
     var(--jp-scrollbar-background-color);
 }
 
-[data-theme-scrollbar='true'] ::-webkit-scrollbar-track:vertical {
+[data-theme-scrollbars='true'] ::-webkit-scrollbar-track:vertical {
   border-top: var(--jp-scrollbar-endpad) solid
     var(--jp-scrollbar-background-color);
   border-bottom: var(--jp-scrollbar-endpad) solid
@@ -53,28 +53,29 @@ div.jp-LabShell[data-theme-scrollbar='true'] {
 
 /* for code nodes, use a transparent style of scrollbar */
 
-[data-theme-scrollbar='true'] .CodeMirror-hscrollbar::-webkit-scrollbar,
-[data-theme-scrollbar='true'] .CodeMirror-vscrollbar::-webkit-scrollbar,
-[data-theme-scrollbar='true'] .CodeMirror-hscrollbar::-webkit-scrollbar-corner,
-[data-theme-scrollbar='true'] .CodeMirror-vscrollbar::-webkit-scrollbar-corner {
+[data-theme-scrollbars='true'] .CodeMirror-hscrollbar::-webkit-scrollbar,
+[data-theme-scrollbars='true'] .CodeMirror-vscrollbar::-webkit-scrollbar,
+[data-theme-scrollbars='true'] .CodeMirror-hscrollbar::-webkit-scrollbar-corner,
+[data-theme-scrollbars='true']
+  .CodeMirror-vscrollbar::-webkit-scrollbar-corner {
   background-color: transparent;
 }
 
-[data-theme-scrollbar='true'] .CodeMirror-hscrollbar::-webkit-scrollbar-thumb,
-[data-theme-scrollbar='true'] .CodeMirror-vscrollbar::-webkit-scrollbar-thumb {
+[data-theme-scrollbars='true'] .CodeMirror-hscrollbar::-webkit-scrollbar-thumb,
+[data-theme-scrollbars='true'] .CodeMirror-vscrollbar::-webkit-scrollbar-thumb {
   background: rgba(var(--jp-scrollbar-thumb-color), 0.5);
   border: var(--jp-scrollbar-thumb-margin) solid transparent;
   background-clip: content-box;
   border-radius: var(--jp-scrollbar-thumb-radius);
 }
 
-[data-theme-scrollbar='true']
+[data-theme-scrollbars='true']
   .CodeMirror-hscrollbar::-webkit-scrollbar-track:horizontal {
   border-left: var(--jp-scrollbar-endpad) solid transparent;
   border-right: var(--jp-scrollbar-endpad) solid transparent;
 }
 
-[data-theme-scrollbar='true']
+[data-theme-scrollbars='true']
   .CodeMirror-vscrollbar::-webkit-scrollbar-track:vertical {
   border-top: var(--jp-scrollbar-endpad) solid transparent;
   border-bottom: var(--jp-scrollbar-endpad) solid transparent;

+ 1 - 1
packages/apputils-extension/schema/themes.json

@@ -10,7 +10,7 @@
       "description": "Application-level visual styling theme",
       "default": "JupyterLab Light"
     },
-    "theme-scrollbar": {
+    "theme-scrollbars": {
       "type": "boolean",
       "title": "Scrollbar Theming",
       "description": "Enable/disable styling of the application scrollbars",

+ 4 - 4
packages/apputils-extension/src/index.ts

@@ -150,11 +150,11 @@ const themes: JupyterFrontEndPlugin<IThemeManager> = {
       app.shell.dataset.themeLight = String(manager.isLight(currentTheme));
       app.shell.dataset.themeName = currentTheme;
       if (
-        app.shell.dataset.themeScrollbar !=
-        String(manager.isScrollbar(currentTheme))
+        app.shell.dataset.themeScrollbars !=
+        String(manager.themeScrollbars(currentTheme))
       ) {
-        app.shell.dataset.themeScrollbar = String(
-          manager.isScrollbar(currentTheme)
+        app.shell.dataset.themeScrollbars = String(
+          manager.themeScrollbars(currentTheme)
         );
       }
       commands.notifyCommandChanged(CommandIDs.changeTheme);

+ 5 - 5
packages/apputils/src/thememanager.ts

@@ -152,13 +152,13 @@ export class ThemeManager {
   }
 
   /**
-   * Test whether a given theme styles scrollbar,
+   * Test whether a given theme styles scrollbars,
    * and if the user has scrollbar styling enabled.
    */
-  isScrollbar(name: string): boolean {
+  themeScrollbars(name: string): boolean {
     return (
-      !!this._settings.composite['theme-scrollbar'] &&
-      !!this._themes[name].isScrollbar
+      !!this._settings.composite['theme-scrollbars'] &&
+      !!this._themes[name].themeScrollbars
     );
   }
 
@@ -357,7 +357,7 @@ export namespace ThemeManager {
      * Whether the theme includes styling for the scrollbar.
      * If set to false, this theme will leave the native scrollbar untouched.
      */
-    isScrollbar?: boolean;
+    themeScrollbars?: boolean;
 
     /**
      * Load the theme.

+ 1 - 1
packages/theme-dark-extension/src/index.ts

@@ -20,7 +20,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
     manager.register({
       name: 'JupyterLab Dark',
       isLight: false,
-      isScrollbar: true,
+      themeScrollbars: true,
       load: () => manager.loadCSS(style),
       unload: () => Promise.resolve(undefined)
     });

+ 1 - 1
packages/theme-light-extension/src/index.ts

@@ -20,7 +20,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
     manager.register({
       name: 'JupyterLab Light',
       isLight: true,
-      isScrollbar: false,
+      themeScrollbars: false,
       load: () => manager.loadCSS(style),
       unload: () => Promise.resolve(undefined)
     });