This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(icons): add support for font-icons with ligatures and Material-I…
…con demos Closes #3059.
- Loading branch information
1 parent
b58ff47
commit a107490
Showing
10 changed files
with
328 additions
and
53 deletions.
There are no files selected for viewing
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/components/icon/demoFontIcons/script.js → ...con/demoFontIconsWithClassnames/script.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<div ng-controller="DemoCtrl" ng-cloak > | ||
|
||
<p> | ||
Display 4 Material Design font-icons using ligatures [instead of CSS names]; each with different sizes and colors<br/> | ||
</p> | ||
|
||
<!-- Display font icons from Icomoon.io: --> | ||
<div class="glyph" ng-repeat="font in fonts" layout="row"> | ||
<div ng-repeat="it in sizes" flex layout-align="center center" style="text-align: center;" layout="column"> | ||
<div flex></div> | ||
<div class="preview-glyphs"> | ||
<md-icon md-font-library="material-icons" | ||
ng-style="{color: font.color}" | ||
alt="{{ font.name }}" | ||
class="step" | ||
ng-class="it.size"> | ||
{{ font.name }} | ||
</md-icon> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<p style="font-size:0.7em;padding-left: 25%"> | ||
<span style="color:darkblue; font-weight: bold">Cool Tip</span>: | ||
Copy an icon and then paste in a text editor to see its textual name! | ||
</p> | ||
|
||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" | ||
rel="stylesheet"> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
angular | ||
.module('appDemoFontIconsWithLigatures', ['ngMaterial']) | ||
.controller('DemoCtrl', function( $scope ) { | ||
// Specify a list of font-icons with ligatures and color overrides | ||
var iconData = [ | ||
{name: 'accessibility' , color: "#777" }, | ||
{name: 'question_answer', color: "rgb(89, 226, 168)" }, | ||
{name: 'backup' , color: "#A00" }, | ||
{name: 'email' , color: "#00A" } | ||
]; | ||
|
||
$scope.fonts = [].concat(iconData); | ||
|
||
// Create a set of sizes... | ||
$scope.sizes = [ | ||
{size:"md-18",padding:0}, | ||
{size:"md-24",padding:2}, | ||
{size:"md-36",padding:6}, | ||
{size:"md-48",padding:10} | ||
]; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
.appDemoFontIconsWithLigatures { | ||
padding:25px; | ||
width: 100%; | ||
} | ||
.appDemoFontIconsWithLigatures, | ||
.appDemoFontIconsWithLigatures *:before, | ||
.appDemoFontIconsWithLigatures *:after { | ||
box-sizing: border-box; | ||
} | ||
|
||
header { | ||
overflow: hidden; | ||
} | ||
|
||
header h1 { | ||
color: #888; | ||
font-size: 36px; | ||
font-weight: 300; | ||
} | ||
|
||
.container { | ||
margin: 0 auto; | ||
max-width: 1200px; | ||
min-width: 960px; | ||
padding: 40px 40px; | ||
font: 14px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
} | ||
|
||
.glyph { | ||
border-bottom: 1px dotted #ccc; | ||
padding: 10px 0 20px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.preview-scale, | ||
.preview-glyphs { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.preview-scale { | ||
color: #888; | ||
font-size: 12px; | ||
margin-top: 24px; | ||
} | ||
|
||
.step { | ||
flex-grow: 1; | ||
line-height: 0.5; | ||
} | ||
|
||
.usage { margin-top: 10px; } | ||
.usage input { | ||
font-family: monospace; | ||
text-align: center; | ||
} | ||
.usage .point { width: 150px; } | ||
.usage .class { width: 250px; } | ||
|
||
/* Rules for sizing the icon.*/ | ||
.material-icons.md-18 { font-size: 18px; } | ||
.material-icons.md-24 { font-size: 24px; } | ||
.material-icons.md-36 { font-size: 36px; } | ||
.material-icons.md-48 { font-size: 48px; } | ||
|
||
/* Rules for using icons as black on a light background.*/ | ||
.material-icons.md-dark { color: rgba(0, 0, 0, 0.54); } | ||
.material-icons.md-dark.md-inactive { color: rgba(0, 0, 0, 0.26); } | ||
|
||
/* Rules for using icons as white on a dark background.*/ | ||
.material-icons.md-light { color: rgba(255, 255, 255, 1); } | ||
.material-icons.md-light.md-inactive { color: rgba(255, 255, 255, 0.3); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.