From 05422de929db84c91e5fc810c3d2f3fe0115321f Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Sun, 27 Feb 2022 23:05:10 +0100 Subject: [PATCH 01/13] Upgrade versions for angular material 13 --- .gitignore | 1 + Demo | 1 - package-lock.json | 6 +++--- package.json | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) delete mode 160000 Demo diff --git a/.gitignore b/.gitignore index 7e423e5..eeb2963 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea/ .vscode/ node_modules/ +dist/ \ No newline at end of file diff --git a/Demo b/Demo deleted file mode 160000 index b944e8d..0000000 --- a/Demo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b944e8d3ad61fd295a08eb52c5b79e133b468e31 diff --git a/package-lock.json b/package-lock.json index 642244a..bb0d1f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "dependencies": { "@angular/material": { "version": "8.1.1", - "resolved": "https://registry.npmjs.org/@angular/material/-/material-8.1.1.tgz", + "resolved": "https://registry.npmjs.org/@angular/material/-/material-13.2.3.tgz", "integrity": "sha512-45aaxKuLTrthzhAhG2+OY86wafuRBteZcRjDG7rKZ3Cc3KteUp5QwAi+QbhHzs4O3WXLWTAmuLYJelRqRqqw7g==", "dev": true, "requires": { @@ -47,7 +47,7 @@ }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { @@ -56,7 +56,7 @@ }, "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, diff --git a/package.json b/package.json index f7a63cd..2c7bfb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-material-dynamic-themes", - "version": "1.0.4", + "version": "1.1.0", "description": "Making able the app to switch between material themes at run-time", "scripts": { "README.md-TOC": "node markdown-toc.js -f README.md", @@ -32,12 +32,12 @@ }, "homepage": "https://github.com/mirismaili/angular-material-dynamic-themes#readme", "devDependencies": { - "@angular/material": "^8.1.1", - "cz-conventional-changelog": "^2.1.0", + "@angular/material": "^13.2.3", + "cz-conventional-changelog": "^3.3.0", "yargs": "^13.3.0" }, "peerDependencies": { - "@angular/material": "^7.0.0 || ^8.0.0" + "@angular/material": "^13.0.0 || ^12.0.0" }, "config": { "commitizen": { From 70bb1eed01420256e736ad0beff49a29c2e4034d Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Mon, 28 Feb 2022 00:39:40 +0100 Subject: [PATCH 02/13] Remove useless things and add github actions --- .github/workflows/auto-pack.yml | 25 +++++++++++++++++++++++++ .gitignore | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/auto-pack.yml diff --git a/.github/workflows/auto-pack.yml b/.github/workflows/auto-pack.yml new file mode 100644 index 0000000..6cd2cab --- /dev/null +++ b/.github/workflows/auto-pack.yml @@ -0,0 +1,25 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v1 + + - name: Node ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: npm pack + run: npm pack + - uses: actions/upload-artifact@v2 + name: Upload Artifact + with: + name: angular-material-dynamic-themes.zip + path: ./*.tgz \ No newline at end of file diff --git a/.gitignore b/.gitignore index eeb2963..34ceb7a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .idea/ .vscode/ node_modules/ -dist/ \ No newline at end of file +dist/ From 366bc1f1da6278132bee488a448a2f2e5c03d96d Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Wed, 16 Nov 2022 19:33:00 +0100 Subject: [PATCH 03/13] Add angular material check --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c7bfb6..374715f 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "yargs": "^13.3.0" }, "peerDependencies": { - "@angular/material": "^13.0.0 || ^12.0.0" + "@angular/material": "^14.0.0 || ^13.0.0 || ^12.0.0" }, "config": { "commitizen": { From f983b11fdb0ef4a60f527211d46aeedffb6a8c28 Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Wed, 16 Nov 2022 19:34:10 +0100 Subject: [PATCH 04/13] Update version and change urls --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 374715f..0794c94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "angular-material-dynamic-themes", - "version": "1.1.0", + "name": "angular-material-dynamic-themes-eli", + "version": "1.1.1", "description": "Making able the app to switch between material themes at run-time", "scripts": { "README.md-TOC": "node markdown-toc.js -f README.md", @@ -28,9 +28,9 @@ "author": "S. M. Mir-Ismaili ", "license": "MIT", "bugs": { - "url": "https://github.com/mirismaili/angular-material-dynamic-themes/issues" + "url": "https://github.com/Elikill58/angular-material-dynamic-themes/issues" }, - "homepage": "https://github.com/mirismaili/angular-material-dynamic-themes#readme", + "homepage": "https://github.com/Elikill58/angular-material-dynamic-themes#readme", "devDependencies": { "@angular/material": "^13.2.3", "cz-conventional-changelog": "^3.3.0", From 794769e696803d1f00d4bad43c484154f50a0878 Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Tue, 29 Nov 2022 12:42:05 +0100 Subject: [PATCH 05/13] Upgrade angular version to 15 and package to 1.1.2 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0794c94..27a2643 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-material-dynamic-themes-eli", - "version": "1.1.1", + "version": "1.1.2", "description": "Making able the app to switch between material themes at run-time", "scripts": { "README.md-TOC": "node markdown-toc.js -f README.md", @@ -37,7 +37,7 @@ "yargs": "^13.3.0" }, "peerDependencies": { - "@angular/material": "^14.0.0 || ^13.0.0 || ^12.0.0" + "@angular/material": "^15.0.0 || ^14.0.0 || ^13.0.0 || ^12.0.0" }, "config": { "commitizen": { From 027bc06a379e866425bcbf7b03e87af2d3edb2c4 Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Tue, 29 Nov 2022 12:45:31 +0100 Subject: [PATCH 06/13] Update readme --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5db812f..252a9b5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,7 @@

- + npm (scoped) - - Dependencies Status - Known Vulnerabilities @@ -21,6 +18,8 @@

+Originally made by [mirismaili](https://github.com/mirismaili) and published [here](https://www.npmjs.com/package/angular-material-dynamic-themes) but not maintained. + **Angular-Material-Dynamic-Themes** Making able the app to switch between material themes at run-time @@ -43,7 +42,7 @@ Making able the app to switch between material themes at run-time In your **Angular Material project**: ```bash -npm install angular-material-dynamic-themes +npm install angular-material-dynamic-themes-eli ``` > NOTE: This solution is only compatible with **SASS/SCSS** preprocessor. From 61d051549fb10587c0fd57991898b4cda1fc37ea Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Sat, 3 Dec 2022 16:38:02 +0100 Subject: [PATCH 07/13] Update versions and require angular material --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 27a2643..1f0f302 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-material-dynamic-themes-eli", - "version": "1.1.2", + "version": "1.2.0", "description": "Making able the app to switch between material themes at run-time", "scripts": { "README.md-TOC": "node markdown-toc.js -f README.md", @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/mirismaili/angular-material-dynamic-themes.git" + "url": "https://github.com/mirismaili/angular-material-dynamic-themes-eli.git" }, "keywords": [ "angular", @@ -25,19 +25,19 @@ "sass", "scss" ], - "author": "S. M. Mir-Ismaili ", + "author": "S. M. Mir-Ismaili & Elikill58 ", "license": "MIT", "bugs": { - "url": "https://github.com/Elikill58/angular-material-dynamic-themes/issues" + "url": "https://github.com/Elikill58/angular-material-dynamic-themes-eli/issues" }, - "homepage": "https://github.com/Elikill58/angular-material-dynamic-themes#readme", + "homepage": "https://github.com/Elikill58/angular-material-dynamic-themes-eli#readme", "devDependencies": { - "@angular/material": "^13.2.3", + "@angular/material": "^15.0.1", "cz-conventional-changelog": "^3.3.0", "yargs": "^13.3.0" }, "peerDependencies": { - "@angular/material": "^15.0.0 || ^14.0.0 || ^13.0.0 || ^12.0.0" + "@angular/material": "^15.0.0" }, "config": { "commitizen": { From 220494e93055bc370bc091bb3a73652319e06142 Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Fri, 15 Sep 2023 18:44:47 +0200 Subject: [PATCH 08/13] Keep compatible with angular material 14 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f0f302..20e72d1 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "homepage": "https://github.com/Elikill58/angular-material-dynamic-themes-eli#readme", "devDependencies": { - "@angular/material": "^15.0.1", + "@angular/material": "^15.0.1 || ^14.0.0", "cz-conventional-changelog": "^3.3.0", "yargs": "^13.3.0" }, From 75b9dc033a31d98099f5b810590e891927750228 Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Fri, 15 Sep 2023 19:00:33 +0200 Subject: [PATCH 09/13] Update for angular deprecation --- _themes-core.scss | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/_themes-core.scss b/_themes-core.scss index 1f35b2b..fbe668c 100644 --- a/_themes-core.scss +++ b/_themes-core.scss @@ -37,7 +37,17 @@ // Light-themes: @if $light-or-dark == '' or $light-or-dark == 'light' or $light-or-dark == 'l' or $light-or-dark == 'both' { .#{$css-class} { - $mat-theme: mat-light-theme($primary, $accent, $warn); + // Define a dark theme + $mat-theme: mat.define-light-theme(( + color: ( + primary: $primary, + accent: $accent, + warn: $warn, + primary-base: $primary-base, + accent-base: $accent-base, + warn-base: $warn-base, + ), + )); @include angular-material-theme($mat-theme); @if mixin-exists(themed-stylesheets) { @include themed-stylesheets($mat-theme); @@ -48,7 +58,18 @@ // Dark-themes: @if $light-or-dark == '' or $light-or-dark == 'dark' or $light-or-dark == 'd' or $light-or-dark == 'both' { .#{$css-class}-dark { - $mat-theme: mat-dark-theme($primary, $accent, $warn); + $mat-theme: mat.define-dark-theme(( + color: ( + primary: $primary, + accent: $accent, + warn: $warn, + primary-base: $primary-base, + accent-base: $accent-base, + warn-base: $warn-base, + ), + typography: mat.define-typography-config(), + density: 0, + )); @include angular-material-theme($mat-theme); @if mixin-exists(themed-stylesheets) { @include themed-stylesheets($mat-theme); From 08c08d85070c125440b7eb45ee1bb16881b6bbe3 Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Fri, 15 Sep 2023 19:03:46 +0200 Subject: [PATCH 10/13] Upgrade workflow --- .github/workflows/auto-pack.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-pack.yml b/.github/workflows/auto-pack.yml index 6cd2cab..7c27fb4 100644 --- a/.github/workflows/auto-pack.yml +++ b/.github/workflows/auto-pack.yml @@ -7,18 +7,18 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x] + node-version: 18 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Node ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: npm pack run: npm pack - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 name: Upload Artifact with: name: angular-material-dynamic-themes.zip From 9d655b5c9d8ddc0ce46cf52ff1ea9b384609d92e Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Fri, 15 Sep 2023 19:08:04 +0200 Subject: [PATCH 11/13] Import angular material --- _themes-core.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_themes-core.scss b/_themes-core.scss index fbe668c..a4f1f54 100644 --- a/_themes-core.scss +++ b/_themes-core.scss @@ -21,6 +21,10 @@ * @see `mat-palette()`: https://github.com/angular/components/blob/dcde115980a2e94fae8e667d1dfa300fc82a77cb/src/material/core/theming/_theming.scss#L12-L37 * @see https://material.angular.io/guide/theming */ +@use '@angular/material' as mat; + +@include mat.core(); + //noinspection SassScssUnresolvedMixin, SassScssResolvedByNameOnly @mixin make-stylesheets($themes-map) { @each $css-class, $theme in $themes-map { From f511c547246debf86906e686081e8971ae3e6719 Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Fri, 15 Sep 2023 19:19:25 +0200 Subject: [PATCH 12/13] Add ignore warning --- _themes-core.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_themes-core.scss b/_themes-core.scss index a4f1f54..24b95a4 100644 --- a/_themes-core.scss +++ b/_themes-core.scss @@ -25,6 +25,8 @@ @include mat.core(); +mat.$theme-ignore-duplication-warnings: true; + //noinspection SassScssUnresolvedMixin, SassScssResolvedByNameOnly @mixin make-stylesheets($themes-map) { @each $css-class, $theme in $themes-map { From bcd0f60e69bfb14cbd5420f8ef516c5d3094466c Mon Sep 17 00:00:00 2001 From: Elikill58 Date: Sat, 16 Sep 2023 11:53:38 +0200 Subject: [PATCH 13/13] Fix workflow --- .github/workflows/auto-pack.yml | 2 +- _themes-core.scss | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-pack.yml b/.github/workflows/auto-pack.yml index 7c27fb4..445dff3 100644 --- a/.github/workflows/auto-pack.yml +++ b/.github/workflows/auto-pack.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: 18 + node-version: [18] steps: - uses: actions/checkout@v3 diff --git a/_themes-core.scss b/_themes-core.scss index 24b95a4..e060261 100644 --- a/_themes-core.scss +++ b/_themes-core.scss @@ -53,6 +53,10 @@ mat.$theme-ignore-duplication-warnings: true; accent-base: $accent-base, warn-base: $warn-base, ), + typography: mat.define-typography-config( + $font-family: serif, + ), + density: 0, )); @include angular-material-theme($mat-theme); @if mixin-exists(themed-stylesheets) { @@ -73,7 +77,9 @@ mat.$theme-ignore-duplication-warnings: true; accent-base: $accent-base, warn-base: $warn-base, ), - typography: mat.define-typography-config(), + typography: mat.define-typography-config( + $font-family: serif, + ), density: 0, )); @include angular-material-theme($mat-theme);