Просмотр исходного кода

fix imports and background images

Yuki Takei 3 лет назад
Родитель
Сommit
d1cc394316
30 измененных файлов с 160 добавлено и 414 удалено
  1. 0 32
      packages/app/src/components/Theme/ThemeAntarctic.tsx
  2. 0 8
      packages/app/src/components/Theme/ThemeBlackboard.tsx
  3. 0 32
      packages/app/src/components/Theme/ThemeChristmas.tsx
  4. 0 8
      packages/app/src/components/Theme/ThemeDefault.tsx
  5. 0 8
      packages/app/src/components/Theme/ThemeFireRed.tsx
  6. 0 8
      packages/app/src/components/Theme/ThemeFuture.tsx
  7. 0 36
      packages/app/src/components/Theme/ThemeHufflepuff.tsx
  8. 0 32
      packages/app/src/components/Theme/ThemeIsland.tsx
  9. 0 8
      packages/app/src/components/Theme/ThemeJadeGreen.tsx
  10. 0 8
      packages/app/src/components/Theme/ThemeKibela.tsx
  11. 0 8
      packages/app/src/components/Theme/ThemeMonoBlue.tsx
  12. 0 8
      packages/app/src/components/Theme/ThemeNature.tsx
  13. 0 32
      packages/app/src/components/Theme/ThemeSpring.tsx
  14. 0 32
      packages/app/src/components/Theme/ThemeWood.tsx
  15. 8 2
      packages/app/src/pages/_document.page.tsx
  16. 13 59
      packages/preset-themes/src/styles/antarctic.scss
  17. 6 6
      packages/preset-themes/src/styles/blackboard.scss
  18. 12 6
      packages/preset-themes/src/styles/christmas.scss
  19. 9 9
      packages/preset-themes/src/styles/fire-red.scss
  20. 6 6
      packages/preset-themes/src/styles/future.scss
  21. 1 1
      packages/preset-themes/src/styles/halloween.scss
  22. 22 14
      packages/preset-themes/src/styles/hufflepuff.scss
  23. 13 8
      packages/preset-themes/src/styles/island.scss
  24. 9 9
      packages/preset-themes/src/styles/jade-green.scss
  25. 6 6
      packages/preset-themes/src/styles/kibela.scss
  26. 9 9
      packages/preset-themes/src/styles/mono-blue.scss
  27. 6 6
      packages/preset-themes/src/styles/nature.scss
  28. 14 7
      packages/preset-themes/src/styles/spring.scss
  29. 13 6
      packages/preset-themes/src/styles/wood.scss
  30. 13 0
      packages/preset-themes/vite.themes.config.ts

+ 0 - 32
packages/app/src/components/Theme/ThemeAntarctic.tsx

@@ -1,32 +0,0 @@
-import Image from 'next/image';
-
-import { Themes } from '~/stores/use-next-themes';
-
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeAntarctic.module.scss';
-
-export const getBackgroundImageSrc = (colorScheme: Themes): string => {
-  switch (colorScheme) {
-    default:
-      return '/images/themes/antarctic/bg.svg';
-  }
-};
-
-type Props = {
-  children: JSX.Element,
-  colorScheme?: Themes,
-}
-
-const ThemeAntarctic = ({ children, colorScheme }: Props): JSX.Element => {
-  const bgImageNode = (
-    <>
-      {colorScheme != null && (
-        <Image alt='background image' src={getBackgroundImageSrc(colorScheme)} layout='fill' quality="100" />
-      )}
-    </>
-  );
-  return <ThemeInjector className="theme-antarctic" bgImageNode={bgImageNode}>{children}</ThemeInjector>;
-};
-
-export default ThemeAntarctic;

+ 0 - 8
packages/app/src/components/Theme/ThemeBlackboard.tsx

@@ -1,8 +0,0 @@
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeBlackboard.module.scss';
-
-const ThemeBlackboard = ({ children }: { children: JSX.Element }): JSX.Element => {
-  return <ThemeInjector className="theme-blackboard">{children}</ThemeInjector>;
-};
-export default ThemeBlackboard;

+ 0 - 32
packages/app/src/components/Theme/ThemeChristmas.tsx

@@ -1,32 +0,0 @@
-import Image from 'next/image';
-
-import { Themes } from '~/stores/use-next-themes';
-
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeChristmas.module.scss';
-
-export const getBackgroundImageSrc = (colorScheme: Themes): string => {
-  switch (colorScheme) {
-    default:
-      return '/images/themes/christmas/christmas.jpg';
-  }
-};
-
-type Props = {
-  children: JSX.Element,
-  colorScheme?: Themes,
-}
-
-const ThemeChristmas = ({ children, colorScheme }: Props): JSX.Element => {
-  const bgImageNode = (
-    <>
-      {colorScheme != null && (
-        <Image alt='background image' src={getBackgroundImageSrc(colorScheme)} layout='fill' quality="100" />
-      )}
-    </>
-  );
-  return <ThemeInjector className="theme-christmas" bgImageNode={bgImageNode}>{children}</ThemeInjector>;
-};
-
-export default ThemeChristmas;

+ 0 - 8
packages/app/src/components/Theme/ThemeDefault.tsx

@@ -1,8 +0,0 @@
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeDefault.module.scss';
-
-const ThemeDefault = ({ children }: { children: JSX.Element }): JSX.Element => {
-  return <ThemeInjector>{children}</ThemeInjector>;
-};
-export default ThemeDefault;

+ 0 - 8
packages/app/src/components/Theme/ThemeFireRed.tsx

@@ -1,8 +0,0 @@
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeFireRed.module.scss';
-
-const ThemeFireRed = ({ children }: { children: JSX.Element }): JSX.Element => {
-  return <ThemeInjector className="theme-fire-red">{children}</ThemeInjector>;
-};
-export default ThemeFireRed;

+ 0 - 8
packages/app/src/components/Theme/ThemeFuture.tsx

@@ -1,8 +0,0 @@
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeFuture.module.scss';
-
-const ThemeFuture = ({ children }: { children: JSX.Element }): JSX.Element => {
-  return <ThemeInjector className="theme-future">{children}</ThemeInjector>;
-};
-export default ThemeFuture;

+ 0 - 36
packages/app/src/components/Theme/ThemeHufflepuff.tsx

@@ -1,36 +0,0 @@
-import Image from 'next/image';
-
-import { Themes } from '~/stores/use-next-themes';
-
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeHufflepuff.module.scss';
-
-export const getBackgroundImageSrc = (colorScheme: Themes): string => {
-  switch (colorScheme) {
-    case Themes.light:
-      return '/images/themes/hufflepuff/badger-light3.png';
-    case Themes.dark:
-      return '/images/themes/hufflepuff/badger-dark.jpg';
-    default:
-      return '/images/themes/hufflepuff/badger-light3.png';
-  }
-};
-
-type Props = {
-  children: JSX.Element,
-  colorScheme?: Themes,
-}
-
-const ThemeHufflepuff = ({ children, colorScheme }: Props): JSX.Element => {
-  const bgImageNode = (
-    <>
-      {colorScheme != null && (
-        <Image alt='background image' src={getBackgroundImageSrc(colorScheme)} layout='fill' quality="100" />
-      )}
-    </>
-  );
-  return <ThemeInjector className="theme-hufflepuff" bgImageNode={bgImageNode}>{children}</ThemeInjector>;
-};
-
-export default ThemeHufflepuff;

+ 0 - 32
packages/app/src/components/Theme/ThemeIsland.tsx

@@ -1,32 +0,0 @@
-import Image from 'next/image';
-
-import { Themes } from '~/stores/use-next-themes';
-
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeIsland.module.scss';
-
-export const getBackgroundImageSrc = (colorScheme: Themes): string => {
-  switch (colorScheme) {
-    default:
-      return '/images/themes/island/island.png';
-  }
-};
-
-type Props = {
-  children: JSX.Element,
-  colorScheme?: Themes,
-}
-
-const ThemeIsland = ({ children, colorScheme }: Props): JSX.Element => {
-  const bgImageNode = (
-    <>
-      {colorScheme != null && (
-        <Image alt='background image' src={getBackgroundImageSrc(colorScheme)} layout='fill' quality="100" />
-      )}
-    </>
-  );
-  return <ThemeInjector className="theme-island" bgImageNode={bgImageNode}>{children}</ThemeInjector>;
-};
-
-export default ThemeIsland;

+ 0 - 8
packages/app/src/components/Theme/ThemeJadeGreen.tsx

@@ -1,8 +0,0 @@
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeJadeGreen.module.scss';
-
-const ThemeJadeGreen = ({ children }: { children: JSX.Element }): JSX.Element => {
-  return <ThemeInjector className="theme-jade-green">{children}</ThemeInjector>;
-};
-export default ThemeJadeGreen;

+ 0 - 8
packages/app/src/components/Theme/ThemeKibela.tsx

@@ -1,8 +0,0 @@
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeKibela.module.scss';
-
-const ThemeKibela = ({ children }: { children: JSX.Element }): JSX.Element => {
-  return <ThemeInjector className="theme-kibela">{children}</ThemeInjector>;
-};
-export default ThemeKibela;

+ 0 - 8
packages/app/src/components/Theme/ThemeMonoBlue.tsx

@@ -1,8 +0,0 @@
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeMonoBlue.module.scss';
-
-const ThemeMonoBlue = ({ children }: { children: JSX.Element }): JSX.Element => {
-  return <ThemeInjector className="theme-mono-blue">{children}</ThemeInjector>;
-};
-export default ThemeMonoBlue;

+ 0 - 8
packages/app/src/components/Theme/ThemeNature.tsx

@@ -1,8 +0,0 @@
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeNature.module.scss';
-
-const ThemeNature = ({ children }: { children: JSX.Element }): JSX.Element => {
-  return <ThemeInjector className="theme-nature">{children}</ThemeInjector>;
-};
-export default ThemeNature;

+ 0 - 32
packages/app/src/components/Theme/ThemeSpring.tsx

@@ -1,32 +0,0 @@
-import Image from 'next/image';
-
-import { Themes } from '~/stores/use-next-themes';
-
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeSpring.module.scss';
-
-export const getBackgroundImageSrc = (colorScheme: Themes): string => {
-  switch (colorScheme) {
-    default:
-      return '/images/themes/spring/spring02.svg';
-  }
-};
-
-type Props = {
-  children: JSX.Element,
-  colorScheme?: Themes,
-}
-
-const ThemeSpring = ({ children, colorScheme }: Props): JSX.Element => {
-  const bgImageNode = (
-    <>
-      {colorScheme != null && (
-        <Image alt='background image' src={getBackgroundImageSrc(colorScheme)} layout='fill' quality="100" />
-      )}
-    </>
-  );
-  return <ThemeInjector className="theme-spring" bgImageNode={bgImageNode}>{children}</ThemeInjector>;
-};
-
-export default ThemeSpring;

+ 0 - 32
packages/app/src/components/Theme/ThemeWood.tsx

@@ -1,32 +0,0 @@
-import Image from 'next/image';
-
-import { Themes } from '~/stores/use-next-themes';
-
-import { ThemeInjector } from './utils/ThemeInjector';
-
-// import styles from './ThemeWood.module.scss';
-
-export const getBackgroundImageSrc = (colorScheme: Themes): string => {
-  switch (colorScheme) {
-    default:
-      return '/images/themes/wood/wood.jpg';
-  }
-};
-
-type Props = {
-  children: JSX.Element,
-  colorScheme?: Themes,
-}
-
-const ThemeWood = ({ children, colorScheme }: Props): JSX.Element => {
-  const bgImageNode = (
-    <>
-      {colorScheme != null && (
-        <Image alt='background image' src={getBackgroundImageSrc(colorScheme)} layout='fill' quality="100" />
-      )}
-    </>
-  );
-  return <ThemeInjector className="theme-wood" bgImageNode={bgImageNode}>{children}</ThemeInjector>;
-};
-
-export default ThemeWood;

+ 8 - 2
packages/app/src/pages/_document.page.tsx

@@ -12,7 +12,9 @@ import Document, {
 import { ActivatePluginService, GrowiPluginManifestEntries } from '~/client/services/activate-plugin';
 import { CrowiRequest } from '~/interfaces/crowi-request';
 import { GrowiPlugin, GrowiPluginResourceType } from '~/interfaces/plugin';
+import loggerFactory from '~/utils/logger';
 
+const logger = loggerFactory('growi:page:_document');
 
 type HeadersForPresetThemesProps = {
   manifest: PresetThemesManifest,
@@ -21,8 +23,12 @@ const HeadersForPresetThemes = (props: HeadersForPresetThemesProps): JSX.Element
   const { manifest } = props;
 
   const themeName = 'default';
-  const manifestResourceKey = getManifestKeyFromTheme(themeName);
-  const href = `/static/preset-themes/${manifest[manifestResourceKey].file}`; // configured by express.static
+  let themeKey = getManifestKeyFromTheme(themeName);
+  if (!(themeKey in manifest)) {
+    logger.warn(`The key for '${themeName} does not exist in preset-themes manifest`);
+    themeKey = getManifestKeyFromTheme('default');
+  }
+  const href = `/static/preset-themes/${manifest[themeKey].file}`; // configured by express.static
 
   const elements: JSX.Element[] = [];
 

+ 13 - 59
packages/preset-themes/src/styles/antarctic.scss

@@ -1,6 +1,6 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
 // == Define Bootstrap theme colors
 //
@@ -43,7 +43,7 @@ $accentcolor: #ffd700;
 
 //== Light Mode
 //
-:root .theme-antarctic {
+:root {
   $primary: $themecolor;
 
   // Background colors
@@ -109,8 +109,15 @@ $accentcolor: #ffd700;
   // admin theme box
   $color-theme-color-box: lighten($themecolor, 20%);
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
+
+  &, body {
+    background-image: url('../images/antarctic/bg.svg');
+    background-attachment: fixed;
+    background-position: 50%;
+    background-size: cover;
+  }
 
   //Button
   .btn-group.grw-page-editor-mode-manager {
@@ -142,56 +149,3 @@ $accentcolor: #ffd700;
     }
   }
 }
-
-//== Dark Mode
-//
-// html[dark] {
-//   $primary: #d65a31;
-
-//   $basecolor: #222831;
-
-//   // Background colors
-//   $bgcolor-global: $basecolor;
-//   $bgcolor-navbar: #151515;
-//   $bgcolor-inline-code: darken($basecolor, 5%);
-//   $bgcolor-card: darken($basecolor, 5%);
-
-//   // Font colors
-//   $color-global: #eeeeee;
-//   $color-reversal: $gray-900;
-//   // $color-header: desaturate($primary, 20%);
-//   $color-link: $primary;
-//   $color-link-hover: lighten($color-link, 10%);
-//   $color-link-wiki: lighten($basecolor, 50%);
-//   $color-link-wiki-hover: darken($color-link-wiki, 5%);
-//   $color-link-nabvar: $color-global;
-//   $color-inline-code: #c7254e; // optional
-
-//   // List Group colors
-//   $color-list: $color-global;
-//   $bgcolor-list: $bgcolor-global;
-//   $color-list-active: $color-reversal;
-//   $bgcolor-list-active: $primary;
-//   $color-list-hover: $color-reversal;
-
-//   // Logo colors
-//   $bgcolor-logo: $bgcolor-navbar;
-//   $fillcolor-logo-mark: $gray-700;
-
-//   // Icon colors
-//   $color-editor-icons: darken($accentcolor, 15%);
-
-//   // Border colors
-//   $border-color-theme: black; // former: `$navbar-border: $gray-300;`
-
-//   // Dropdown colors
-//   $bgcolor-dropdown-link-active: $primary;
-
-//   // Sidebar
-//   $bgcolor-sidebar: $bgcolor-navbar;
-//   $color-sidebar-context: $color-global;
-//   $bgcolor-sidebar-context: lighten($bgcolor-navbar, 5%);
-
-//   @import 'apply-colors';
-//   @import 'apply-colors-dark';
-// }

+ 6 - 6
packages/preset-themes/src/styles/blackboard.scss

@@ -1,8 +1,8 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
-:root .theme-blackboard {
+:root {
   // Theme colors
   $themecolor: #da8506;
   $themelight: #223729;
@@ -79,8 +79,8 @@
   // admin theme box
   $color-theme-color-box: $primary;
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-dark';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-dark';
 
   // Navs
   .nav-tabs {

+ 12 - 6
packages/preset-themes/src/styles/christmas.scss

@@ -1,6 +1,6 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
 // == Define Bootstrap theme colors
 //
@@ -37,7 +37,7 @@ $color-link-wiki-hover: lighten($color-link-wiki, 15%);
 
 //== Light Mode
 //
-:root .theme-christmas {
+:root {
   $primary: #d3c665;
   // Background colors
   $bgcolor-card: $gray-50;
@@ -101,8 +101,14 @@ $color-link-wiki-hover: lighten($color-link-wiki, 15%);
   // admin theme box
   $color-theme-color-box: lighten($themecolor, 20%);
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
+
+  &, body {
+    background-image: url('../images/christmas/christmas.jpg');
+    background-attachment: fixed;
+    background-size: cover;
+  }
 
   // change color of highlighted header in wiki (default: orange)
 

+ 9 - 9
packages/preset-themes/src/styles/fire-red.scss

@@ -1,8 +1,8 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
-:root[data-theme='light'] .theme-fire-red {
+:root[data-theme='light'] {
   // Theme colors
   $themecolor: #ea5532;
   $themelight: #ffffff;
@@ -71,8 +71,8 @@
   // admin theme box
   $color-theme-color-box: $primary;
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
 
   // Navs {
   .nav-tabs {
@@ -95,7 +95,7 @@
   }
 }
 
-:root[data-theme='dark'] .theme-fire-red {
+:root[data-theme='dark'] {
   // Theme colors
   $themecolor: #ea5532;
   $themedark: #333333;
@@ -172,8 +172,8 @@
   // admin theme box
   $color-theme-color-box: $primary;
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-dark';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-dark';
 
   // Navs
   .nav-tabs {

+ 6 - 6
packages/preset-themes/src/styles/future.scss

@@ -1,12 +1,12 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
 $primary: #00b5b7;
 $themecolor: #16282d;
 $accentcolor: #00fff5;
 
-:root .theme-future {
+:root {
   // Background colors
   $bgcolor-global: $themecolor;
   $bgcolor-inline-code: #1f1f22; //optional
@@ -83,8 +83,8 @@ $accentcolor: #00fff5;
   // admin theme box
   $color-theme-color-box: lighten($primary, 20%);
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-dark';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-dark';
 
   //Button
   .btn-group.grw-page-editor-mode-manager {

+ 1 - 1
packages/preset-themes/src/styles/halloween.scss

@@ -28,7 +28,7 @@ $light: lighten($secondary, 10%);
 }
 
 
-:root[data-theme] {
+:root {
   // Background colors
   $bgcolor-global: #050000;
   $bgcolor-inline-code: #1f1f22; //optional

+ 22 - 14
packages/preset-themes/src/styles/hufflepuff.scss

@@ -1,6 +1,6 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
 // == Define Bootstrap theme colors
 //
@@ -20,7 +20,7 @@
 
 //== Light Mode
 //
-:root[data-theme='light'] .theme-hufflepuff {
+:root[data-theme='light'] {
   // Theme colors
   $themecolor: #eaab20;
   $themelight: #efe2cf;
@@ -92,10 +92,14 @@
   // admin theme box
   $color-theme-color-box: darken($primary, 5%);
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
 
-  //Button
+  &, body {
+    background-image: url('../images/hufflepuff/badger-light3.png');
+  }
+
+  // Button
   .btn.btn-outline-primary {
     @include page-editor-mode-manager.btn-page-editor-mode-manager(darken($primary, 50%), darken($primary, 50%), lighten($primary, 20%));
   }
@@ -108,7 +112,7 @@
   .growi:not(.login-page) {
     // add background-image
     .page-editor-preview-container {
-      background-image: url('/images/themes/hufflepuff/badger-light3.png');
+      background-image: url('../images/themes/hufflepuff/badger-light3.png');
       background-attachment: fixed;
       background-position: bottom;
       background-size: cover;
@@ -119,7 +123,7 @@
   .nologin {
     #page-wrapper {
       background-color: $themelight;
-      background-image: url('/images/themes/hufflepuff/badger-light.png');
+      background-image: url('../images/themes/hufflepuff/badger-light.png');
       background-attachment: fixed;
       background-position: bottom;
       background-size: cover;
@@ -156,7 +160,7 @@
   }
 }
 
-:root[data-theme='dark'] .theme-hufflepuff {
+:root[data-theme='dark'] {
   // Theme colors
   $themecolor: #eaab20;
   $themedark: #3d3f38;
@@ -234,8 +238,12 @@
   // admin theme box
   $color-theme-color-box: $primary;
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-dark';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-dark';
+
+  &, body {
+    background-image: url('../images/hufflepuff/badger-dark.jpg');
+  }
 
   // Navs
   .nav-tabs {
@@ -275,7 +283,7 @@
   .growi:not(.login-page) {
     // add background-image
     .page-editor-preview-container {
-      background-image: url('/images/themes/hufflepuff/badger-dark.jpg');
+      background-image: url('../images/themes/hufflepuff/badger-dark.jpg');
       background-attachment: fixed;
       background-position: bottom;
       background-size: cover;
@@ -286,7 +294,7 @@
   .nologin {
     #page-wrapper {
       background-color: $themedark;
-      background-image: url('/images/themes/hufflepuff/badger-light.png');
+      background-image: url('../images/themes/hufflepuff/badger-light.png');
       background-attachment: fixed;
       background-position: bottom;
       background-size: cover;

+ 13 - 8
packages/preset-themes/src/styles/island.scss

@@ -1,12 +1,12 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
-@use '../../styles/mixins';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
+@use './atoms/mixins/buttons' as mixins-buttons;
 
 $color-primary: #97cbc3;
 $color-themelight: rgba(183, 226, 219, 1);
 
-:root .theme-island {
+:root {
   $primary: $color-primary;
   // Background colors
   $bgcolor-card: $gray-50;
@@ -82,8 +82,13 @@ $color-themelight: rgba(183, 226, 219, 1);
   // admin theme box
   $color-theme-color-box: darken($primary, 15%);
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
+
+  &, body {
+    background-image: url('../images/island/island.png');
+    background-attachment: fixed;
+  }
 
   .rbt-menu {
     background: lighten($color-themelight, 5%);
@@ -124,7 +129,7 @@ $color-themelight: rgba(183, 226, 219, 1);
     // Pagetree
     .grw-pagetree {
       .grw-pagetree-triangle-btn {
-        @include mixins.button-outline-svg-icon-variant($gray-400, $bgcolor-sidebar);
+        @include mixins-buttons.button-outline-svg-icon-variant($gray-400, $bgcolor-sidebar);
       }
     }
   }

+ 9 - 9
packages/preset-themes/src/styles/jade-green.scss

@@ -1,8 +1,8 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
-:root[data-theme='light'] .theme-jade-green {
+:root[data-theme='light'] {
   // Theme colors
   $themecolor: #38b48b;
   $themelight: #ffffff;
@@ -71,8 +71,8 @@
   // admin theme box
   $color-theme-color-box: $primary;
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
 
   // Navs {
   .nav-tabs {
@@ -95,7 +95,7 @@
   }
 }
 
-:root[data-theme='dark'] .theme-jade-green {
+:root[data-theme='dark'] {
   // Theme colors
   $themecolor: #38b48b;
   $themedark: #333333;
@@ -172,8 +172,8 @@
   // admin theme box
   $color-theme-color-box: $primary;
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-dark';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-dark';
 
   // Navs
   .nav-tabs {

+ 6 - 6
packages/preset-themes/src/styles/kibela.scss

@@ -1,6 +1,6 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
 $bgcolor-theme: rgb(18, 86, 163);
 $themelight: #f4f5f6;
@@ -8,7 +8,7 @@ $subthemecolor: rgb(88, 130, 250);
 $lightthemecolor: rgba(181, 203, 247, 0.61);
 
 // Light Mode
-:root .theme-kibela {
+:root {
   // Background colors
   $bgcolor-navbar: white;
   $bgcolor-navbar-active: $bgcolor-theme;
@@ -78,8 +78,8 @@ $lightthemecolor: rgba(181, 203, 247, 0.61);
   // Sidebar list group
   $bgcolor-sidebar-list-group: #fafbff; // optional
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
 
   .main {
     .container,

+ 9 - 9
packages/preset-themes/src/styles/mono-blue.scss

@@ -1,8 +1,8 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
-:root[data-theme='light'] .theme-mono-blue {
+:root[data-theme='light'] {
   // Theme colors
   $themecolor: #00587a;
   $themelight: #f7fbfd;
@@ -71,8 +71,8 @@
   // admin theme box
   $color-theme-color-box: lighten($primary, 20%);
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
 
   // Navs {
   .nav-tabs {
@@ -95,7 +95,7 @@
   }
 }
 
-:root[data-theme='dark'] .theme-mono-blue {
+:root[data-theme='dark'] {
   // Theme colors
   $themecolor: #00587a;
   $themedark: #061f2f;
@@ -168,8 +168,8 @@
   // admin theme box
   $color-theme-color-box: $primary;
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-dark';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-dark';
 
   // Navs
   .nav-tabs {

+ 6 - 6
packages/preset-themes/src/styles/nature.scss

@@ -1,6 +1,6 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
 // == Define Bootstrap theme colors
 //
@@ -36,7 +36,7 @@ $themecolor: #12b105;
 
 //== Light Mode
 //
-:root .theme-nature {
+:root {
   $primary: #460039;
   $light: $gray-100;
 
@@ -90,8 +90,8 @@ $themecolor: #12b105;
   // admin theme box
   $color-theme-color-box: lighten($primary, 20%);
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
 
   // Search Top
   .grw-global-search {

+ 14 - 7
packages/preset-themes/src/styles/spring.scss

@@ -1,7 +1,7 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
-@use '../../styles/bootstrap/init' as bs;
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
+@use './bootstrap/init' as bs;
 
 // == Define Bootstrap theme colors
 //
@@ -27,7 +27,7 @@ $accentcolor: #e08dbc;
 
 //== Light Mode
 //
-:root .theme-spring {
+:root {
   $primary: $themecolor;
   $secondary: $accentcolor;
 
@@ -91,8 +91,15 @@ $accentcolor: #e08dbc;
   // admin theme box
   $color-theme-color-box: darken($primary, 20%);
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
+
+  &, body {
+    background-image: url('../images/spring/spring02.svg');
+    background-attachment: fixed;
+    background-position: bottom;
+    background-size: cover;
+  }
 
   //Button
   // Outline buttons are applyed the accent color to this spring theme cuz the primary is too light and it looks like unable to click them.

+ 13 - 6
packages/preset-themes/src/styles/wood.scss

@@ -1,6 +1,6 @@
-@use '../../styles/variables' as *;
-@use '../../styles/bootstrap/variables' as *;
-@use '../../styles/theme/mixins/page-editor-mode-manager';
+@use './variables' as *;
+@use './bootstrap/variables' as *;
+@use './theme/mixins/page-editor-mode-manager';
 
 // == Define Bootstrap theme colors
 //
@@ -36,7 +36,7 @@ $themelight: #f5f3ee;
 
 //== Light Mode
 //
-:root .theme-wood {
+:root {
   $primary: #aaa45f;
 
   // Background colors
@@ -113,8 +113,15 @@ $themelight: #f5f3ee;
   // portal
   $info: lighten($themecolor, 10%);
 
-  @import '../../styles/theme/apply-colors';
-  @import '../../styles/theme/apply-colors-light';
+  @import './theme/apply-colors';
+  @import './theme/apply-colors-light';
+
+  &, body {
+    background-image: url('../images/wood/wood.jpg');
+    background-attachment: fixed;
+    background-position: 50%;
+    background-size: cover;
+  }
 
   /*
    * Modal

+ 13 - 0
packages/preset-themes/vite.themes.config.ts

@@ -7,8 +7,21 @@ export default defineConfig({
     manifest: true,
     rollupOptions: {
       input: [
+        '/src/styles/antarctic.scss',
+        '/src/styles/blackboard.scss',
+        '/src/styles/christmas.scss',
         '/src/styles/default.scss',
+        '/src/styles/fire-red.scss',
+        '/src/styles/future.scss',
         '/src/styles/halloween.scss',
+        '/src/styles/hufflepuff.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',
+        '/src/styles/wood.scss',
       ],
     },
   },