ng-matero / extensions

Angular Material Extensions Library.
https://ng-matero.github.io/extensions/
MIT License
393 stars 48 forks source link

Supply default theme #51

Closed Daragoza closed 1 year ago

Daragoza commented 3 years ago

The startup guide mentions using the following import and includes to style components:

@import '~@ng-matero/extensions/theming';

@include material-extensions-theme($theme);
@include material-extensions-experimental-theme($theme);

However I am using a default Angular theme in my angular.json file as follows:

"styles": [
              "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
              "src/styles.sass"
            ],

How can I have the material extensions library use my default angular theme? Merely importing @import '~@ng-matero/extensions/theming'; is not enough to style my select elements.

nzbin commented 3 years ago

I think you can try add the theming in src/styles.scss or prebuilt the theming styles.

Daragoza commented 3 years ago

I moved the indigo-pink css to the styles.css file like so @import '~@angular/material/prebuilt-themes/indigo-pink.css'but that changes nothing unfortunately.

I made an attempt at creating a theme to directly add to @include material-extensions-theme(). I am very new at this and don't quite follow.

This is my current error message

4 │   $config: mat-get-color-config($config-or-theme);
  │                                 ^^^^^^^^^^^^^^^^
  ╵
  node_modules/@ng-matero/extensions/data-grid/column-resize/_column-resize.scss 4:33  mat-column-resize-color()
  node_modules/@ng-matero/extensions/data-grid/_grid-theme.scss 102:3                  mtx-grid-theme()
  node_modules/@ng-matero/extensions/_theming.scss 14:3                                material-extensions-theme()

I understand this is a map of sorts that obtains the styling it needs for a particular element. But I can only assume that when I fix this eror, the next one is already waiting until I fix the entirety of the mat angular theming. That can't be the solution.

Shouldn't I be able to take the appropriate theme from Material Angular and supply that to material-extensions?

davidecampello commented 2 years ago

Hi huys! I'm having the same issue. Have you found a solution?

Daragoza commented 2 years ago

Unfortunately not. I don't recall the exact requirements, but I think I made the component I needed from scratch.

nzbin commented 1 year ago

Now 15.2.0 has added pre-built themes, I will sync this feature to v14 in the next week.