Ver Fonte

Merge pull request #8385 from weseek/support/137874-customtheme-island

support: New Island
Yuki Takei há 2 anos atrás
pai
commit
e9d9342579

+ 201 - 161
packages/preset-themes/src/styles/island.scss

@@ -1,170 +1,210 @@
-@use '@growi/core/scss/bootstrap/init' as bs;
-
-@use './variables' as var;
-@use './theme/mixins/page-editor-mode-manager';
-@use './atoms/mixins/buttons' as mixins-buttons;
-@use './theme/hsl-functions' as hsl;
-
-//== Light Mode
-//
-:root[data-bs-theme='light'] {
-  --primary: hsl(var(--primary-hs),var(--primary-l)) !important;
-  --primary-hs: 171,33%;
-  --primary-l: 69%;
-  --secondary: hsl(var(--secondary-hs),var(--secondary-l)) !important;
-  --secondary-hs: 208,7%;
-  --secondary-l: 46%;
-
-  // Background colors
-  --bgcolor-global: hsl(var(--bgcolor-global-hs),var(--bgcolor-global-l));
-  --bgcolor-global-hs: 170,43%;
-  --bgcolor-global-l: 90%;
-  --bgcolor-card: #{bs.$gray-100};
-  --bgcolor-inline-code: #{bs.$gray-100}; //optional
-  --bgcolor-blinked-section: #{hsl.alpha(var(--primary), 30%)};
-  //--bgcolor-keyword-highlighted: #{$grw-marker-yellow};
-
-  // Font colors
-  --color-global: hsl(var(--color-global-hs),var(--color-global-l));
-  --color-global-hs: 214,60%;
-  --color-global-l: 17%;
-  --color-reversal: #eeeeee;
-  // --color-header: #2b2b2b;
-  --color-link: hsl(var(--color-link-hs),var(--color-link-l));
-  --color-link-hs: 186,31%;
-  --color-link-l: 34%;
-  --color-link-hover: #{hsl.lighten(var(--color-link), 20%)};
-  --color-link-wiki: var(--color-link);
-  --color-link-wiki-hs: var(--color-link-hs);
-  --color-link-wiki-l: var(--color-link-l);
-  --color-link-wiki-hover: #{hsl.lighten(var(--color-link), 20%)};
-  --color-link-nabvar: var(--color-reversal);
-  --color-inline-code: #c7254e; // optional
-
-  // List Group colors
-  // --color-list: var(--color-global);
-  // --bgcolor-list: var(--bgcolor-global);
-  // --color-list-hover: ;
-  --bgcolor-list-hover: #{hsl.darken(var(--bgcolor-global),10%)};
-  --color-list-active: var(--color-global);
-  --bgcolor-list-active: var(--primary);
-
-  // Table colors
-  // --color-table: #; // optional
-  // --bgcolor-table: #; // optional
-  --border-color-table: var(--primary); // optional
-  // --color-table-hover: #; // optional
-  // --bgcolor-table-hover: #; // optional
-
-  // Navbar
-  --bgcolor-navbar: hsl(var(--bgcolor-navbar-hs),var(--bgcolor-navbar-l));
-  --bgcolor-navbar-hs: 0,2%;
-  --bgcolor-navbar-l: 18%;
-  --bgcolor-search-top-dropdown: var(--primary);
-  --bgcolor-search-top-dropdown-hs: var(--primary-hs);
-  --bgcolor-search-top-dropdown-l: var(--primary-l);
-  --border-image-navbar: linear-gradient(to right, #5ce4ef 0%, #5953eb 100%);
-
-  // Logo colors
-  --bgcolor-logo: #0d3955;
-  --fillcolor-logo-mark: #{lighten(desaturate(bs.$gray-100, 10%), 15%)};
-
-  // Sidebar
-  --bgcolor-sidebar: hsl(var(--bgcolor-sidebar-hs),var(--bgcolor-sidebar-l));
-  --bgcolor-sidebar-hs: 203,73%;
-  --bgcolor-sidebar-l: 19%;
-  --bgcolor-sidebar-nav-item-active: rgba(black, 0.37);
-  // --bgcolor-sidebar-nav-item-active: rgba(#969494, 0.3); // optional
-  --text-shadow-sidebar-nav-item-active: 0px 0px 10px #0099ff; // optional
-
-  // Sidebar resize button
-  --color-resize-button: white;
-  --bgcolor-resize-button: var(--primary);
-  --bgcolor-resize-button-hs: var(--primary-hs);
-  --bgcolor-resize-button-l: var(--primary-l);
-  --color-resize-button-hover: white;
-  --bgcolor-resize-button-hover: #{hsl.darken(var(--primary),5%)};
-
-  // Sidebar contents
-  --bgcolor-sidebar-context: hsl(var(--bgcolor-sidebar-context-hs),var(--bgcolor-sidebar-context-l));
-  --bgcolor-sidebar-context-hs: 173,41%;
-  --bgcolor-sidebar-context-l: 92%;
-  --color-sidebar-context: var(--color-link);
-  --color-sidebar-context-hs: var(--color-link-hs);
-  --color-sidebar-context-l: var(--color-link-l);
-
-  // Sidebar list group
-  --bgcolor-sidebar-list-group: #eff8f7; // optional
-
-  // Subnavigation
-  --bgcolor-subnav: hsl(var(--bgcolor-subnav-hs),var(--bgcolor-subnav-l));
-  --bgcolor-subnav-hs: var(--bgcolor-global-hs);
-  --bgcolor-subnav-l: calc(var(--bgcolor-global-l) + 4%);
-
-  // Tabs
-  --bordercolor-nav-tabs: #{bs.$gray-300}; // optional
-
-  // Icon colors
-  --color-editor-icons: var(--color-global);
-
-  // Border colors
-  --border-color-theme: #{bs.$gray-300};
-  --bordercolor-inline-code: #ccc8c8; // optional
-
-  // Dropdown colors
-  --bgcolor-dropdown-link-active: #{var.$growi-blue};
-
-  // admin theme box
-  --color-theme-color-box: #{hsl.darken(var(--primary), 15%)};
+:root[data-bs-theme] {
+  @import '@growi/core/scss/bootstrap/init-stage-1';
+  @import '@growi/core/scss/bootstrap/theming/variables';
+  @import '@growi/core/scss/bootstrap/theming/utils/color-palette';
 
-  &, body {
-    background-image: url('../images/island/island.png');
-    background-attachment: fixed;
-  }
+  $primary: #00A2B7;
+  $highlight: #C6AB62;
 
-  .rbt-menu {
-    background: #{hsl.darken(var(--bgcolor-global), 5%)};
-  }
+  @include generate-color-palette('primary', $primary, black, white);
+  @include generate-color-palette('highlight', $highlight, black, white);
 
-  .page-editor-preview-container {
-    background-image: url('../images/island/island.png');
-    background-attachment: fixed;
-  }
+  $body-color:                mix(#00A2B7, black, 40%);
+  $body-bg:                   white;
 
-  // login page
-  .nologin {
-    background-image: unset !important;
-  }
+  $body-secondary-color:      rgba($body-color, .75);
+  $body-secondary-bg:         $gray-200;
 
-  // Button
-  .btn-group.grw-page-editor-mode-manager {
-    .btn.btn-outline-primary {
-      @include page-editor-mode-manager.btn-page-editor-mode-manager(#{hsl.darken(var(--primary), 50%)}, #{hsl.lighten(var(--primary), 5%)}, #{hsl.darken(var(--primary), 5%)});
-    }
-  }
+  $body-tertiary-color:       rgba($body-color, .5);
+  $body-tertiary-bg:          $gray-100;
 
-  // Cards
-  .admin-bot-card {
-    .grw-botcard-title-active {
-      color: var(--color-reversal);
-    }
-  }
+  $border-color:              $gray-300;
 
-  /*
-   * GROWI Sidebar
-  */
-  .grw-sidebar {
-    // Pagetree
-    .grw-pagetree {
-      .grw-pagetree-triangle-btn {
-        @include mixins-buttons.button-outline-svg-icon-variant(bs.$gray-400, #0d3955);
-      }
-    }
-    // Foldertree
-    .grw-foldertree {
-      .grw-foldertree-triangle-btn {
-        @include mixins-buttons.button-outline-svg-icon-variant(bs.$gray-400, var(--bgcolor-sidebar));
-      }
-    }
+  $link-color:                $gray-800;
+
+  @import 'bootstrap/scss/variables';
+  @import 'bootstrap/scss/variables-dark';
+
+  @import '@growi/core/scss/bootstrap/init-stage-2';
+
+  @import '@growi/core/scss/bootstrap/theming/apply-light';
+
+  --grw-wiki-link-color-rgb: var(--grw-primary-600-rgb);
+  --grw-wiki-link-hover-color-rgb: var(--grw-primary-700-rgb);
+
+  &, body {
+    background: linear-gradient(to bottom, white 20%, #D8F9FD);
+    background-attachment: fixed;
   }
 }
+
+// @use '@growi/core/scss/bootstrap/init' as bs;
+
+// @use './variables' as var;
+// @use './theme/mixins/page-editor-mode-manager';
+// @use './atoms/mixins/buttons' as mixins-buttons;
+// @use './theme/hsl-functions' as hsl;
+
+// //== Light Mode
+// //
+// :root[data-bs-theme='light'] {
+//   --primary: hsl(var(--primary-hs),var(--primary-l)) !important;
+//   --primary-hs: 171,33%;
+//   --primary-l: 69%;
+//   --secondary: hsl(var(--secondary-hs),var(--secondary-l)) !important;
+//   --secondary-hs: 208,7%;
+//   --secondary-l: 46%;
+
+//   // Background colors
+//   --bgcolor-global: hsl(var(--bgcolor-global-hs),var(--bgcolor-global-l));
+//   --bgcolor-global-hs: 170,43%;
+//   --bgcolor-global-l: 90%;
+//   --bgcolor-card: #{bs.$gray-100};
+//   --bgcolor-inline-code: #{bs.$gray-100}; //optional
+//   --bgcolor-blinked-section: #{hsl.alpha(var(--primary), 30%)};
+//   //--bgcolor-keyword-highlighted: #{$grw-marker-yellow};
+
+//   // Font colors
+//   --color-global: hsl(var(--color-global-hs),var(--color-global-l));
+//   --color-global-hs: 214,60%;
+//   --color-global-l: 17%;
+//   --color-reversal: #eeeeee;
+//   // --color-header: #2b2b2b;
+//   --color-link: hsl(var(--color-link-hs),var(--color-link-l));
+//   --color-link-hs: 186,31%;
+//   --color-link-l: 34%;
+//   --color-link-hover: #{hsl.lighten(var(--color-link), 20%)};
+//   --color-link-wiki: var(--color-link);
+//   --color-link-wiki-hs: var(--color-link-hs);
+//   --color-link-wiki-l: var(--color-link-l);
+//   --color-link-wiki-hover: #{hsl.lighten(var(--color-link), 20%)};
+//   --color-link-nabvar: var(--color-reversal);
+//   --color-inline-code: #c7254e; // optional
+
+//   // List Group colors
+//   // --color-list: var(--color-global);
+//   // --bgcolor-list: var(--bgcolor-global);
+//   // --color-list-hover: ;
+//   --bgcolor-list-hover: #{hsl.darken(var(--bgcolor-global),10%)};
+//   --color-list-active: var(--color-global);
+//   --bgcolor-list-active: var(--primary);
+
+//   // Table colors
+//   // --color-table: #; // optional
+//   // --bgcolor-table: #; // optional
+//   --border-color-table: var(--primary); // optional
+//   // --color-table-hover: #; // optional
+//   // --bgcolor-table-hover: #; // optional
+
+//   // Navbar
+//   --bgcolor-navbar: hsl(var(--bgcolor-navbar-hs),var(--bgcolor-navbar-l));
+//   --bgcolor-navbar-hs: 0,2%;
+//   --bgcolor-navbar-l: 18%;
+//   --bgcolor-search-top-dropdown: var(--primary);
+//   --bgcolor-search-top-dropdown-hs: var(--primary-hs);
+//   --bgcolor-search-top-dropdown-l: var(--primary-l);
+//   --border-image-navbar: linear-gradient(to right, #5ce4ef 0%, #5953eb 100%);
+
+//   // Logo colors
+//   --bgcolor-logo: #0d3955;
+//   --fillcolor-logo-mark: #{lighten(desaturate(bs.$gray-100, 10%), 15%)};
+
+//   // Sidebar
+//   --bgcolor-sidebar: hsl(var(--bgcolor-sidebar-hs),var(--bgcolor-sidebar-l));
+//   --bgcolor-sidebar-hs: 203,73%;
+//   --bgcolor-sidebar-l: 19%;
+//   --bgcolor-sidebar-nav-item-active: rgba(black, 0.37);
+//   // --bgcolor-sidebar-nav-item-active: rgba(#969494, 0.3); // optional
+//   --text-shadow-sidebar-nav-item-active: 0px 0px 10px #0099ff; // optional
+
+//   // Sidebar resize button
+//   --color-resize-button: white;
+//   --bgcolor-resize-button: var(--primary);
+//   --bgcolor-resize-button-hs: var(--primary-hs);
+//   --bgcolor-resize-button-l: var(--primary-l);
+//   --color-resize-button-hover: white;
+//   --bgcolor-resize-button-hover: #{hsl.darken(var(--primary),5%)};
+
+//   // Sidebar contents
+//   --bgcolor-sidebar-context: hsl(var(--bgcolor-sidebar-context-hs),var(--bgcolor-sidebar-context-l));
+//   --bgcolor-sidebar-context-hs: 173,41%;
+//   --bgcolor-sidebar-context-l: 92%;
+//   --color-sidebar-context: var(--color-link);
+//   --color-sidebar-context-hs: var(--color-link-hs);
+//   --color-sidebar-context-l: var(--color-link-l);
+
+//   // Sidebar list group
+//   --bgcolor-sidebar-list-group: #eff8f7; // optional
+
+//   // Subnavigation
+//   --bgcolor-subnav: hsl(var(--bgcolor-subnav-hs),var(--bgcolor-subnav-l));
+//   --bgcolor-subnav-hs: var(--bgcolor-global-hs);
+//   --bgcolor-subnav-l: calc(var(--bgcolor-global-l) + 4%);
+
+//   // Tabs
+//   --bordercolor-nav-tabs: #{bs.$gray-300}; // optional
+
+//   // Icon colors
+//   --color-editor-icons: var(--color-global);
+
+//   // Border colors
+//   --border-color-theme: #{bs.$gray-300};
+//   --bordercolor-inline-code: #ccc8c8; // optional
+
+//   // Dropdown colors
+//   --bgcolor-dropdown-link-active: #{var.$growi-blue};
+
+//   // admin theme box
+//   --color-theme-color-box: #{hsl.darken(var(--primary), 15%)};
+
+//   &, body {
+//     background-image: url('../images/island/island.png');
+//     background-attachment: fixed;
+//   }
+
+//   .rbt-menu {
+//     background: #{hsl.darken(var(--bgcolor-global), 5%)};
+//   }
+
+//   .page-editor-preview-container {
+//     background-image: url('../images/island/island.png');
+//     background-attachment: fixed;
+//   }
+
+//   // login page
+//   .nologin {
+//     background-image: unset !important;
+//   }
+
+//   // Button
+//   .btn-group.grw-page-editor-mode-manager {
+//     .btn.btn-outline-primary {
+//       @include page-editor-mode-manager.btn-page-editor-mode-manager(#{hsl.darken(var(--primary), 50%)}, #{hsl.lighten(var(--primary), 5%)}, #{hsl.darken(var(--primary), 5%)});
+//     }
+//   }
+
+//   // Cards
+//   .admin-bot-card {
+//     .grw-botcard-title-active {
+//       color: var(--color-reversal);
+//     }
+//   }
+
+//   /*
+//    * GROWI Sidebar
+//   */
+//   .grw-sidebar {
+//     // Pagetree
+//     .grw-pagetree {
+//       .grw-pagetree-triangle-btn {
+//         @include mixins-buttons.button-outline-svg-icon-variant(bs.$gray-400, #0d3955);
+//       }
+//     }
+//     // Foldertree
+//     .grw-foldertree {
+//       .grw-foldertree-triangle-btn {
+//         @include mixins-buttons.button-outline-svg-icon-variant(bs.$gray-400, var(--bgcolor-sidebar));
+//       }
+//     }
+//   }
+// }

+ 1 - 2
packages/preset-themes/vite.themes.config.ts

@@ -18,10 +18,9 @@ export default defineConfig(({ mode }) => {
           '/src/styles/future.scss',
           // '/src/styles/halloween.scss',
           // '/src/styles/hufflepuff.scss',
-          // '/src/styles/island.scss',
           '/src/styles/kibela.scss',
+          '/src/styles/island.scss',
           '/src/styles/jade-green.scss',
-          // '/src/styles/kibela.scss',
           '/src/styles/mono-blue.scss',
           '/src/styles/nature.scss',
           // '/src/styles/spring.scss',