diff --git a/examples/webpack-demo-vanilla-bundle/src/examples/example02.scss b/examples/webpack-demo-vanilla-bundle/src/examples/example02.scss index a15fa2d28..f1df40ac6 100644 --- a/examples/webpack-demo-vanilla-bundle/src/examples/example02.scss +++ b/examples/webpack-demo-vanilla-bundle/src/examples/example02.scss @@ -1,6 +1,4 @@ $control-height: 2.4em; -$icon-color: #363636; -$icon-color-mdi-close: $icon-color; @import '@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-material.scss'; @import 'bulma/bulma'; diff --git a/examples/webpack-demo-vanilla-bundle/src/examples/example03.scss b/examples/webpack-demo-vanilla-bundle/src/examples/example03.scss index a998dc977..babafaadd 100644 --- a/examples/webpack-demo-vanilla-bundle/src/examples/example03.scss +++ b/examples/webpack-demo-vanilla-bundle/src/examples/example03.scss @@ -1,6 +1,12 @@ $control-height: 2.4em; -$icon-color: #363636; -$icon-color-mdi-close: red; @import '@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-salesforce.scss'; @import 'bulma/bulma'; + +.slick-groupby-remove.mdi-close { + /** 1. use `filter` color */ + // filter: invert(32%) sepia(96%) saturate(7466%) hue-rotate(356deg) brightness(97%) contrast(120%); + + /** 2. or use the SASS @mixin that will produce the `filter` color */ + @include filtercolor(#ff0000, 0.9); // convert red color into `filter` with opacity of 0.9 +} diff --git a/examples/webpack-demo-vanilla-bundle/src/examples/example06.scss b/examples/webpack-demo-vanilla-bundle/src/examples/example06.scss index f9f202722..222b19b7a 100644 --- a/examples/webpack-demo-vanilla-bundle/src/examples/example06.scss +++ b/examples/webpack-demo-vanilla-bundle/src/examples/example06.scss @@ -3,10 +3,33 @@ $icon-width-mdi-plus: 14px; $icon-width-mdi-arrow-collapse: 14px; $icon-width-mdi-arrow-expand: 14px; $icon-width-mdi-close-thick: 12px; -$icon-color-mdi-file-pdf-outline: #f14668; -$icon-color-mdi-file-music-outline: #3298dc; -$icon-color-mdi-file-excel-outline: #1E9F75; -$icon-color-mdi-folder: orange; -$icon-color-mdi-folder-open: orange; + +/* You can change the SASS color via the associated variable, BUT it's better to use the filtercolor @mixing shown down below */ +// $icon-color-mdi-file-pdf-outline: #f14668; +// $icon-color-mdi-file-music-outline: #3298dc; +// $icon-color-mdi-file-excel-outline: #1E9F75; +// $icon-color-mdi-folder: orange; +// $icon-color-mdi-folder-open: #ffa500; @import '@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-material.scss'; + +.icon.mdi-file-pdf-outline { + /** 1. use `filter` color */ + // filter: invert(62%) sepia(93%) saturate(5654%) hue-rotate(325deg) brightness(100%) contrast(90%); + + /** 2. or use the SASS @mixin that will produce the `filter` color */ + @include filtercolor(#f14668, 0.9); +} + +.icon.mdi-folder, .icon.mdi-folder-open { + @include filtercolor(#ffa500, 0.9); +} +.icon.mdi-file-music-outline { + @include filtercolor(#3298dc, 0.9); +} +.icon.mdi-file-excel-outline { + @include filtercolor(#1E9F75, 0.9); +} +.icon.mdi-file-document-outline { + @include filtercolor(#686868, 0.9); +} diff --git a/packages/common/src/styles/material-svg-icons.scss b/packages/common/src/styles/material-svg-icons.scss index 4b444d6d6..84caa8971 100644 --- a/packages/common/src/styles/material-svg-icons.scss +++ b/packages/common/src/styles/material-svg-icons.scss @@ -1,16 +1,24 @@ /* icon color */ +$icon-color-mdi-alert-circle: $icon-color !default; +$icon-color-mdi-alert-octagon: $icon-color !default; $icon-color-mdi-arrow-collapse: $icon-color !default; $icon-color-mdi-arrow-expand: $icon-color !default; $icon-color-mdi-cancel: $icon-color !default; +$icon-color-mdi-cash-check: $icon-color !default; +$icon-color-mdi-cash-remove: $icon-color !default; $icon-color-mdi-check: $icon-color !default; $icon-color-mdi-checkbox-blank-outline: $icon-color !default; $icon-color-mdi-check-box-outline: $icon-color !default; $icon-color-mdi-checkbox-marked: $icon-color !default; +$icon-color-mdi-check-circle: $icon-color !default; +$icon-color-mdi-check-outline: $icon-color !default; $icon-color-mdi-close: $icon-color !default; $icon-color-mdi-close-circle: $icon-color !default; $icon-color-mdi-close-circle-outline: $icon-color !default; $icon-color-mdi-close-thick: $icon-color !default; $icon-color-mdi-content-copy: $icon-color !default; +$icon-color-mdi-currency-usd: $icon-color !default; +$icon-color-mdi-currency-usd-off: $icon-color !default; $icon-color-mdi-database-refresh: $icon-color !default; $icon-color-mdi-download: $icon-color !default; $icon-color-mdi-file-document-outline: $icon-color !default; @@ -52,18 +60,26 @@ $icon-color-mdi-table-refresh: $icon-color !default; $icon-color-mdi-undo: $icon-color !default; /* icon width */ +$icon-width-mdi-alert-circle: $icon-width !default; +$icon-width-mdi-alert-octagon: $icon-width !default; $icon-width-mdi-arrow-collapse: $icon-width !default; $icon-width-mdi-arrow-expand: $icon-width !default; $icon-width-mdi-cancel: $icon-width !default; +$icon-width-mdi-cash-check: $icon-width !default; +$icon-width-mdi-cash-remove: $icon-width !default; $icon-width-mdi-check: $icon-width !default; $icon-width-mdi-checkbox-blank-outline: $icon-width !default; $icon-width-mdi-check-box-outline: $icon-width !default; $icon-width-mdi-checkbox-marked: $icon-width !default; +$icon-width-mdi-check-circle: $icon-width !default; +$icon-width-mdi-check-outline: $icon-width !default; $icon-width-mdi-close: $icon-width !default; $icon-width-mdi-close-circle: $icon-width !default; $icon-width-mdi-close-circle-outline: $icon-width !default; $icon-width-mdi-close-thick: $icon-width !default; $icon-width-mdi-content-copy: $icon-width !default; +$icon-width-mdi-currency-usd: $icon-width !default; +$icon-width-mdi-currency-usd-off: $icon-width !default; $icon-width-mdi-database-refresh: $icon-width !default; $icon-width-mdi-download: $icon-width !default; $icon-width-mdi-file-document-outline: $icon-width !default; @@ -105,6 +121,16 @@ $icon-width-mdi-table-refresh: $icon-width !default; $icon-width-mdi-undo: $icon-width !default; .mdi { + &.mdi-alert-circle:before { + width: $icon-width-mdi-alert-circle; + display: inline-block; + content: url('data:image/svg+xml,'); + } + &.mdi-alert-octagon:before { + width: $icon-width-mdi-alert-octagon; + display: inline-block; + content: url('data:image/svg+xml,'); + } &.mdi-arrow-collapse:before { width: $icon-width-mdi-arrow-collapse; display: inline-block; @@ -120,6 +146,16 @@ $icon-width-mdi-undo: $icon-width !default; display: inline-block; content: url('data:image/svg+xml,'); } + &.mdi-cash-check:before { + width: $icon-width-mdi-cash-check; + display: inline-block; + content: url('data:image/svg+xml,'); + } + &.mdi-cash-remove:before { + width: $icon-width-mdi-cash-remove; + display: inline-block; + content: url('data:image/svg+xml,'); + } &.mdi-check:before { width: $icon-width-mdi-check; display: inline-block; @@ -140,6 +176,16 @@ $icon-width-mdi-undo: $icon-width !default; display: inline-block; content: url('data:image/svg+xml,'); } + &.mdi-check-circle:before { + width: $icon-width-mdi-check-circle; + display: inline-block; + content: url('data:image/svg+xml,'); + } + &.mdi-check-outline:before { + width: $icon-width-mdi-check-outline; + display: inline-block; + content: url('data:image/svg+xml,'); + } &.mdi-close:before { width: $icon-width-mdi-close; display: inline-block; @@ -165,6 +211,16 @@ $icon-width-mdi-undo: $icon-width !default; display: inline-block; content: url('data:image/svg+xml,'); } + &.mdi-currency-usd:before { + width: $icon-width-mdi-currency-usd; + display: inline-block; + content: url('data:image/svg+xml,'); + } + &.mdi-currency-usd-off:before { + width: $icon-width-mdi-currency-usd-off; + display: inline-block; + content: url('data:image/svg+xml,'); + } &.mdi-database-refresh:before { width: $icon-width-mdi-database-refresh; display: inline-block; diff --git a/packages/common/src/styles/sass-utilities.scss b/packages/common/src/styles/sass-utilities.scss index 67a923636..71c85e470 100644 --- a/packages/common/src/styles/sass-utilities.scss +++ b/packages/common/src/styles/sass-utilities.scss @@ -6,3 +6,29 @@ $string: '%23' + $string; @return $string; } + +@mixin filtercolor($color: #000, $opacity: 1) { + $r: red($color) / 255; + $g: green($color) / 255; + $b: blue($color) / 255; + $a: $opacity; + + // grayscale fallback if SVG from data url is not supported + $lightness: lightness($color); + filter: saturate(0%) brightness(0%) invert($lightness) opacity($opacity); + + // color filter + $svg-filter-id: "filtercolor"; + filter: url('data:image/svg+xml;utf8,\ + \ + \ + \ + \ + \ + ##{$svg-filter-id}'); +}