-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b2b35c
commit 2a2b5b1
Showing
16 changed files
with
244 additions
and
244 deletions.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
docs/src/app/components/pages/components/FontIcon/ExampleMaterialIcons.jsx
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,18 @@ | ||
import React from 'react'; | ||
import FontIcon from 'material-ui/lib/font-icon'; | ||
import Colors from 'material-ui/lib/styles/colors'; | ||
|
||
const iconStyles = { | ||
marginRight: 24, | ||
}; | ||
|
||
const FontIconExampleMaterial = () => ( | ||
<div> | ||
<FontIcon className="material-icons" style={iconStyles} >home</FontIcon> | ||
<FontIcon className="material-icons" style={iconStyles} color={Colors.red500}>flight_takeoff</FontIcon> | ||
<FontIcon className="material-icons" style={iconStyles} color={Colors.yellow500}>cloud_download</FontIcon> | ||
<FontIcon className="material-icons" style={iconStyles} color={Colors.blue500}>videogame_asset</FontIcon> | ||
</div> | ||
); | ||
|
||
export default FontIconExampleMaterial; |
26 changes: 26 additions & 0 deletions
26
docs/src/app/components/pages/components/FontIcon/ExampleSimple.jsx
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,26 @@ | ||
import React from 'react'; | ||
import FontIcon from 'material-ui/lib/font-icon'; | ||
import Colors from 'material-ui/lib/styles/colors'; | ||
|
||
const iconStyles = { | ||
marginRight: 24, | ||
}; | ||
|
||
const FontIconExampleSimple = () => ( | ||
<div> | ||
<FontIcon | ||
className="muidocs-icon-action-home" | ||
style={iconStyles} /> | ||
<FontIcon | ||
className="muidocs-icon-action-home" | ||
style={iconStyles} | ||
color={Colors.blue500} /> | ||
<FontIcon | ||
className="muidocs-icon-action-home" | ||
style={iconStyles} | ||
color={Colors.red500} | ||
hoverColor={Colors.greenA200} /> | ||
</div> | ||
); | ||
|
||
export default FontIconExampleSimple; |
26 changes: 26 additions & 0 deletions
26
docs/src/app/components/pages/components/FontIcon/Page.jsx
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,26 @@ | ||
import React from 'react'; | ||
import CodeExample from '../../../CodeExample'; | ||
import PropTypeDescription from '../../../PropTypeDescription'; | ||
import MarkdownElement from '../../../MarkdownElement'; | ||
|
||
import iconCode from '!raw!material-ui/lib/font-icon'; | ||
import iconReadmeText from './README'; | ||
import IconExampleSimple from './ExampleSimple'; | ||
import iconExampleSimpleCode from '!raw!./ExampleSimple'; | ||
import IconExampleMaterial from './ExampleMaterialIcons'; | ||
import iconExampleMaterialCode from '!raw!./ExampleMaterialIcons'; | ||
|
||
const FontIconPage = () => ( | ||
<div> | ||
<MarkdownElement text={iconReadmeText} /> | ||
<CodeExample code={iconExampleSimpleCode}> | ||
<IconExampleSimple /> | ||
</CodeExample> | ||
<CodeExample code={iconExampleMaterialCode}> | ||
<IconExampleMaterial /> | ||
</CodeExample> | ||
<PropTypeDescription code={iconCode} /> | ||
</div> | ||
); | ||
|
||
export default FontIconPage; |
16 changes: 16 additions & 0 deletions
16
docs/src/app/components/pages/components/FontIcon/README.md
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,16 @@ | ||
## Font Icons | ||
This component will render any [icon](https://www.google.com/design/spec/style/icons.html#) defined in any style sheets included in your project. | ||
We are using [Google's Material Design Icons](https://github.com/google/material-design-icons) for our documentation site along with some custom icons. | ||
You can use sites like IcoMoon for generating custom font files. | ||
To use FontIcons, add your stylesheet to your project and reference the icon's className in the "className" prop. | ||
|
||
We also support [Google's Material Icons](http://google.github.io/material-design-icons/) as seen in the third block of code. | ||
If you're using the material icons, be sure to include the link to the font icon file in your head section: | ||
```html | ||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | ||
``` | ||
|
||
To see available Material Icons, go to [material icons library](https://design.google.com/icons/). | ||
Google's material icon's names are in snake_case format. For example: ActionHome would be written as action_home. | ||
|
||
### Examples |
16 changes: 16 additions & 0 deletions
16
docs/src/app/components/pages/components/SVGIcon/ExampleHover.jsx
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,16 @@ | ||
import React from 'react'; | ||
import Colors from 'material-ui/lib/styles/colors'; | ||
import ActionHome from 'material-ui/lib/svg-icons/action/home'; | ||
|
||
const iconStyles = { | ||
marginRight: 24, | ||
}; | ||
|
||
const SvgIconExampleHover = () => ( | ||
<div> | ||
<ActionHome style={iconStyles}/> | ||
<ActionHome style={iconStyles} color={Colors.blue500} hoverColor={Colors.greenA200} /> | ||
</div> | ||
); | ||
|
||
export default SvgIconExampleHover; |
22 changes: 22 additions & 0 deletions
22
docs/src/app/components/pages/components/SVGIcon/ExampleIcons.jsx
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,22 @@ | ||
import React from 'react'; | ||
import ActionHome from 'material-ui/lib/svg-icons/action/home'; | ||
import ActionFlightTakeoff from 'material-ui/lib/svg-icons/action/flight-takeoff'; | ||
import FileCloudDownload from 'material-ui/lib/svg-icons/file/cloud-download'; | ||
import HardwareVideogameAsset from 'material-ui/lib/svg-icons/hardware/videogame-asset'; | ||
import Colors from 'material-ui/lib/styles/colors'; | ||
|
||
|
||
const iconStyles = { | ||
marginRight: 24, | ||
}; | ||
|
||
const SvgIconExampleIcons = () => ( | ||
<div> | ||
<ActionHome style={iconStyles}/> | ||
<ActionFlightTakeoff style={iconStyles} color={Colors.red500} /> | ||
<FileCloudDownload style={iconStyles} color={Colors.yellow500} /> | ||
<HardwareVideogameAsset style={iconStyles} color={Colors.blue500} /> | ||
</div> | ||
); | ||
|
||
export default SvgIconExampleIcons; |
18 changes: 18 additions & 0 deletions
18
docs/src/app/components/pages/components/SVGIcon/ExampleSimple.jsx
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,18 @@ | ||
import React from 'react'; | ||
import ActionHome from 'material-ui/lib/svg-icons/action/home'; | ||
import Colors from 'material-ui/lib/styles/colors'; | ||
|
||
|
||
const iconStyles = { | ||
marginRight: 24, | ||
}; | ||
|
||
const SvgIconExampleSimple = () => ( | ||
<div> | ||
<ActionHome style={iconStyles} /> | ||
<ActionHome style={iconStyles} color={Colors.blue500} /> | ||
<ActionHome style={iconStyles} color={Colors.red500} hoverColor={Colors.greenA200} /> | ||
</div> | ||
); | ||
|
||
export default SvgIconExampleSimple; |
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,26 @@ | ||
import React from 'react'; | ||
import CodeExample from '../../../CodeExample'; | ||
import PropTypeDescription from '../../../PropTypeDescription'; | ||
import MarkdownElement from '../../../MarkdownElement'; | ||
|
||
import iconCode from '!raw!material-ui/lib/svg-icon'; | ||
import iconReadmeText from './README'; | ||
import IconExampleSimple from './ExampleSimple'; | ||
import iconExampleSimpleCode from '!raw!./ExampleSimple'; | ||
import IconExampleIcons from './ExampleIcons'; | ||
import iconExampleIconsCode from '!raw!./ExampleIcons'; | ||
|
||
const SvgIconPage = () => ( | ||
<div> | ||
<MarkdownElement text={iconReadmeText} /> | ||
<CodeExample code={iconExampleSimpleCode}> | ||
<IconExampleSimple /> | ||
</CodeExample> | ||
<CodeExample code={iconExampleIconsCode}> | ||
<IconExampleIcons /> | ||
</CodeExample> | ||
<PropTypeDescription code={iconCode} /> | ||
</div> | ||
); | ||
|
||
export default SvgIconPage; |
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,5 @@ | ||
## SVG Icons | ||
Using material-ui's SVG Icon, we can create a custom [svg component](https://www.google.com/design/spec/style/icons.html#icons-system-icons). In our examples, we are creating the ActionHome SvgIcon for this docs site, and using it in some separate component. | ||
Custom SvgIcon components can be included as children for other Material UI components that use icons such as [IconButtons](http://www.material-ui.com/#/components/icon-buttons). | ||
|
||
### Examples |
Oops, something went wrong.