Skip to content

Commit

Permalink
Explain font replacement on public API
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Aug 18, 2023
1 parent 998d545 commit 633fee5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions projects/natural/src/lib/modules/icon/icon.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import {MatIconRegistry} from '@angular/material/icon';
import {NATURAL_ICONS_CONFIG, NaturalIconsConfig} from './icon.directive';

/**
* Configure Material Symbols, instead of Material Icons, and configure custom Natural icons
* Configure Material Symbols, instead of Material Icons, and configure custom Natural icons.
*
* This means that `https://fonts.googleapis.com/icon?family=Material+Icons` must be
* replaced by `https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@1`.
*/
export function provideIcons(config: NaturalIconsConfig): Provider[] {
return [
Expand All @@ -18,8 +21,6 @@ export function provideIcons(config: NaturalIconsConfig): Provider[] {
const iconRegistry = inject(MatIconRegistry);
return () => {
// Replace the old Material Icons by the new Material Symbols
// This means that `https://fonts.googleapis.com/icon?family=Material+Icons` must be
// replaced by `https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@1`
const defaultFontSetClasses = iconRegistry.getDefaultFontSetClass();
const outlinedFontSetClasses = defaultFontSetClasses
.filter(fontSetClass => fontSetClass !== 'material-icons')
Expand Down

0 comments on commit 633fee5

Please sign in to comment.