Skip to content

Instantly share code, notes, and snippets.

@bludnic
Created September 9, 2017 17:59
Show Gist options
  • Save bludnic/319fa3b96460c9009710a2721cf8f601 to your computer and use it in GitHub Desktop.
Save bludnic/319fa3b96460c9009710a2721cf8f601 to your computer and use it in GitHub Desktop.
Custom icons for ion-tabs
/** Custom Icons **/
ion-icon {
&[class*="ci-"] {
// Instead of using the font-based icons
// We're applying SVG masks
mask-size: contain;
mask-position: 50% 50%;
mask-repeat: no-repeat;
background: currentColor;
width: 1em;
height: 1em;
}
// custom icons
&[class*="ci-home"] {
mask-image: url(../assets/icons/ic_home_black_24px.svg);
}
&[class*="ci-popular"] {
mask-image: url(../assets/icons/ic_video_library_black_24px.svg);
}
&[class*="ci-menu"] {
mask-image: url(../assets/icons/ic_image_black_24px.svg);
}
&[class*="ci-bookmark"] {
mask-image: url(../assets/icons/ic_favorite_black_24px.svg);
}
&[class*="ci-bookmark-border"] {
mask-image: url(../assets/icons/ic_favorite_border_black_24px.svg);
}
}
// Examples:
// <ion-tab [root]="popularRoot" tabTitle="{{ 'Popular' | translate }}" tabIcon="ci-popular"></ion-tab>
// <ion-icon name="ci-popular"></ion-icon>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment