Skip to content

Commit 89d1b55

Browse files
committed
relocate some files
1 parent 1d63d38 commit 89d1b55

File tree

5 files changed

+31
-11
lines changed

5 files changed

+31
-11
lines changed

projects/lib-workspace/src/styles.scss

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
@use '@angular/material' as mat;
2-
3-
mat.$theme-ignore-duplication-warnings: true;
1+
@use "@angular/material" as mat;
2+
@use "../../ng-mat-components" as fs-components;
43

54
body {
65
margin: 0;
@@ -16,7 +15,7 @@ body {
1615
}
1716

1817
@include mat.core();
19-
@import "../../ng-mat-components/src/fs-mat-components-theme.scss";
18+
@import "../../ng-mat-components";
2019

2120
// Define a light theme
2221
$light-primary: mat.define-palette(mat.$indigo-palette);
@@ -44,13 +43,13 @@ $dark-theme: mat.define-dark-theme(
4443

4544
// Apply the dark theme by default
4645
@include mat.all-component-themes($dark-theme);
47-
@include fs-mat-components-theme($dark-theme);
46+
@include fs-components.all-component-themes($dark-theme);
4847

4948
// Apply the light theme only when the `.my-light-theme` CSS class is applied
5049
// to an ancestor element of the components (such as `body`).
5150
.my-light-theme {
52-
@include mat.all-component-themes($light-theme);
53-
@include fs-mat-components-theme($light-theme);
51+
@include mat.all-component-colors($light-theme);
52+
@include fs-components.all-component-themes($light-theme);
5453
}
5554

5655
.mat-form-field:not(.mat-form-field-has-label) .mat-form-field-infix {
@@ -66,4 +65,3 @@ $dark-theme: mat.define-dark-theme(
6665
.mat-form-field-label-wrapper {
6766
padding-top: 0px;
6867
}
69-
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@use "sass:color";
2+
@use "sass:map";
3+
4+
@use './theming';
5+
6+
@forward "./_theming.scss" show all-component-themes;
7+
8+
@mixin all-component-themes($theme-or-color-config) {
9+
@include theming.theme($theme-or-color-config);
10+
}

projects/ng-mat-components/fs-mat-components-theme.scss renamed to projects/ng-mat-components/_theming.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@import "~@angular/material/theming";
33

44
// Define a mixin that accepts a theme and outputs the color styles for the component.
5-
@mixin fs-mat-components-theme($theme) {
5+
@mixin theme($theme) {
66
// Extract whichever individual palettes you need from the theme.
77
$primary: map-get($theme, primary);
88
$accent: map-get($theme, accent);

projects/ng-mat-components/ng-package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"entryFile": "src/public-api.ts"
66
},
77
"assets": [
8-
"./fs-mat-components-theme.scss"
8+
"./_index.scss",
9+
"./_theming.scss"
910
]
1011
}

projects/ng-mat-components/package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@angular/common": "^13.0.0",
77
"@angular/core": "^13.0.0",
88
"moment": "^2.29.0",
9-
"@angular/material": ">=13.0.0"
9+
"@angular/material": "^13.0.0"
1010
},
1111
"dependencies": {
1212
"tslib": "^2.3.0"
@@ -24,5 +24,16 @@
2424
},
2525
"bugs": {
2626
"url": "https://github.com/fullstack-devops/ng-mat-components/issues"
27+
},
28+
"exports": {
29+
".": {
30+
"sass": "./_index.scss"
31+
},
32+
"./theming": {
33+
"sass": "./_theming.scss"
34+
},
35+
"./_theming": {
36+
"sass": "./_theming.scss"
37+
}
2738
}
2839
}

0 commit comments

Comments
 (0)