]> Untitled Git - lemmy-ui.git/commitdiff
Added npm scripts to rebuild theme files
authorFlorian Heft <flo@fam-heft.de>
Tue, 13 Jun 2023 23:04:53 +0000 (01:04 +0200)
committerFlorian Heft <flo@fam-heft.de>
Tue, 13 Jun 2023 23:14:18 +0000 (01:14 +0200)
* Add Bootstrap 4 dependency
* Add scripts to compile theme files using SASS
* Remove circular dependency of theme variables
  and Bootstrap base variables

package.json
src/assets/css/themes/_variables.darkly-red.scss [new file with mode: 0644]
src/assets/css/themes/_variables.darkly.scss
src/assets/css/themes/_variables.litely-red.scss [new file with mode: 0644]
src/assets/css/themes/_variables.litely.scss
src/assets/css/themes/darkly-red.scss [new file with mode: 0644]
src/assets/css/themes/darkly.scss [new file with mode: 0644]
src/assets/css/themes/litely-red.scss [new file with mode: 0644]
src/assets/css/themes/litely.scss [new file with mode: 0644]

index 413144e3ecab97917bcd2600df1c6fb67410713b..2e09e897633f0cfc79907a34dc459443fd72d2a3 100644 (file)
@@ -14,7 +14,9 @@
     "dev": "yarn start",
     "lint": "node generate_translations.js && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx \"src/**\" && prettier --check \"src/**/*.{ts,tsx,js,css,scss}\"",
     "prepare": "husky install",
-    "start": "yarn build:dev --watch"
+    "start": "yarn build:dev --watch",
+    "themes:build": "sass src/assets/css/themes/:src/assets/css/themes",
+    "themes:watch": "sass --watch src/assets/css/themes/:src/assets/css/themes"
   },
   "lint-staged": {
     "*.{ts,tsx,js}": [
     "@types/toastify-js": "^1.11.1",
     "@typescript-eslint/eslint-plugin": "^5.59.5",
     "@typescript-eslint/parser": "^5.59.5",
-    "bootswatch": "^5.2.3",
+    "bootstrap-v4": "npm:bootstrap@^4.6.2",
     "eslint": "^8.40.0",
     "eslint-plugin-inferno": "^7.32.2",
     "eslint-plugin-prettier": "^4.2.1",
diff --git a/src/assets/css/themes/_variables.darkly-red.scss b/src/assets/css/themes/_variables.darkly-red.scss
new file mode 100644 (file)
index 0000000..c36cbb3
--- /dev/null
@@ -0,0 +1,108 @@
+$white: #fff;
+$gray-100: #f8f9fa;
+$gray-200: #ebebeb;
+$gray-300: #dee2e6;
+$gray-400: #ced4da;
+$gray-500: #adb5bd;
+$gray-600: #888;
+$gray-700: #444;
+$gray-800: #303030;
+$gray-900: #222;
+$black: #000;
+$blue: #375a7f;
+$indigo: #6610f2;
+$purple: #6f42c1;
+$pink: #e83e8c;
+$red: #e74c3c;
+$orange: #fd7e14;
+$yellow: #f39c12;
+$green: #00bc8c;
+$teal: #20c997;
+$cyan: #3498db;
+$primary: $blue;
+$secondary: #444;
+$success: $green;
+$info: $cyan;
+$warning: $yellow;
+$danger: $red;
+$light: $gray-800;
+$dark: $gray-300;
+$yiq-contrasted-threshold: 175;
+$body-bg: $gray-900;
+$body-color: $gray-300;
+$link-color: $red;
+$font-family-sans-serif: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI",
+  Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji",
+  "Segoe UI Emoji", "Segoe UI Symbol";
+$font-size-base: 0.9375rem;
+$h1-font-size: 3rem;
+$h2-font-size: 2.5rem;
+$h3-font-size: 2rem;
+$text-muted: $gray-600;
+$table-accent-bg: $gray-800;
+$table-border-color: $gray-700;
+$input-border-color: $body-bg;
+$input-group-addon-color: $gray-500;
+$input-group-addon-bg: $gray-700;
+$custom-file-color: $gray-500;
+$custom-file-border-color: $body-bg;
+$dropdown-bg: $gray-900;
+$dropdown-border-color: $gray-700;
+$dropdown-divider-bg: $gray-700;
+$dropdown-link-color: $white;
+$dropdown-link-hover-color: $white;
+$dropdown-link-hover-bg: $primary;
+$nav-link-padding-x: 2rem;
+$nav-link-disabled-color: $gray-500;
+$nav-tabs-border-color: $gray-700;
+$nav-tabs-link-hover-border-color: $nav-tabs-border-color $nav-tabs-border-color
+  transparent;
+$nav-tabs-link-active-color: $white;
+$nav-tabs-link-active-border-color: $nav-tabs-border-color
+  $nav-tabs-border-color transparent;
+$navbar-padding-y: 1rem;
+$navbar-dark-color: rgba($white, 0.6);
+$navbar-dark-hover-color: $white;
+$navbar-light-color: rgba($white, 0.6);
+$navbar-light-hover-color: $white;
+$navbar-light-active-color: $white;
+$navbar-light-toggler-border-color: rgba($gray-900, 0.1);
+$pagination-color: $white;
+$pagination-bg: $success;
+$pagination-border-width: 0;
+$pagination-border-color: transparent;
+$pagination-hover-color: $white;
+$pagination-hover-bg: lighten($success, 10%);
+$pagination-hover-border-color: transparent;
+$pagination-active-bg: $pagination-hover-bg;
+$pagination-active-border-color: transparent;
+$pagination-disabled-color: $white;
+$pagination-disabled-bg: darken($success, 15%);
+$pagination-disabled-border-color: transparent;
+$jumbotron-bg: $gray-800;
+$card-cap-bg: $gray-700;
+$card-bg: $gray-800;
+$popover-bg: $gray-800;
+$popover-header-bg: $gray-700;
+$toast-background-color: $gray-700;
+$toast-header-background-color: $gray-800;
+$modal-content-bg: $gray-800;
+$modal-content-border-color: $gray-700;
+$modal-header-border-color: $gray-700;
+$progress-bg: $gray-700;
+$list-group-bg: $gray-800;
+$list-group-border-color: $gray-700;
+$list-group-hover-bg: $gray-700;
+$breadcrumb-bg: $gray-700;
+$close-color: $white;
+$close-text-shadow: none;
+$pre-color: inherit;
+$mark-bg: #333;
+$custom-select-bg: $secondary;
+$custom-select-color: $white;
+$input-bg: $secondary;
+$input-color: $white;
+$input-disabled-bg: darken($secondary, 10%);
+$light: $gray-800;
+$navbar-light-brand-color: $white;
+$navbar-light-brand-hover-color: $navbar-light-brand-color;
index 668f5a62d4213ee5e82a5f9fbd2563a820d6fc68..608b40016db85f30b4d9aadbdec38a8c8f01a181 100644 (file)
@@ -103,5 +103,5 @@ $input-bg: $secondary;
 $input-color: $white;
 $input-disabled-bg: darken($secondary, 10%);
 $light: $gray-800;
-$navbar-light-brand-color: $navbar-dark-active-color;
-$navbar-light-brand-hover-color: $navbar-dark-active-color;
+$navbar-light-brand-color: $white;
+$navbar-light-brand-hover-color: $navbar-light-brand-color;
diff --git a/src/assets/css/themes/_variables.litely-red.scss b/src/assets/css/themes/_variables.litely-red.scss
new file mode 100644 (file)
index 0000000..2c4c72e
--- /dev/null
@@ -0,0 +1,47 @@
+$white: #fff;
+$gray-100: #f8f9fa;
+$gray-200: #e9ecef;
+$gray-300: #dee2e6;
+$gray-400: #ced4da;
+$gray-500: #adb5bd;
+$gray-600: #6c757d;
+$gray-700: #495057;
+$gray-800: #343a40;
+$gray-900: #212529;
+$black: #000;
+$blue: #007bff;
+$indigo: #6610f2;
+$white: #ffffff;
+$orange: #f1641e;
+$cyan: #02bdc2;
+$green: #00c853;
+$primary: #d84848;
+$secondary: $green;
+$info: $cyan;
+$body-color: $gray-700;
+$link-color: $primary;
+$red: #d8486a;
+$border-radius: 0.5rem;
+$border-radius-lg: 0.5rem;
+$border-radius-sm: 1rem;
+$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Droid Sans",
+  "Segoe UI", "Helvetica", Arial, sans-serif;
+$headings-color: $gray-700;
+$input-btn-focus-color: rgba($primary, 0.75);
+$form-feedback-valid-color: $info;
+$navbar-light-color: $gray-600;
+$black: #222222;
+$navbar-dark-toggler-border-color: rgba($black, 0.1);
+$navbar-light-active-color: $gray-900;
+$card-color: $gray-700;
+$card-cap-color: $gray-700;
+$info: $blue;
+$body-bg: #fff;
+$success: $indigo;
+$danger: darken($primary, 24%);
+$navbar-light-hover-color: $gray-900;
+$card-bg: $gray-100;
+$border-color: $gray-700;
+$mark-bg: rgb(255, 252, 239);
+$font-weight-bold: 600;
+$rounded-pill: 0.25rem;
index cfb120526ee560048bd0f87dbe106925fc6ef97a..1f78cd2864e19b8b0fa80c8a6c167febf893a118 100644 (file)
@@ -1,11 +1,25 @@
+$white: #fff;
+$gray-100: #f8f9fa;
+$gray-200: #e9ecef;
+$gray-300: #dee2e6;
+$gray-400: #ced4da;
+$gray-500: #adb5bd;
+$gray-600: #6c757d;
+$gray-700: #495057;
+$gray-800: #343a40;
+$gray-900: #212529;
+$black: #000;
+$blue: #007bff;
+$indigo: #6610f2;
 $white: #ffffff;
 $orange: #f1641e;
 $cyan: #02bdc2;
 $green: #00c853;
+$primary: $orange;
 $secondary: $green;
+$info: $cyan;
 $body-color: $gray-700;
-$link-color: theme-color("primary");
-$primary: $orange;
+$link-color: $primary;
 $red: #d8486a;
 $border-radius: 0.5rem;
 $border-radius-lg: 0.5rem;
@@ -13,8 +27,8 @@ $border-radius-sm: 1rem;
 $font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Droid Sans",
   "Segoe UI", "Helvetica", Arial, sans-serif;
 $headings-color: $gray-700;
-$input-btn-focus-color: rgba($component-active-bg, 0.75);
-$form-feedback-valid-color: theme-color("info");
+$input-btn-focus-color: rgba($primary, 0.75);
+$form-feedback-valid-color: $info;
 $navbar-light-color: $gray-600;
 $black: #222222;
 $navbar-dark-toggler-border-color: rgba($black, 0.1);
diff --git a/src/assets/css/themes/darkly-red.scss b/src/assets/css/themes/darkly-red.scss
new file mode 100644 (file)
index 0000000..f6dfb3d
--- /dev/null
@@ -0,0 +1,2 @@
+@import "variables.darkly-red";
+@import "../../../../node_modules/bootstrap-v4/scss/bootstrap";
diff --git a/src/assets/css/themes/darkly.scss b/src/assets/css/themes/darkly.scss
new file mode 100644 (file)
index 0000000..ef808d5
--- /dev/null
@@ -0,0 +1,2 @@
+@import "variables.darkly";
+@import "../../../../node_modules/bootstrap-v4/scss/bootstrap";
diff --git a/src/assets/css/themes/litely-red.scss b/src/assets/css/themes/litely-red.scss
new file mode 100644 (file)
index 0000000..388d70b
--- /dev/null
@@ -0,0 +1,2 @@
+@import "variables.litely-red";
+@import "../../../../node_modules/bootstrap-v4/scss/bootstrap";
diff --git a/src/assets/css/themes/litely.scss b/src/assets/css/themes/litely.scss
new file mode 100644 (file)
index 0000000..061bcc4
--- /dev/null
@@ -0,0 +1,2 @@
+@import "variables.litely";
+@import "../../../../node_modules/bootstrap-v4/scss/bootstrap";