Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material Theme: multiple issues #2151

Closed
Arikael opened this issue Jan 19, 2018 · 7 comments
Closed

Material Theme: multiple issues #2151

Arikael opened this issue Jan 19, 2018 · 7 comments

Comments

@Arikael
Copy link

Arikael commented Jan 19, 2018

I'm submitting a ... (check one with "x")

[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/ceolter/ag-grid/blob/master/CONTRIBUTING.md#question

Current behavior
Material theme doesn't work as expected.

  • Allow theming svg icons #1982 is not fixed in 15.0.0, the code isn't in the files. (EDIT: this is also true for the bootstrap theme, maybe others too. I just tested material and bootstrap)
  • $header-background-color can't be set because it's not in the $params map
  • setting header-height when using floatingFilter leads to weird behavior. Example: I set the variable to 30px and headerHeight in gridOptions to 30px, won't be reflect in the filters ag-grid-row
    Result
    <div class="ag-header-row" role="presentation" style="top: 30px; height: 56px; width: 1170px;">
    it will always render 56px

Expected behavior
All are settable.

Minimal reproduction of the problem with instructions
the following code won't set anything

$header-background-color: green;
$icon-color: red;
$header-height: 30px;
@import '~ag-grid/src/styles/ag-grid';
@import '~ag-grid/src/styles/ag-theme-material';

set headerHeight in your GridOptions

  • ag-Grid version: 15.0.0
  • Browser:
  • Language: [SCSS]
@Arikael Arikael changed the title Material Theme: Set header-background and icon color Material Theme: multiple issues Jan 19, 2018
@jzahka
Copy link

jzahka commented Jan 22, 2018

I was struggling with this as well. Just found that in some documentation they use a special webpack loader called svg-colorize-loader. https://github.com/ag-grid/ag-grid-customise-theme/blob/f0d58ffcaa9675d3732636b81b3f081c15152d5e/webpack.config.js#L36

I'm going to try this out today, I'll let you know if it works!

@petyosi
Copy link
Contributor

petyosi commented Jan 24, 2018

  • you need the loader to customize the icon colours. see the repo @jzahka linked.
  • Indeed, the header background color is not customizable in the material theme. The material specs themselves do not suggest different colors for headers. You might tweak that through a css selector, though.
  • check the floatingFiltersHeight property in the docs.

Please file your bug reports as a separate issues, that would help us addressing them better. Thanks.

@petyosi petyosi closed this as completed Jan 24, 2018
@sumcoding
Copy link

@petyosi For those using ag-grid without webpack what are the options to color the icons?

@petyosi
Copy link
Contributor

petyosi commented Feb 16, 2018

@sumcoding you can edit the svg files manually and change the colors in there. Of course, any sort of file preprocessing can do that for you.

@Arikael
Copy link
Author

Arikael commented Feb 26, 2018

but what happened to #1982 ?

I'm using angular cli and ejecting the whole webpack config just to color the svg icons is not an option

@petyosi
Copy link
Contributor

petyosi commented Feb 27, 2018

#1982 refers to the svg-webpack-loader implementation - not sure what you mean by referring to it.

If you can afford to support the latest browsers only, then you can also change the colors of the icons using filters over the icon class. This is what I tried initially when implementing the SVG icons. However, it is hard to achieve exact colors with this method. It also does not work well in old IE.

@Arikael
Copy link
Author

Arikael commented Mar 2, 2018

ok, maybe it completly missunderstood. sorry if that's the case.

I thought the line background-image: url('#{$ag-mat-icons-path}#{$icon}.svg?color=#{encodecolor($ag-mat-icon-color)}'); is CSS/SASS Code and not something for webpack,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants