Skip to content

Commit

Permalink
icons fonts include font awesome and google icons
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno12mota committed Jun 16, 2016
1 parent 7921a91 commit 47075ec
Show file tree
Hide file tree
Showing 50 changed files with 126 additions and 3,204 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 6 additions & 5 deletions lib/shared/elements/icon/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,22 @@ export default class Icon extends Component {
static style = style;

render () {
const classMap = this.props.styleClassMap || {};
const {relax, styleClassMap, align, icon} = this.props;
const classMap = styleClassMap || {};
const props = {
htmlTag: 'div',
...this.props.relax,
...relax,
settings,
style: {
textAlign: this.props.align
textAlign: align
}
};

return (
<Element {...props}>
<div className={cx(classes.holder, classMap.holder)}>
<i className={cx(this.props.icon && this.props.icon.className, classMap.icon)}>
{this.props.icon && this.props.icon.content}
<i className={cx(icon && icon.className, classMap.icon)}>
{icon && icon.content}
</i>
</div>
</Element>
Expand Down
4 changes: 3 additions & 1 deletion lib/shared/screens/admin/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'styles/icons/font-awesome/index.less';
import 'styles/icons/google-icons/index.less';
import 'styles/icons/nucleo/index.less';
import 'styles/normalize.less';
import 'styles/nucleo/index.less';

import Component from 'components/component';
import React, {PropTypes} from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Component from 'components/component';
import React, {PropTypes} from 'react';

import styles from './icon-picker.less';

export default class IconPicker extends Component {
static propTypes = {
value: PropTypes.number.isRequired,
Expand All @@ -10,25 +12,29 @@ export default class IconPicker extends Component {
};

render () {
const {openSelector} = this.props;

return (
<div className='icon-picker' onClick={this.props.openSelector}>
<div className={styles.root} onClick={openSelector}>
{this.renderSelected()}
</div>
);
}

renderSelected () {
const {value} = this.props;

let result;
if (this.props.value && this.props.value.family) {
if (value && value.family) {
result = (
<div className='selected'>
<i className={this.props.value.className}>
{this.props.value.content}
<div className={styles.selected}>
<i className={value.className}>
{value.content}
</i>
</div>
);
} else {
result = <p>No icon selected</p>;
result = <div className={styles.none}>No icon selected</div>;
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@import '~styles/colors.less';

.root {
background-color: @chromeBackgroundDarkerColor;
border: 1px solid @chromeBordersColor;
text-align: center;
width: 100%;
max-width: 290px;
height: 100px;
border-radius: 3px;

&:hover {
border-color: @primary;
}
}

.selected {
:global i {
font-size: 40px;
line-height: 100px;
color: @adminText;
}
}

.none {
font-size: 12px;
color: @adminText;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import bind from 'decorators/bind';
import Component from 'components/component';
import React, {PropTypes} from 'react';

Expand All @@ -15,12 +16,14 @@ export default class IconPickerContainer extends Component {
};
}

@bind
openSelector () {
this.setState({
selector: true
});
}

@bind
closeSelector () {
this.setState({
selector: false
Expand All @@ -32,8 +35,8 @@ export default class IconPickerContainer extends Component {
<IconPicker
{...this.props}
{...this.state}
openSelector={::this.openSelector}
closeSelector={::this.closeSelector}
openSelector={this.openSelector}
closeSelector={this.closeSelector}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/screens/auth/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'styles/icons/nucleo/index.less';
import 'styles/normalize.less';
import 'styles/nucleo/index.less';

import Component from 'components/component';
import React, {PropTypes} from 'react';
Expand Down
6 changes: 6 additions & 0 deletions lib/shared/styles/icons/font-awesome/index.less

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions lib/shared/styles/icons/google-icons/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
:global {

@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(/fonts/material-icons/MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(/fonts/material-icons/MaterialIcons-Regular.woff2) format('woff2'),
url(/fonts/material-icons/MaterialIcons-Regular.woff) format('woff'),
url(/fonts/material-icons/MaterialIcons-Regular.ttf) format('truetype');
}

.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;

/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;

/* Support for IE. */
font-feature-settings: 'liga';
}

}
2 changes: 2 additions & 0 deletions lib/shared/styles/icons/nucleo/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import './outline/nucleo-outline.less';
@import './mini/nucleo-mini.less';
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ Created using IcoMoon - icomoon.io
-------------------------------- */
@import "./variables.less";

@font-face {
font-family: 'Nucleo Mini';
src: url('/fonts/nucleo-mini.eot');
src: url('/fonts/nucleo-mini.eot') format('embedded-opentype'),
url('/fonts/nucleo-mini.woff2') format('woff2'),
url('/fonts/nucleo-mini.woff') format('woff'),
url('/fonts/nucleo-mini.ttf') format('truetype'),
url('/fonts/nucleo-mini.svg') format('svg');
font-weight: normal;
font-style: normal;
}

:global {
@font-face {
font-family: 'Nucleo Mini';
src: url('/fonts/nucleo/nucleo-mini.eot');
src: url('/fonts/nucleo/nucleo-mini.eot') format('embedded-opentype'),
url('/fonts/nucleo/nucleo-mini.woff2') format('woff2'),
url('/fonts/nucleo/nucleo-mini.woff') format('woff'),
url('/fonts/nucleo/nucleo-mini.ttf') format('truetype'),
url('/fonts/nucleo/nucleo-mini.svg') format('svg');
font-weight: normal;
font-style: normal;
}

/*------------------------
base class definition
-------------------------*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Created using IcoMoon - icomoon.io

@font-face {
font-family: 'Nucleo Outline';
src: url('/fonts/nucleo-outline.eot');
src: url('/fonts/nucleo-outline.eot') format('embedded-opentype'),
url('/fonts/nucleo-outline.woff2') format('woff2'),
url('/fonts/nucleo-outline.woff') format('woff'),
url('/fonts/nucleo-outline.ttf') format('truetype'),
url('/fonts/nucleo-outline.svg') format('svg');
src: url('/fonts/nucleo/nucleo-outline.eot');
src: url('/fonts/nucleo/nucleo-outline.eot') format('embedded-opentype'),
url('/fonts/nucleo/nucleo-outline.woff2') format('woff2'),
url('/fonts/nucleo/nucleo-outline.woff') format('woff'),
url('/fonts/nucleo/nucleo-outline.ttf') format('truetype'),
url('/fonts/nucleo/nucleo-outline.svg') format('svg');
font-weight: normal;
font-style: normal;
}
Expand Down
2 changes: 0 additions & 2 deletions lib/shared/styles/nucleo/index.less

This file was deleted.

Binary file removed lib/shared/styles/nucleo/mini/fonts/nucleo-mini.eot
Binary file not shown.
Loading

0 comments on commit 47075ec

Please sign in to comment.