Skip to content

Commit

Permalink
fix(): theming
Browse files Browse the repository at this point in the history
  • Loading branch information
vapkse committed Jul 3, 2024
1 parent 83adbb2 commit 79feb6e
Show file tree
Hide file tree
Showing 20 changed files with 712 additions and 42 deletions.
3 changes: 3 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,5 +601,8 @@
}
}
}
},
"cli": {
"analytics": false
}
}
653 changes: 653 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"prepare": "husky || true",
"new-package": "ng g .:new-package",
"release:dry-run": "nx release --verbose --dry-run",
"postinstall": "patch-package"
"postinstall": "patch-package",
"ng": "ng"
},
"workspaces": [
"projects/core",
Expand Down
19 changes: 17 additions & 2 deletions projects/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,23 @@
],
"sideEffects": false,
"exports": {
".": {
"sass": "./styles"
"./theme": {
"sass": "./styles/_theme.scss"
},
"./themeVariables": {
"sass": "./styles/_themeVariables.scss"
},
"./menu": {
"sass": "./styles/mixins/_menu.scss"
},
"./menu-theme": {
"sass": "./styles/mixins/_menu-theme.scss"
},
"./loader-theme": {
"sass": "./styles/mixins/_loader-theme.scss"
},
"./icon-theme": {
"sass": "./styles/mixins/_icon-theme.scss"
}
},
"scripts": {
Expand Down
4 changes: 1 addition & 3 deletions projects/core/src/styles/_theme.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
@use '@angular/material' as mat;
@use './themeVariables' as themeVariables;
@use './mixins/material-icons-theme' as materialIconsTheme;
@use './mixins/ngx-components-theme' as ngxComponentsTheme;

@import './roboto';

// Include theme styles for core and each component used in the app
@include mat.core();
@include mat.all-component-themes(themeVariables.$theme);
@include materialIconsTheme.material-icons-theme();
@include ngxComponentsTheme.all-component-themes(themeVariables.$theme);
@include materialIconsTheme.theme();

body#hug-ngx {
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion projects/core/src/styles/mixins/_icon-theme.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use '@angular/material' as mat;

@mixin icon-theme($theme) {
@mixin theme($theme) {
$primary: map-get($theme, primary);
$accent: map-get($theme, accent);
$warn: map-get($theme, warn);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use '@angular/material' as mat;

@mixin loader-theme($theme) {
@mixin theme($theme) {
$primary: map-get($theme, primary);

.loader {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

$fontFamily: "Material Symbols Outlined Variable";

@mixin material-icons-theme {
@mixin theme {
.mat-icon {
font-family: $fontFamily;

Expand Down
2 changes: 1 addition & 1 deletion projects/core/src/styles/mixins/_menu-theme.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use "@angular/material" as mat;

@mixin menu-theme($theme) {
@mixin theme($theme) {
$primary: map-get($theme, primary);

.ngx-menu,
Expand Down
25 changes: 0 additions & 25 deletions projects/core/src/styles/mixins/_ngx-components-theme.scss

This file was deleted.

5 changes: 5 additions & 0 deletions projects/layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"components"
],
"sideEffects": false,
"exports": {
".": {
"sass": "./_layout-theme.scss"
}
},
"scripts": {
"lint": "eslint . --fix",
"test": "ng test layout",
Expand Down
2 changes: 1 addition & 1 deletion projects/layout/src/_layout-theme.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use '@angular/material'as mat;

@mixin layout-theme($theme) {
@mixin theme($theme) {
$primary: map-get($theme, primary);
$accent: map-get($theme, accent);
$background: map-get($theme, background);
Expand Down
4 changes: 2 additions & 2 deletions projects/list-loader/src/list-loader.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CommonModule } from '@angular/common';
import { NgIf } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';

@Component({
Expand All @@ -9,7 +9,7 @@ import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@a
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [
CommonModule
NgIf
]
})
export class ListLoaderComponent {
Expand Down
5 changes: 5 additions & 0 deletions projects/message-box-dialog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"components"
],
"sideEffects": false,
"exports": {
".": {
"sass": "./_message-box-dialog-theme.scss"
}
},
"scripts": {
"lint": "eslint . --fix",
"test": "ng test message-box-dialog",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use '@angular/material' as mat;

@mixin message-box-dialog-theme($theme) {
@mixin theme($theme) {
$warn: map-get($theme, warn);

.cdk-overlay-container {
Expand Down
5 changes: 5 additions & 0 deletions projects/search-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"components"
],
"sideEffects": false,
"exports": {
".": {
"sass": "./_search-container-theme.scss"
}
},
"scripts": {
"lint": "eslint . --fix",
"test": "ng test search-container",
Expand Down
2 changes: 1 addition & 1 deletion projects/search-container/src/_search-container-theme.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use '@angular/material' as mat;

@mixin search-container-theme($theme) {
@mixin theme($theme) {
$primary: map-get($theme, primary);
$accent: map-get($theme, accent);
$background: map-get($theme, background);
Expand Down
5 changes: 5 additions & 0 deletions projects/sidenav/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"components"
],
"sideEffects": false,
"exports": {
".": {
"sass": "./_sidenav-theme.scss"
}
},
"scripts": {
"lint": "eslint . --fix",
"test": "ng test sidenav",
Expand Down
5 changes: 5 additions & 0 deletions projects/user-card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"components"
],
"sideEffects": false,
"exports": {
".": {
"sass": "./_user-card-theme.scss"
}
},
"scripts": {
"lint": "eslint . --fix",
"test": "ng test user-card",
Expand Down
4 changes: 2 additions & 2 deletions projects/user-card/src/_user-card-theme.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@use '@angular/material' as mat;

@mixin user-card-theme($theme) {
@mixin theme($theme) {
$foreground: map-get($theme, foreground);
$background: map-get($theme, background);

Expand All @@ -27,7 +27,7 @@
}
}

.header-separator,
.header-separator,
.header-initials {
color: mat.get-color-from-palette(mat.$grey-palette, 400);
}
Expand Down

0 comments on commit 79feb6e

Please sign in to comment.